公海,转让,名片
This commit is contained in:
@@ -4,6 +4,7 @@ namespace app\process;
|
||||
|
||||
use app\controller\FeishuController;
|
||||
use app\model\Customer;
|
||||
use app\model\CustomerHis;
|
||||
use app\model\FeishuUser;
|
||||
use app\model\User;
|
||||
use support\Log;
|
||||
@@ -71,6 +72,29 @@ class Task
|
||||
Log::info('send follow start',[time()]);
|
||||
});
|
||||
|
||||
|
||||
// 每小时执行一次
|
||||
new Crontab('0 10 * * * *', function(){
|
||||
echo date('Y-m-d H:i:s') . "\n";
|
||||
Log::info('send high seas start',[time()]);
|
||||
|
||||
$where = [
|
||||
['deleted_at', '<=', time() - 3600],
|
||||
['user_id', '<>', 0],
|
||||
];
|
||||
$customer = Customer::where($where)->onlyTrashed()->get();
|
||||
foreach ($customer as $item) {
|
||||
$item->update(['user_id' => 0]);
|
||||
CustomerHis::create([
|
||||
'customer_id' => $item->_id,
|
||||
'user_his' => $item->user_id,
|
||||
'user_id' => 0,
|
||||
]);
|
||||
}
|
||||
|
||||
Log::info('send high seas start',[time()]);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user