|
|
@@ -0,0 +1,31 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace console\controllers;
|
|
|
+
|
|
|
+use biz\shop\classes\ShopClass;
|
|
|
+use biz\shop\classes\ShopExtClass;
|
|
|
+use yii\console\Controller;
|
|
|
+use Yii;
|
|
|
+
|
|
|
+class ShopExtController extends Controller
|
|
|
+{
|
|
|
+
|
|
|
+ //补充门店拓展信息 shish ./yii shop-ext/bc
|
|
|
+ public function actionBc()
|
|
|
+ {
|
|
|
+ $list = ShopClass::getAllByCondition([], null, '*', null, true);
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $shop) {
|
|
|
+ $shopId = $shop->id;
|
|
|
+ $ext = ShopExtClass::getByCondition(['shopId' => $shopId]);
|
|
|
+ if (empty($ext)) {
|
|
|
+ $extData = [
|
|
|
+ 'shopId' => $shopId
|
|
|
+ ];
|
|
|
+ ShopExtClass::add($extData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|