Explorar o código

Wesmiler 人人车 初始化项目 0816

APPLE %!s(int64=3) %!d(string=hai) anos
pai
achega
47ea31c092
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      application/api/controller/v1/taxiUser/User.php

+ 8 - 1
application/api/controller/v1/taxiUser/User.php

@@ -318,7 +318,10 @@ class User extends ApiController
         ];
 
         var_dump($data);
-        if($orderid = UserPaymentOrder::insertGetId($data)){
+        DB::startTrans();
+        $orderid = UserPaymentOrder::insertGetId($data);
+        if(!$orderid){
+            Db::rollback();
             return IResponse::failure('创建升级订单失败');
         }
 
@@ -330,6 +333,10 @@ class User extends ApiController
             'order_idx' =>  $orderid,
             'ascription' => 'level' // 归属订单
         ]);
+        if(!$logID){
+            Db::rollback();
+            return IResponse::failure('升级订单提交失败');
+        }
 
         // 返回支付单号
         return $this->ApiJson(0,'升级订单提交成功', [