afa 7 months ago
parent
commit
c6b1e7b177
2 changed files with 2 additions and 3 deletions
  1. 1 1
      application/api/controller/Order.php
  2. 1 2
      application/common/model/ProductOrder.php

+ 1 - 1
application/api/controller/Order.php

@@ -25,7 +25,7 @@ class Order extends Api
     /**
      * 创建订单
      */
-    public function create(ProductPopular $productPopular, ProductOrder $productOrder, ProductArea $productArea, LedgerWalletModel $ledgerWalletModel, UserModel $userModel)
+    public function create(ProductPopular $productPopular, ProductOrder $productOrder, LedgerWalletModel $ledgerWalletModel, UserModel $userModel)
     {
         $params = $this->request->post();
         $validate = \think\Loader::validate('Order');

+ 1 - 2
application/common/model/ProductOrder.php

@@ -96,9 +96,8 @@ class ProductOrder extends Model
             //判断持有数量足够
             $total_num = $synthesis[$key.'_num'] * $num;
             if($total_num > self::getUserOrderNum($uid, $item)) throw new Exception(__("材料不足"));;
-            
             //关闭持有订单
-            $result = self::where('user_id', $uid)->where('product_id', $item)->where('type_id', self::Popular)->where('status', self::Paid)->limit($total_num)->setField('status', self::Closure);
+            $result = self::where('user_id', $uid)->where('product_id', $item)->where('status', self::Paid)->limit($total_num)->setField('status', self::Closure);
         }
         return $result;
     }