This commit is contained in:
2025-03-22 18:30:38 +08:00
parent e58ed1ee14
commit 504bf7885c
8 changed files with 24 additions and 17 deletions
+5 -2
View File
@@ -1,6 +1,6 @@
<?php
namespace process;
namespace app\process;
use app\controller\FeishuController;
use app\model\Customer;
@@ -11,10 +11,11 @@ use Workerman\Crontab\Crontab;
class Task
{
public function onWorkerStart()
{
// 每半小时执行一次
new Crontab('30/* * * * *', function () {
new Crontab('1/* * * * * *', function () {
echo date('Y-m-d H:i:s') . "\n";
$customer = Customer::where(['follow_next', '<=', time() + 3600])
->where(['follow_next', '>', time()])
@@ -31,6 +32,8 @@ class Task
$host = $parsedUrl['host'];
$port = isset($parsedUrl['port']) ? ':' . $parsedUrl['port'] : '';
$url = $host .$port. '/pages/customer/detile?id='.$customer->id;
$item->warn = 1;
$item->update();
FeishuController::class->send($feishuUser->open_id, '跟进提醒', '您有新的跟进提醒', $url);
}
}