|
@@ -3,6 +3,7 @@
|
|
|
namespace liuniu;
|
|
|
|
|
|
use app\admin\model\Company;
|
|
|
+use app\admin\model\WechatPlanRecord;
|
|
|
use app\common\model\WechatContext;
|
|
|
use EasyWeChat\Factory;
|
|
|
use EasyWeChat\Kernel\Messages\Article;
|
|
@@ -356,15 +357,20 @@ class WechatService
|
|
|
}
|
|
|
@file_put_contents("quanju.txt", json_encode($notify)."-签约成功内容\r\n", 8);
|
|
|
if ($successful && isset($notify['plan_id'])) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ if (isset($notify['change_type']) && $notify['change_type']) {
|
|
|
+ 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);
|
|
|
return true;
|
|
|
}
|
|
|
});
|