| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\jobs\orderEvent;
- use app\models\TeamGradesPool;
- use app\models\TeamGradesPoolDetail;
- use yii\base\BaseObject;
- use yii\queue\JobInterface;
- class AutoSendTeamGradesPoolJob extends BaseObject implements JobInterface
- {
- public $store_id;
- public $action;
- public $in_action;
- public $version;
- public $time;
- public function execute($queue) {
- $time = time();
- $pool_list = TeamGradesPool::find()->where(['is_delete' => 0, 'is_send' => 0])->andWhere([
- '<=', 'end_time', $time,
- ])->select('id')->column();
- foreach($pool_list as $pool_id) {
- try {
- $result = TeamGradesPoolDetail::sendPool($pool_id);
- debug_log(['executeAutoSendTeamGradesPool--end', time(), 'result' => $result], 'auto_send_team_grades_pool.log');
- } catch(\Exception $e) {
- debug_log(['executeAutoSendTeamGradesPool--end', time(), 'getMessage' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()], 'auto_send_team_grades_pool.log');
- }
- }
- }
- }
|