Compare commits
No commits in common. '96f93b8025885ea65a457fd7a1904b6c6986f660' and 'c9d2c3090f404ec927bcd40b8fe75da111de11c2' have entirely different histories.
96f93b8025
...
c9d2c3090f
@ -1,47 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Workerman\Lib;
|
|
||||||
|
|
||||||
use Workerman\Worker;
|
|
||||||
|
|
||||||
$bot_loop = new Worker();
|
|
||||||
$bot_loop->count = 1;
|
|
||||||
$bot_loop->name = 'WxSend';
|
|
||||||
function WxSend($order_id)
|
|
||||||
{
|
|
||||||
Tool::log('开始执行WxSend任务', 2);
|
|
||||||
$url = Tool::ini('WX_SEND');
|
|
||||||
$res = Tool::post($url, [
|
|
||||||
'id' => $order_id
|
|
||||||
]);
|
|
||||||
Tool::log(json_encode($res, JSON_UNESCAPED_UNICODE), 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
function WxSendFunc()
|
|
||||||
{
|
|
||||||
$db = Db::get();
|
|
||||||
$pay_check = $db->getRow("select * from orders where status = ?
|
|
||||||
and appointment_number is not null
|
|
||||||
and wx_day1_sendmsg_status = 0
|
|
||||||
and wx_day1_sendmsg_time <= ?
|
|
||||||
order by wx_day1_sendmsg_time asc", [
|
|
||||||
2, date('Y-m-d H:i:s')
|
|
||||||
]);
|
|
||||||
if (!!$pay_check) {
|
|
||||||
Db2::u($db, 'orders', [
|
|
||||||
'wx_day1_sendmsg_time' => date('Y-m-d H:i:s'),
|
|
||||||
], 'where id = ?', [
|
|
||||||
$pay_check['id']
|
|
||||||
]);
|
|
||||||
WxSend($pay_check['id']);
|
|
||||||
} else {
|
|
||||||
Tool::log('WxSend未检测到任务');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$bot_loop->onWorkerStart = function () {
|
|
||||||
WxSendFunc();
|
|
||||||
Timer::add(10, function () {
|
|
||||||
WxSendFunc();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Loading…
Reference in New Issue