wesmiler 1 nedēļu atpakaļ
vecāks
revīzija
ec73040b9c
1 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 4 2
      app/Services/Api/AccountService.php

+ 4 - 2
app/Services/Api/AccountService.php

@@ -343,12 +343,13 @@ class AccountService extends BaseService
 
         RedisService::set($cacheKey, ['date' => date('Y-m-d H:i:s')], rand(2, 3));
         $mealInfo = PayMealsModel::where(['id' => $mealId, 'status' => 1, 'mark' => 1])
-            ->select(['id','product_id', 'money', 'type', 'discount', 'remark', 'status'])
+            ->select(['id','product_id','gift', 'money', 'type', 'discount', 'remark', 'status'])
             ->first();
         $money = isset($mealInfo['money']) ? floatval($mealInfo['money']) : 0;
         $discount = isset($mealInfo['discount']) ? intval($mealInfo['discount']) : 0;
         $mealType = isset($mealInfo['type']) && $mealInfo['type'] ? intval($mealInfo['type']) : 1;
-        $productId= isset($mealInfo['product_id']) ? $mealInfo['product_id'] : 0;
+        $productId = isset($mealInfo['product_id']) ? $mealInfo['product_id'] : 0;
+        $gift = isset($mealInfo['gift']) ? $mealInfo['gift'] : '';
         $price = $discount?moneyFormat($money*$discount/100,2): $money;
         if (empty($mealInfo)) {
             $this->error = '该套餐不存在';
@@ -439,6 +440,7 @@ class AccountService extends BaseService
             'bonus_settle' => 2,
             'id_card_no' => $idCardNo,
             'create_time' => time(),
+            'gift' => $gift,
             'remark' => $remark,
             'status' => 1,
             'mark' => 1