Răsfoiți Sursa

修改客户信息

shish 2 ani în urmă
părinte
comite
c497fd8809
1 a modificat fișierele cu 6 adăugiri și 5 ștergeri
  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;
         $id = $post['id'] ?? 0;
         unset($post['id']);
         unset($post['id']);
         $custom = CustomClass::getById($id, true);
         $custom = CustomClass::getById($id, true);
-
+        if (empty($custom)) {
+            util::fail('没有找到客户信息');
+        }
+        $userId = $custom->userId ?? 0;
         $city = $post['city'] ?? '';
         $city = $post['city'] ?? '';
         $dist = $post['dist'] ?? '';
         $dist = $post['dist'] ?? '';
         $address = $post['address'] ?? '';
         $address = $post['address'] ?? '';
         $floor = $post['floor'] ?? '';
         $floor = $post['floor'] ?? '';
         $post['fullAddress'] = $city . $dist . $address . $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('修改成功');
         util::complete('修改成功');
     }
     }