shish 2 лет назад
Родитель
Сommit
c497fd8809
1 измененных файлов с 6 добавлено и 5 удалено
  1. 6 5
      app-hd/controllers/CustomController.php

+ 6 - 5
app-hd/controllers/CustomController.php

@@ -37,16 +37,17 @@ class CustomController extends BaseController
         $id = $post['id'] ?? 0;
         unset($post['id']);
         $custom = CustomClass::getById($id, true);
-
+        if (empty($custom)) {
+            util::fail('没有找到客户信息');
+        }
+        $userId = $custom->userId ?? 0;
         $city = $post['city'] ?? '';
         $dist = $post['dist'] ?? '';
         $address = $post['address'] ?? '';
         $floor = $post['floor'] ?? '';
         $post['fullAddress'] = $city . $dist . $address . $floor;
-        $shopId = $custom->shopId ?? 0;
-        $where = ['shopId' => $shopId];
-//        ShopClass::updateById($shopId, $post);
-//        CustomClass::updateByCondition($where, $post);
+        UserClass::updateByCondition(['id' => $userId], $post);
+        CustomClass::updateByCondition(['id' => $id], $post);
         util::complete('修改成功');
     }