afa 6 сар өмнө
parent
commit
d98c172a6b

+ 6 - 5
application/api/logic/MarketLogic.php

@@ -57,10 +57,12 @@ class MarketLogic
       {
             //市场
             $market = ProductMarket::where('product_id', $orderInfo['product_id'])->find();
+            //转让
+            $rows  = ProductTransfer::where('order_id', $orderId)->find();
             if($market){
                   $isUpdate = false;
                   //是否全部取消
-                  $rows  = ProductTransfer::where('order_id', $orderId)->find();
+             
                   $count = ProductTransfer::where('product_id', $orderInfo['product_id'])->where('status', ProductTransfer::Normal)->count();
                   if($count == 1){
                         $isUpdate = true;
@@ -74,11 +76,10 @@ class MarketLogic
                   }
                   //市场状态
                   if($isUpdate) $market->save();
-      
-                  //转让列表取消
-                  $rows->status = ProductTransfer::Stop;
-                  $rows->save();
             }
+            //转让列表取消
+            $rows->status = ProductTransfer::Stop;
+            $rows->save();
             //新增记录
             return ProductOrder::setCreateOrder($orderInfo['order_id'], $orderInfo, ProductOrder::Popular, $userId, $orderInfo['from_user'], getOrderSN('R'.$orderInfo['order_id']), 0, $orderInfo->popular_price);
       }