WIN-2308041133\Administrator 6 months ago
parent
commit
ecf51631b0
1 changed files with 3 additions and 2 deletions
  1. 3 2
      application/api/controller/Lave.php

+ 3 - 2
application/api/controller/Lave.php

@@ -172,17 +172,18 @@ class Lave extends Api
         $where1 = $where;
         unset($where1['from']);
         $where1['order_id'] = LaveModel::getNewOrderId();
-        $where1['contract_code'] = WechatPlanRecord::getNewCode();
         $contract_display_account = User::where('id', $where1['user_id'])->value('nickname');
         if (empty($contract_display_account)){
             $this->error('用户不存在!');
         }
-        $where1['contract_display_account']=$contract_display_account;
+
         if (cache('lave_' . $where['user_id'])) $this->error('正在处理中');
         @file_put_contents("lave.txt", json_encode($where1));
         $plan_id=$where1['plan_id'];
         unset($where1['plan_id']);
         $order = LaveModel::create($where1);
+        $where1['contract_code'] = WechatPlanRecord::getNewCode();
+        $where1['contract_display_account']=$contract_display_account;
         cache('lave_' . $where['user_id'], '1', 10);
         if (!$order) $this->error(LaveModel::getErrorInfo());
         $orderId = $order['order_id'];