zm
2021-04-09 93652ca875fc904a25a7f214adc548745573950a
commit | author | age
90c639 1 <?php
Z 2 /**
3  * Created by PhpStorm.
4  * User: 风哀伤
5  * Date: 2019/5/28
6  * Time: 17:04
7  * @copyright: ©2019 浙江禾匠信息科技
8  * @link: http://www.zjhejiang.com
9  */
10
11 namespace app\jobs;
12
13
14 use app\forms\mall\statistics\InitDataForm;
15 use app\models\Mall;
16 use yii\base\BaseObject;
17 use yii\queue\JobInterface;
18
19 class ChangeShareLevelJob extends BaseJob implements JobInterface
20 {
21     public $mall;
22
23     public function execute($queue)
24     {
25         $this->setRequest();
26         $mall = Mall::findOne($this->mall->id);
27         \Yii::$app->setMall($mall);
28         \Yii::error('--我进来啦--');
29         $t = \Yii::$app->db->beginTransaction();
30         try {
31             $form = new InitDataForm();
32             $form->share();
33             $t->commit();
34         } catch (\Exception $exception) {
35             $t->rollBack();
36             \Yii::error($exception);
37         }
38     }
39 }