WIN-2308041133\Administrator 6 miesięcy temu
rodzic
commit
0f8f3528d1
1 zmienionych plików z 6 dodań i 6 usunięć
  1. 6 6
      application/api/controller/Pay.php

+ 6 - 6
application/api/controller/Pay.php

@@ -848,7 +848,7 @@ class Pay extends Api
             $up = [
                 'vid' => $order['vid'],
                 'vname' => $order['vname'],
-                'uid' => $user['uid'],
+                'uid' => $order['uid'],
                 'link_id' => $order['id'],
                 'num' => $order['num'],
                 'after' => $contribution,
@@ -875,7 +875,7 @@ class Pay extends Api
             $after = $user->money - $money;
             if ($data['type'] == 1) {
                 Db::startTrans();
-//                try {
+                try {
                     //更新会员信息
                     $user->save(['money' => $after]);
                     //写入日志
@@ -910,10 +910,10 @@ class Pay extends Api
 
                     Db::commit();
                     $this->success(__('操作成功'));
-//                } catch (Exception $e) {
-//                    Db::rollback();
-//                    $this->error($e->getMessage());
-//                }
+                } catch (Exception $e) {
+                    Db::rollback();
+                    $this->error($e->getMessage());
+                }
             } else if ($data['type'] > 1) {
                 $this->error(__('已经支付'));
             }