shish 6 miesięcy temu
rodzic
commit
411fc565da
1 zmienionych plików z 14 dodań i 7 usunięć
  1. 14 7
      app-ghs/controllers/CustomController.php

+ 14 - 7
app-ghs/controllers/CustomController.php

@@ -926,7 +926,11 @@ class CustomController extends BaseController
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? 0;
         $homeAmount = $get['homeAmount'] ?? 0;
-        $homeType = $get['homeType'] ?? 0;
+        $homeNum = $get['homeNum'] ?? 0;
+        if (isset($get['homeType'])) {
+            //早期系统有带这个参数,来判断
+            util::fail('请升级系统');
+        }
         $custom = CustomClass::getById($id, true);
         if (empty($custom)) {
             util::fail('没有找到客户');
@@ -940,10 +944,10 @@ class CustomController extends BaseController
             util::fail('没有找到供货商');
         }
         $custom->homeAmount = $homeAmount;
-        $custom->homeType = $homeType;
+        $custom->homeNum = $homeNum;
         $custom->save();
         $ghs->homeAmount = $homeAmount;
-        $ghs->homeType = $homeType;
+        $ghs->homeNum = $homeNum;
         $ghs->save();
         util::complete('修改成功');
     }
@@ -955,14 +959,17 @@ class CustomController extends BaseController
     {
         $get = Yii::$app->request->get();
         $homeAmount = $get['homeAmount'] ?? 0;
-        $homeType = $get['homeType'] ?? 0;
+        $homeNum = $get['homeNum'] ?? 0;
+        if (isset($get['homeType'])) {
+            util::fail('请升级APP');
+        }
         $shopId = $this->shopId;
-        ShopClass::updateById($shopId, ['homeAmount' => $homeAmount, 'homeType' => $homeType]);
+        ShopClass::updateById($shopId, ['homeAmount' => $homeAmount, 'homeNum' => $homeNum]);
 
         // 批量更新客户信息
-        CustomClass::updateByCondition(['ownMainId' => $this->mainId], ['homeAmount' => $homeAmount, 'homeType' => $homeType]);
+        CustomClass::updateByCondition(['ownMainId' => $this->mainId], ['homeAmount' => $homeAmount, 'homeNum' => $homeNum]);
         //批量更新供货商信息
-        GhsClass::updateByCondition(['shopId' => $shopId], ['homeAmount' => $homeAmount, 'homeType' => $homeType]);
+        GhsClass::updateByCondition(['shopId' => $shopId], ['homeAmount' => $homeAmount, 'homeNum' => $homeNum]);
         util::complete('修改成功');
     }