Browse Source

小票机

shish 3 năm trước cách đây
mục cha
commit
8f24c205ad
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      app-ghs/controllers/ShopExtController.php

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

@@ -93,12 +93,14 @@ class ShopExtController extends BaseController
             $ext->wcPrintKey3 = '';
             $ext->save();
         }
+        $wcPrintNum = 1;
         if (isset($ext->wcPrintSn2) && !empty($ext->wcPrintSn2)) {
-            ShopExtClass::updateByCondition(['shopId' => $this->shopId], ['wcPrintNum' => 2]);
+            $wcPrintNum = 2;
         }
         if (isset($ext->wcPrintSn3) && !empty($ext->wcPrintSn3)) {
-            ShopExtClass::updateByCondition(['shopId' => $this->shopId], ['wcPrintNum' => 3]);
+            $wcPrintNum = 3;
         }
+        ShopExtClass::updateByCondition(['shopId' => $this->shopId], ['wcPrintNum' => $wcPrintNum]);
         if ($hasFail == 1) {
             util::success(['hasFail' => 1], '出现添加失败的情况');
         }