shish 3 gadi atpakaļ
vecāks
revīzija
693f7f013b
1 mainītis faili ar 9 papildinājumiem un 2 dzēšanām
  1. 9 2
      app-ghs/controllers/ShopExtController.php

+ 9 - 2
app-ghs/controllers/ShopExtController.php

@@ -93,7 +93,7 @@ class ShopExtController extends BaseController
             $ext->save();
         }
         if ($hasFail == 1) {
-            util::fail('添加发现失败');
+            util::fail('添加失败');
         }
         util::complete();
     }
@@ -105,7 +105,7 @@ class ShopExtController extends BaseController
         if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
             util::fail('超管才能修改');
         }
-
+        $hasFail = 0;
         $shopId = $this->shopId;
         $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
         $get = Yii::$app->request->get();
@@ -126,6 +126,8 @@ class ShopExtController extends BaseController
                 $ext->printSn = $printSn;
                 $ext->printKey = $printKey;
                 $ext->save();
+            }else{
+                $hasFail = 1;
             }
         } else {
             $ext->printSn = '';
@@ -143,12 +145,17 @@ class ShopExtController extends BaseController
                 $labelPrint->times = 1;
                 $content = '<SIZE>50,70</SIZE>';
                 $labelPrint->printLabelMsg($content);
+            }else{
+                $hasFail = 1;
             }
         } else {
             $ext->printLabelSn = '';
             $ext->printLabelKey = '';
             $ext->save();
         }
+        if ($hasFail == 1) {
+            util::fail('有添加失败');
+        }
         util::complete();
     }