shish преди 3 години
родител
ревизия
37e939d7be
променени са 1 файла, в които са добавени 13 реда и са изтрити 0 реда
  1. 13 0
      app-mall/controllers/OrderController.php

+ 13 - 0
app-mall/controllers/OrderController.php

@@ -2,6 +2,7 @@
 
 namespace mall\controllers;
 
+use bizHd\custom\classes\HdClass;
 use bizHd\wx\classes\WxOpenClass;
 use bizMall\custom\classes\CustomClass;
 use bizMall\goods\classes\GoodsClass;
@@ -43,6 +44,12 @@ class OrderController extends BaseController
             $customName = $custom->name ?? '';
             $post['customName'] = $customName;
             $post['customNamePy'] = stringUtil::py($customName);
+            $hdId = $custom->hdId ?? 0;
+            $hd = HdClass::getById($hdId, true);
+            if (!empty($hd)) {
+                $post['hdId'] = $hd->id ?? 0;
+                $post['hdName'] = $hd->name ?? '';
+            }
         }
 
         $now = time();
@@ -113,6 +120,12 @@ class OrderController extends BaseController
                 $customName = $custom->name ?? '';
                 $post['customName'] = $customName;
                 $post['customNamePy'] = stringUtil::py($customName);
+                $hdId = $custom->hdId ?? 0;
+                $hd = HdClass::getById($hdId, true);
+                if (!empty($hd)) {
+                    $post['hdId'] = $hd->id ?? 0;
+                    $post['hdName'] = $hd->name ?? '';
+                }
             }
 
             $user = isset($this->user->attributes) ? $this->user->attributes : [];