|
|
@@ -4,25 +4,26 @@ namespace console\controllers;
|
|
|
|
|
|
use biz\ghs\classes\GhsClass;
|
|
|
use biz\shop\classes\ShopClass;
|
|
|
+use bizGhs\custom\classes\CustomClass;
|
|
|
use yii\console\Controller;
|
|
|
use Yii;
|
|
|
|
|
|
class ShopController extends Controller
|
|
|
{
|
|
|
|
|
|
- //更新供货商的地区信息 ssh 20211028 ./yii shop/dist
|
|
|
- public function actionDist()
|
|
|
+ public function actionMain()
|
|
|
{
|
|
|
- $list = ShopClass::getAllByCondition(['ptStyle' => 2], null, '*', null, true);
|
|
|
- foreach ($list as $shop) {
|
|
|
- $shopId = $shop->id;
|
|
|
- $dist = $shop->dist ?? '';
|
|
|
- if (!empty($dist)) {
|
|
|
- GhsClass::updateByCondition(['shopId' => $shopId], ['dist' => $dist]);
|
|
|
- } else {
|
|
|
- echo $shop->shopName . "没有找到区域信息\n";
|
|
|
+ $custom = CustomClass::getAllByCondition(['id>' => 0], null, '*', null, true);
|
|
|
+ if (empty($custom)) {
|
|
|
+ echo '空';
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ foreach ($custom as $item) {
|
|
|
+ $shopId = $item->shopId ?? 0;
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ if ($shop->mainId != $item->mainId) {
|
|
|
+ echo "客户id:{$item->id} {$shop->mainId} {$item->mainId}\n";
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|