WIN-2308041133\Administrator 6 months ago
parent
commit
84e3c23f56
2 changed files with 33 additions and 0 deletions
  1. 32 0
      application/api/controller/Lave.php
  2. 1 0
      application/route.php

+ 32 - 0
application/api/controller/Lave.php

@@ -351,6 +351,38 @@ class Lave extends Api
             $this->error('查询签约状态失败!');
         }
     }
+    //    测试查询签约状态
+    public function csquerySign(Request $request)
+    {
+        $where = UtilService::postMore(
+            [
+                ['cid', ''],
+                ['user_id', ''],
+                ['contract_code',''],
+                ['plan_id', ''],
+            ], $request
+        );
+//        $sign_info = WechatPlanRecord::where('cid', $cid)->where('uid', $uid)->where('is_signing', 1)->find();
+//        if (!$sign_info) {
+//            $this->error('未找到签约信息!');
+//        }
+        $mch_id = Company::where('id', $where['cid'])->value('mch_id');
+//        $plan_id = $sign_info['plan_id'];
+//        $contract_code = $sign_info['contract_code'];
+        $rs = WechatService::querySign($mch_id, $where['contract_code'], $where['plan_id']);
+        @file_put_contents("quanju.txt", json_encode($rs) . "-查询签约状态返回结果\r\n", 8);
+//        if ($rs['return_code'] == 'SUCCESS') {
+//            if ($rs['contract_state'] == 1) {
+//                WechatPlanRecord::where('cid',$cid)->where('uid', $uid)->where('is_signing', 1)->update(['is_signing' => 0]);
+//                return false;
+//            }else{
+//                WechatPlanRecord::where('cid',$cid)->where('uid', $uid)->where('is_signing', 1)->update(['contract_id' => $rs['contract_id']]);
+//                return true;
+//            }
+//        } else {
+//            $this->error('查询签约状态失败!');
+//        }
+    }
 }
 
 ?>

+ 1 - 0
application/route.php

@@ -88,6 +88,7 @@ Route::group('api', function () {
         Route::get('pay_sign', 'api/lave/paySign');  //签约订单支付
         Route::get('pay_pap', 'api/lave/payPap');  //申请扣款
         Route::get('query_sign', 'api/lave/querySign');  //查询签约
+        Route::get('cs_query_sign', 'api/lave/csquerySign');  //测试查询签约
     });
     //帮扶
     Route::group('help', function () {