|
|
@@ -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('查询签约状态失败!');
|
|
|
+// }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
?>
|