shish 5 yıl önce
ebeveyn
işleme
98919de01b
1 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 5 2
      app-ghs/controllers/ShopExtController.php

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

@@ -16,8 +16,8 @@ class ShopExtController extends BaseController
     public function actionAddPrint()
     public function actionAddPrint()
     {
     {
         $shopId = $this->shopId;
         $shopId = $this->shopId;
-        $ext = ShopExtClass::getByCondition(['shopId' => $shopId]);
-        if (isset($ext['printSn']) && !empty($ext['printSn'])) {
+        $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
+        if (isset($ext->printSn) && !empty($ext->printSn)) {
             util::fail('您已经添加过了');
             util::fail('您已经添加过了');
         }
         }
         $get = Yii::$app->request->get();
         $get = Yii::$app->request->get();
@@ -26,6 +26,9 @@ class ShopExtController extends BaseController
         $print = new printUtil($sn);
         $print = new printUtil($sn);
         $shop = $this->shop;
         $shop = $this->shop;
         $shopName = $shop['shopName'] ?? '';
         $shopName = $shop['shopName'] ?? '';
+        $ext->printSn = $sn;
+        $ext->printKey = $key;
+        $ext->save();
         $return = $print->addPrint($key, $shopName);
         $return = $print->addPrint($key, $shopName);
         if ($return) {
         if ($return) {
             util::complete();
             util::complete();