Browse Source

添加质抵押订单

afa 7 tháng trước cách đây
mục cha
commit
ec8f417c04

+ 3 - 2
application/common/logic/PledgeLogic.php

@@ -43,18 +43,19 @@ class PledgeLogic
             ->join('product_list b', 'a.product_id = b.id', 'left')
             ->where('a.user_id', $user_id)
             ->where('a.status', $model::Paid)
-            ->whereIn('a.order_no', $order_no)->column('a.id,b.thum');
+            ->whereIn('a.order_no', $order_no)->column('b.id,b.thum');
 
         if(empty($product) || count($product) != count($order_no))  throw new Exception('订单不存在');
         $pledge_num = 1;
         if($pledge->type_id == ProductPledges::Single){
             $pledge_num = count($order_no);
         }
+
         //添加订单 
         Loader::model('UserPledge')::setPledgeData($user_id, $pledge->id, $pledge->product_id, 
         ['product'=>$product, 'order_no'=>$order_no], //订单信息
         $pledge->day_num, $pledge_num);
-   
+       
         //修改状态
         return $model->whereIn('order_no', $order_no)->setField('status', $model::Freeze);
     }

+ 1 - 1
application/common/model/UserPledge.php

@@ -34,7 +34,7 @@ class UserPledge extends Model
     const Ongoing= 1;
     const Remove = 2;
 
-    public static function setPledgeData($user_id, $pledge_id, $product, $product_id, $day_num, $num)
+    public static function setPledgeData($user_id, $pledge_id, $product_id, $product,$day_num, $num)
     {
         return self::create([
             'user_id'   => $user_id,