Browse Source

花店信息

shish 1 year ago
parent
commit
b320b9a831
1 changed files with 8 additions and 7 deletions
  1. 8 7
      app-hd/controllers/OrderController.php

+ 8 - 7
app-hd/controllers/OrderController.php

@@ -437,19 +437,20 @@ class OrderController extends BaseController
                 util::fail('请填写订花人姓名');
             }
         }
-
-        $hdId = $post['hdId'] ?? 0;
+        $customId = $post['customId'] ?? 0;
+        $custom = CustomClass::getById($customId, true);
+        if (empty($custom)) {
+            util::fail('没有找到客户哦');
+        }
+        $hdId = $custom->hdId ?? 0;
         $hd = HdClass::getById($hdId, true);
         if (empty($hd)) {
             util::fail('客户对应的花店信息缺失,编号869');
         }
         $hdName = $hd->name ?? '';
+        $post['hdId'] = $hdId;
         $post['hdName'] = $hdName;
-        $customId = $hd->customId ?? 0;
-        $custom = CustomClass::getById($customId, true);
-        if (empty($custom)) {
-            util::fail('没有找到客户哦');
-        }
+
         $post['customId'] = $customId;
         $customName = $custom->name ?? '';
         $post['customName'] = $customName;