type); if (!in_array($type, [0, 1, 2, 3])) { return; } $storeList = []; if(is_null($this->store_id)){ $storeList = Store::find()->where(['is_delete' => 0])->andWhere(['OR', ['>', 'end_time', $time], ['<=', 'end_time', '0']])->select('id')->column();//只查询未到期的店铺 }else{ $store = Store::findOne($this->store_id); if ($store->end_time > $time || $store->end_time <= 0) { $storeList = [$this->store_id]; } } foreach ($storeList as $store_id){ $base_ = new WechatMini(); $store_mini = StoreMini::find()->where(['store_id' => $store_id, 'fuwu_type' => 1, 'is_cancle' => 0])->select('id')->column(); foreach ($store_mini as $mini_item) { $miniProgram = $base_::getWechatConfig($store_id, $mini_item, 1); if ($miniProgram) { if (in_array($type, [0, 2])) { $form = new VideoShopForm(); $form->miniProgram = $miniProgram; $form->store_id = $store_id; $form->mini_id = $base_::$mini_id; $form->getApplySharerInfo(); $form->syncSharerList(); } if ($type === 1) { $goods_form = new \app\modules\admin\models\VideoShopGoodsForm(); $goods_form->miniProgram = $miniProgram; $goods_form->store_id = $store_id; $goods_form->mini_id = $base_::$mini_id; $goods_form->syncGoodsList(); } if ($type === 2) { $form_ = new VideoShopOrderForm(); $form_->miniProgram = $miniProgram; $form_->store_id = $store_id; $form_->mini_id = $base_::$mini_id; $form_->end_time = time(); $form_->start_time = time() - (60 * 60 * 24 * 2); $form_->syncOrderList(); } if ($type === 3) { PublicRankingForm::syncPromoter($store_id); } } } } debug_log(['SyncSharerListJob--end', time() - $time], 'debug_task_execute.log'); } }