afa 7 months ago
parent
commit
045afc964e

+ 3 - 7
application/api/controller/Market.php

@@ -17,7 +17,7 @@ use app\common\model\UserBuying;
 use fast\Action;
 use fast\Asset;
 use think\Db;
-use think\Exception;
+use Exception;
 
 class Market extends Api
 {
@@ -68,19 +68,15 @@ class Market extends Api
         $params = $this->request->post();
         $validate = \think\Loader::validate('Market');
         if(!$validate->scene('transferlock')->check($params)) $this->error($validate->getError());
-        Db::startTrans();
         try {
 
             $marketLogic::setTransferLock($productTransfer, config('market_transfer.lock_time'), $params['transfer_id']);
           
-            // 提交事务
-            Db::commit();
         } catch (Exception $e) {
             // 回滚事务
-            Db::rollback();
-            $this->error($e->getMessage(), null, $e->getCode());
+            $this->error($e->getMessage());
         }
-        $this->success('ok');
+       
     }
 
 

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

@@ -168,7 +168,7 @@ class Order extends Api
             Db::commit();
         } catch (Exception $e) {
             Db::rollback();
-            $this->error($e->getMessage(), null, $e->getCode());
+            $this->error($e->getMessage());
         }
         $this->success('ok');
     }
@@ -218,7 +218,7 @@ class Order extends Api
         } catch (Exception $e) {
             // 回滚事务
             Db::rollback();
-            $this->error( $e->getMessage(), null, $e->getCode());
+            $this->error( $e->getMessage());
         }
         $this->success('ok');
     }

+ 0 - 2
application/api/logic/MarketLogic.php

@@ -15,7 +15,6 @@ use app\common\model\ProductMarket;
 class MarketLogic
 {
 
-
       // 添加市场寄售订单
       public static function createTransferOrder(float $price, int $productId, int $areaId, string $orderNo, int $userId, array $params)
       {
@@ -98,7 +97,6 @@ class MarketLogic
             return $productTransfer->whereIn('id', $transferId)
                   ->update(['lock_time'=> $time, 'is_lock' => $productTransfer::Lock]);
 
-
       }
 
 }