WIN-2308041133\Administrator 1 year ago
parent
commit
cf427d1006

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

@@ -225,9 +225,11 @@ class Lave extends Api
             }
             $info['jsConfig'] = $jsConfig;
 //            增加参与人数
-            $count=WechatPlanRecord::where('uid', $where1['user_id'])->count();
+            $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');
+                @file_put_contents("quanju.txt", $num."-参与人数\r\n", 8);
                 WechatPlan::where('id', $plan_id)->update(['num' => $num+1]);
             }
             return $this->success('订单创建成功', $info);

+ 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('contract_code', $order_id)->where('cid', $cid)->update(['paid' => 1, 'paytime' => time(), "SN" => $SN]);//订单改为支付
+        $res = self::where('contract_code', $order_id)->where('cid', $cid)->where('paid',0)->update(['paid' => 1, 'paytime' => time(), "SN" => $SN]);//订单改为支付
         return false !== $res;
     }
 

+ 2 - 0
extend/liuniu/WechatService.php

@@ -359,9 +359,11 @@ class WechatService
 //            @file_put_contents("quanju.txt", json_encode($successful)."-这是什么\r\n", 8);
             if (isset($notify['plan_id'])) {
                 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'){
+                        @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);

+ 1 - 1
extend/liuniu/repositories/PaymentRepositories.php

@@ -95,7 +95,7 @@ class PaymentRepositories
     {
         list($cid, $order_id) = $event;
         try {
-            if (LaveMonth::where(['cid' => $cid, 'order_id' => $order_id, 'paid' => 1])->find()) return true;
+            if (LaveMonth::where(['cid' => $cid, 'contract_code' => $order_id, 'paid' => 1])->find()) return true;
             return LaveMonth::paySuccess($cid, $order_id);
         } catch (\Exception $e) {
             return false;