| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\jobs\orderEvent;
- use yii\base\BaseObject;
- use yii\queue\JobInterface;
- use app\events\OrderEvent;
- use app\models\Store;
- use app\constants\OptionSetting;
- use app\models\Option;
- use app\modules\admin\models\jushuitan\JuShuiTanForm;
- class ReportPoolJob extends BaseObject implements JobInterface
- {
- public $store_id;
- public $action;
- public $in_action;
- public $version;
- public $time;
- public function execute($queue) {
- $time = time();
- $store_list = Store::find()->where(['is_delete' => 0])->select('id, name')->all();
- foreach($store_list as $store) {
- try {
- // 定时任务
- $event = new OrderEvent();
- $event->store_id = $store->id;
- $event->reportPool();
- } catch(\Exception $e) {
- \Yii::error('--------auto-execute-report-pool-error---- '.$store->id.' ----auto-execute-report-pool-error--------' . $e->getMessage() . $e->getFile() . $e->getLine());
- }
- }
- debug_log(['executeReportPool--end', time() - $time], 'debug_task_execute.log');
- }
- }
|