| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace addons\QiJuhe\backend\controllers;
- use addons\QiJuhe\common\service\OrderService;
- use common\events\goods\SupplyChainGoodsChangeEvent;
- use common\models\goods\Goods;
- use Yii;
- use yii\web\Controller;
- class SokabeController extends Controller
- {
- public function actionIndex()
- {
- $service = new OrderService([]);
- $res = $service->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);
- }
- }
- }
|