WIN-2308041133\Administrator 6 månader sedan
förälder
incheckning
e31f4f4171

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

@@ -181,9 +181,8 @@ class Lave extends Api
         if (cache('lave_' . $where['user_id'])) $this->error('正在处理中');
         $plan_id=$where1['plan_id'];
 //        unset($where1['plan_id']);
-        $order = LaveMonthModel::create($where1);
-
         $where1['contract_code'] = WechatPlanRecord::getNewCode();
+        $order = LaveMonthModel::create($where1);
         $where1['contract_display_account']=$where1['name'];
         cache('lave_' . $where['user_id'], '1', 10);
         if (!$order) $this->error(LaveMonthModel::getErrorInfo());

+ 1 - 1
application/common/model/LaveMonth.php

@@ -158,7 +158,7 @@ class LaveMonth extends BaseModel
             $no = 1;
         }
         $SN = $cid . "_" . str_pad($no, 8, '0', STR_PAD_LEFT);
-        $res = self::where('order_id', $order_id)->where('cid', $cid)->update(['paid' => 1, 'paytime' => time(), "SN" => $SN]);//订单改为支付
+        $res = self::where('contract_code', $order_id)->where('cid', $cid)->update(['paid' => 1, 'paytime' => time(), "SN" => $SN]);//订单改为支付
         return false !== $res;
     }
 

+ 1 - 3
extend/liuniu/WechatService.php

@@ -358,9 +358,7 @@ class WechatService
             @file_put_contents("quanju.txt", json_encode($notify)."-签约返回内容\r\n", 8);
 //            @file_put_contents("quanju.txt", json_encode($successful)."-这是什么\r\n", 8);
             if (isset($notify['plan_id'])) {
-                @file_put_contents("quanju.txt", $notify['plan_id']."-模版编号\r\n", 8);
                 if (isset($notify['change_type']) && $notify['change_type']) {
-                    @file_put_contents("quanju.txt", $notify['change_type']."-签约返回状态\r\n", 8);
                     if ($notify['change_type']=='ADD'){
                         $cs=WechatPlanRecord::where('contract_code',$notify['contract_code'])->Update(['contract_id' => $notify['contract_id']]);
                     }elseif ($notify['change_type']=='DELETE'){
@@ -371,7 +369,7 @@ class WechatService
                         $notify['contract_code'] = substr($notify['contract_code'], $count + 1);
                     }
                     $params = [$cid, $notify['contract_code']];
-                    Hook::exec("\\liuniu\\repositories\\PaymentRepositories", "wechat" . ucfirst('lave'), $params);
+                    Hook::exec("\\liuniu\\repositories\\PaymentRepositories", "wechat" . ucfirst('MonthLave'), $params);
                     @file_put_contents("quanju.txt", json_encode($params)."-不知道行不行\r\n", 8);
                 }
                 $data = ['eventkey' => 'notify', 'command' => '', 'refreshtime' => time(), 'openid' => $notify['openid'], 'message' => json_encode($notify)];