...
|
...
|
@@ -25,6 +25,8 @@ |
|
|
*/
|
|
|
|
|
|
use think\Config;
|
|
|
use WeChat\Exceptions\InvalidResponseException;
|
|
|
use WeChat\Exceptions\LocalCacheException;
|
|
|
use WeMini\Newtmpl;
|
|
|
use Workerman\Lib\Timer;
|
|
|
|
...
|
...
|
@@ -49,11 +51,8 @@ class Events |
|
|
'appsecret' => '2c2aa784ee902248d7360dde74c8e299',
|
|
|
'mch_id' => '1577676721',
|
|
|
'mch_key' => 'MmXiXHO16b89tNx75t3T8rHTYMQBbn19',
|
|
|
//'notify_url' => '127.0.0.1/wake/public/api/order/notify',
|
|
|
'notify_url' => 'https://wake.w.brotop.cn/api/order/notify',
|
|
|
//'course_sign_tmp' => '0A7sPV2VrDo7_3Fo5q9z-Ddh-m85_GvF15ANspbo70Ey',
|
|
|
'course_sign_tmp' => 'Y24N0zGcKj2tEFOh1elMoy5j5ppRK8MSGGINyaX5gYc',
|
|
|
//'course_start_tmp' => '0A7sPV2VrDo7_3Fo5q9z-Ddh-m85_GvF15ANspbo70Ey',
|
|
|
'course_sign_tmp' => 'yBH9F7IO75_fc7w4SDWIrmTyLHsPLZ5fOf2Z4jwY-Q4',
|
|
|
'course_start_tmp' => 'Y24N0zGcKj2tEFOh1elMoy5j5ppRK8MSGGINyaX5gYc',
|
|
|
'order_over_tmp' => '586FN0OLJ1DPZgwPwh7Ke2P4wewhm7l67awB77qrOi8',
|
|
|
];
|
...
|
...
|
@@ -65,11 +64,12 @@ class Events |
|
|
error_log('order_over');
|
|
|
$template = new Newtmpl($config);
|
|
|
$order = new \app\admin\model\Order();
|
|
|
$order = $order->where(['status'=>'success','end'=>['<',date('Y-m-d H:i:s')]])->with('user')->select();
|
|
|
$order = $order->where(['status'=>'success','end'=>['<',date('Y-m-d H:i:s'), 'notify'=> false]])->with('user')->select();
|
|
|
$notice = new \app\admin\model\UserNotice();
|
|
|
foreach ($order as $k){
|
|
|
|
|
|
$order = new \app\admin\model\Order();
|
|
|
$order->save(['status'=>'over'],['id'=>$k['id']]);
|
|
|
$order->save(['status'=>'over','notify'=>true],['id'=>$k['id']]);
|
|
|
|
|
|
$insert = [
|
|
|
'user_id' => $k['id'],
|
...
|
...
|
@@ -91,7 +91,13 @@ class Events |
|
|
"name3" => ["value" => $k['user']['nickname']],
|
|
|
],
|
|
|
];
|
|
|
$template->send($data);
|
|
|
try {
|
|
|
$template->send($data);
|
|
|
} catch (InvalidResponseException $e) {
|
|
|
} catch (LocalCacheException $e) {
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -146,7 +152,12 @@ class Events |
|
|
],
|
|
|
];
|
|
|
|
|
|
$template->send($data);
|
|
|
try {
|
|
|
$template->send($data);
|
|
|
} catch (InvalidResponseException $e) {
|
|
|
} catch (LocalCacheException $e) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
...
|
...
|
|