|
|
@@ -0,0 +1,29 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace console\controllers;
|
|
|
+
|
|
|
+use biz\shop\classes\ShopClass;
|
|
|
+use bizGhs\order\classes\OrderClass;
|
|
|
+use yii\console\Controller;
|
|
|
+use Yii;
|
|
|
+
|
|
|
+class GhsOrderController extends Controller
|
|
|
+{
|
|
|
+
|
|
|
+ public function actionBcId()
|
|
|
+ {
|
|
|
+ $list = OrderClass::getAllByCondition(['mainId' => 0], null, '*', null, true);
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $order) {
|
|
|
+ $shopId = $order->shopId ?? 0;
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ $mainId = $shop->mainId ?? 0;
|
|
|
+ if (!empty($mainId)) {
|
|
|
+ $order->mainId = $mainId;
|
|
|
+ $order->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|