shish пре 2 година
родитељ
комит
c6be2bc998
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      app-ghs/controllers/GhsController.php

+ 3 - 1
app-ghs/controllers/GhsController.php

@@ -32,6 +32,9 @@ class GhsController extends BaseController
         if (empty($name)) {
             util::fail('请填写名称');
         }
+        if (stringUtil::getWordNum($name) > 27) {
+            util::fail('名称不能超过27个汉字');
+        }
         $ghs->name = $name;
         $ghs->save();
         util::complete('修改成功');
@@ -50,7 +53,6 @@ class GhsController extends BaseController
         if (stringUtil::getWordNum($name) > 27) {
             util::fail('名称不能超过27个汉字');
         }
-
         $hasGhsList = GhsClass::getAllByCondition(['ownShopId' => $this->shopId], null, '*', null, true);
         if (!empty($hasGhsList)) {
             foreach ($hasGhsList as $hasGhs) {