WIN-2308041133\Administrator 6 月之前
父節點
當前提交
cd7dd5df90
共有 2 個文件被更改,包括 15 次插入7 次删除
  1. 6 1
      application/api/controller/Lave.php
  2. 9 6
      extend/liuniu/WechatService.php

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

@@ -220,7 +220,12 @@ class Lave extends Api
                 return $this->error($e->getMessage());
             }
             $info['jsConfig'] = $jsConfig;
-
+//            增加参与人数
+            $count=WechatPlanRecord::where('uid', $where1['user_id'])->count();
+            if ($count==0){
+                $num=WechatPlan::where('id', $plan_id)->value('num');
+                WechatPlan::where('id', $plan_id)->update(['num' => $num+1]);
+            }
             return $this->success('订单创建成功', $info);
 
         } else $this->error(LaveModel::getErrorInfo());

+ 9 - 6
extend/liuniu/WechatService.php

@@ -355,19 +355,22 @@ class WechatService
                 $wechatContext = WechatContext::create($data, true);
                 return true;
             }
-            @file_put_contents("quanju.txt", json_encode($notify)."-签约成功内容\r\n", 8);
+            @file_put_contents("quanju.txt", json_encode($notify)."-签约返回内容\r\n", 8);
             if ($successful && 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'){
+                        $cs=WechatPlanRecord::where('contract_code',$notify['contract_code'])->Update(['is_signing' => 1]);
+                    }
+                    @file_put_contents("quanju.txt", $notify['change_type']."-签约返回状态\r\n", 8);
                     if (($count = strpos($notify['contract_code'], '_')) !== false) {
                         $notify['contract_code'] = substr($notify['contract_code'], $count + 1);
                     }
                     $params = [$cid, $notify['contract_code']];
                     Hook::exec("\\liuniu\\repositories\\PaymentRepositories", "wechat" . ucfirst('lavesign'), $params);
-                    if ($notify['change_type']=='ADD'){
-                        WechatPlanRecord::where('contract_code',$notify['contract_code'])->where('cid',$cid)->Update(['contract_id' => $notify['contract_id']]);
-                    }elseif ($notify['change_type']=='DELETE'){
-                        WechatPlanRecord::where('contract_code',$notify['contract_code'])->where('cid',$cid)->Update(['is_signing' => 1]);
-                    }
                 }
                 $data = ['eventkey' => 'notify', 'command' => '', 'refreshtime' => time(), 'openid' => $notify['openid'], 'message' => json_encode($notify)];
                 $wechatContext = WechatContext::create($data, true);