shish 9 mesi fa
parent
commit
3292efe4ce
1 ha cambiato i file con 3 aggiunte e 23 eliminazioni
  1. 3 23
      app-ghs/controllers/CustomController.php

+ 3 - 23
app-ghs/controllers/CustomController.php

@@ -873,30 +873,10 @@ class CustomController extends BaseController
         $get = Yii::$app->request->get();
         $homeAmount = $get['homeAmount'] ?? 0;
         $homeType = $get['homeType'] ?? 0;
-
         // 批量更新客户信息
-        CustomClass::updateByCondition(
-            ['ownMainId' => $this->mainId],
-            ['homeAmount' => $homeAmount, 'homeType' => $homeType]
-        );
-
-        // 获取需要更新的供货商 ID
-        $customs = CustomClass::getAllList('ghsId', ['ownMainId' => $this->mainId]);
-        $ghsIds = [];
-        foreach ($customs as $custom) {
-            if (!empty($custom['ghsId'])) {
-                $ghsIds[] = $custom['ghsId'];
-            }
-        }
-
-        // 批量更新供货商信息
-        if (!empty($ghsIds)) {
-            GhsClass::updateByIds(
-                array_unique($ghsIds),
-                ['homeAmount' => $homeAmount, 'homeType' => $homeType]
-            );
-        }
-
+        CustomClass::updateByCondition(['ownMainId' => $this->mainId], ['homeAmount' => $homeAmount, 'homeType' => $homeType]);
+        //批量更新供货商信息
+        GhsClass::updateByIds(['shopId' => $this->shopId], ['homeAmount' => $homeAmount, 'homeType' => $homeType]);
         util::complete('修改成功');
     }