WIN-2308041133\Administrator 6 kuukautta sitten
vanhempi
commit
3b6015b0b2
2 muutettua tiedostoa jossa 7 lisäystä ja 7 poistoa
  1. 1 1
      application/api/controller/Lave.php
  2. 6 6
      extend/liuniu/WechatService.php

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

@@ -228,7 +228,7 @@ class Lave extends Api
             $count=WechatPlanRecord::where('uid', $where1['user_id'])->where('plan_id',$plan_id)->count();
             @file_put_contents("quanju.txt", $count."-参与次数\r\n", 8);
             if ($count==0){
-                $num=WechatPlan::where('id', $plan_id)->value('num');
+                $num=WechatPlan::where('plan_id', $plan_id)->value('num');
                 @file_put_contents("quanju.txt", $num."-参与人数\r\n", 8);
                 WechatPlan::where('id', $plan_id)->update(['num' => $num+1]);
             }

+ 6 - 6
extend/liuniu/WechatService.php

@@ -362,17 +362,17 @@ class WechatService
                     @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']]);
+                        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('MonthLave'), $params);
+                        @file_put_contents("quanju.txt", json_encode($params)."-不知道行不行\r\n", 8);
                     }elseif ($notify['change_type']=='DELETE'){
                         @file_put_contents("quanju.txt", "-关闭签约\r\n", 8);
                         $cs=WechatPlanRecord::where('contract_code',$notify['contract_code'])->Update(['is_signing' => 1,'deletetime'=>time()]);
                     }
                     @file_put_contents("quanju.txt", $cs."-修改记录\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('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)];
                 $wechatContext = WechatContext::create($data, true);