|
|
@ -14,6 +14,7 @@ namespace app\timer\controller\dealer; |
|
|
|
|
|
|
|
|
|
|
|
use app\timer\controller\Controller; |
|
|
|
use app\timer\controller\Controller; |
|
|
|
use app\timer\service\dealer\Order as DealerOrderService; |
|
|
|
use app\timer\service\dealer\Order as DealerOrderService; |
|
|
|
|
|
|
|
use think\facade\Db; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 定时任务:商城订单 |
|
|
|
* 定时任务:商城订单 |
|
|
@ -26,7 +27,7 @@ class Order extends Controller |
|
|
|
private string $taskKey = 'DealerOrder'; |
|
|
|
private string $taskKey = 'DealerOrder'; |
|
|
|
|
|
|
|
|
|
|
|
// 任务执行间隔时长 (单位:秒) |
|
|
|
// 任务执行间隔时长 (单位:秒) |
|
|
|
protected int $taskExpire = 5; |
|
|
|
protected int $taskExpire = 60 * 30; |
|
|
|
|
|
|
|
|
|
|
|
// 当前商城ID |
|
|
|
// 当前商城ID |
|
|
|
private int $storeId; |
|
|
|
private int $storeId; |
|
|
@ -38,6 +39,8 @@ class Order extends Controller |
|
|
|
public function handle(array $param) |
|
|
|
public function handle(array $param) |
|
|
|
{ |
|
|
|
{ |
|
|
|
['storeId' => $this->storeId] = $param; |
|
|
|
['storeId' => $this->storeId] = $param; |
|
|
|
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => "分销订单定死任务", 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
|
|
|
|
Db::table('yoshop_wx_server')->insertGetId(['content' => json_encode($param), 'created_at' => date('Y-m-d H:i:s')]); |
|
|
|
$this->setInterval($this->storeId, $this->taskKey, $this->taskExpire, function () { |
|
|
|
$this->setInterval($this->storeId, $this->taskKey, $this->taskExpire, function () { |
|
|
|
echo $this->taskKey . PHP_EOL; |
|
|
|
echo $this->taskKey . PHP_EOL; |
|
|
|
// 标记失效的分销订单 |
|
|
|
// 标记失效的分销订单 |
|
|
|