浏览代码

更新区域

shish 4 年之前
父节点
当前提交
15ab00c3a9
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      console/controllers/ShopController.php

+ 6 - 1
console/controllers/ShopController.php

@@ -17,7 +17,12 @@ class ShopController extends Controller
         foreach ($list as $shop) {
             $shopId = $shop->id;
             $dist = $shop->dist ?? '';
-            GhsClass::updateByCondition(['shopId' => $shopId], ['dist' => $dist]);
+            if (!empty($dist)) {
+                GhsClass::updateByCondition(['shopId' => $shopId], ['dist' => $dist]);
+            } else {
+                echo $shop->shopName . "没有找到区域信息\n";
+            }
+
         }
     }