|
@@ -56,29 +56,29 @@ class SystemTimer extends Cron implements ListenerInterface
|
|
|
}
|
|
|
$list = $timerServices->cacheList();
|
|
|
foreach ($list as $item) {
|
|
|
- $mark = (string)($item['mark'] ?? '');
|
|
|
+ $mark = (string)($item['mark'] ?? '');
|
|
|
if (!$mark || !isset($item['is_open'])) {
|
|
|
- \think\facade\Log::error('定时任务数据异常,数据:' . json_encode($item));
|
|
|
- continue;
|
|
|
- }
|
|
|
- if ($item['is_open'] == 1) {
|
|
|
- $data = $timerServices->getTimerCycleTime($item['type'], $item['cycle'], $time, $item['update_execution_time']);
|
|
|
- if ($time == $data['cycle_time']) {
|
|
|
- $this->after(1000, function () use ($timerServices, $mark, $time) {
|
|
|
- $timerServices->cacheTag()->set($mark, $time);//上次执行时间保存
|
|
|
- $this->implement_timer($mark);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
+ \think\facade\Log::error('定时任务数据异常,数据:' . json_encode($item));
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if ($item['is_open'] == 1) {
|
|
|
+ $data = $timerServices->getTimerCycleTime($item['type'], $item['cycle'], $time, $item['update_execution_time']);
|
|
|
+ if ($time == $data['cycle_time']) {
|
|
|
+ $this->after(1000, function () use ($timerServices, $mark, $time) {
|
|
|
+ $timerServices->cacheTag()->set($mark, $time);//上次执行时间保存
|
|
|
+ $this->implement_timer($mark);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 执行定时任务
|
|
|
- * @param string $mark
|
|
|
- * @return bool|void
|
|
|
- */
|
|
|
+ /**
|
|
|
+ * 执行定时任务
|
|
|
+ * @param string $mark
|
|
|
+ * @return bool|void
|
|
|
+ */
|
|
|
public function implement_timer(string $mark)
|
|
|
{
|
|
|
switch ($mark) {
|
|
@@ -345,6 +345,20 @@ class SystemTimer extends Cron implements ListenerInterface
|
|
|
]);
|
|
|
}
|
|
|
break;
|
|
|
+ case 'area_award' : // 定时发放分红失败
|
|
|
+ /** @var StoreOrderServices $service */
|
|
|
+ $service = app()->make(StoreOrderServices::class);
|
|
|
+ try {
|
|
|
+ return $service->backAreaBrokerage();
|
|
|
+ } catch (\Throwable $e) {
|
|
|
+ response_log_write([
|
|
|
+ 'message' => '定时发放分红失败:' . $e->getMessage(),
|
|
|
+ 'file' => $e->getFile(),
|
|
|
+ 'line' => $e->getLine()
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|