updateLogistic('s202207231651381132854821'); } public function actionIndex2() { // $list = Goods::find() // ->where(['mall_id' => 1]) // ->andWhere(['not like', 'cover_pic', '%gxtongyu.oss-cn-guangzhou.aliyuncs.com%']) // ->select(['id', 'mall_id']) // ->limit(10) // ->all(); $sql = "SELECT id, mall_id FROM `qimall_goods` WHERE `cover_pic` NOT LIKE '%gxtongyu.oss-cn-guangzhou.aliyuncs.com%' and is_on_sale = 1 and `status` = 1 LIMIT 0,1000"; $list = Yii::$app->getDb()->createCommand($sql)->queryAll(); foreach ($list as $item) { $data = [ 'goods_id' => $item['id'], 'mall_id' => $item['mall_id'], ]; $event = new SupplyChainGoodsChangeEvent(); Yii::$app->services->events->dispatch($event, $data, $event->listeners); } } }