shish 1 year ago
parent
commit
9ebcedcc08
2 changed files with 12 additions and 4 deletions
  1. 11 3
      app-mall/controllers/HdController.php
  2. 1 1
      app-mall/controllers/UserController.php

+ 11 - 3
app-mall/controllers/HdController.php

@@ -13,12 +13,20 @@ class HdController extends BaseController
     public function actionInfo()
     {
         $user = $this->user;
+        $shop = $this->shop;
         if (empty($user)) {
-            util::success(['hd' => $this->shop]);
+            $hd = [];
+            if (!empty($shop)) {
+                $name = $shop->name ?? '';
+                $hd = ['name' => $name];
+            }
+            $custom = [];
+            util::success(['hd' => $hd, 'custom' => $custom]);
         } else {
-            $respond = CustomClass::buildRelation($this->shop, $user);
+            $respond = CustomClass::buildRelation($shop, $user);
             $hd = $respond['hd'];
-            util::success(['hd' => $hd]);
+            $custom = $respond['custom'];
+            util::success(['hd' => $hd, 'custom' => $custom]);
         }
     }
 

+ 1 - 1
app-mall/controllers/UserController.php

@@ -68,7 +68,7 @@ class UserController extends BaseController
         util::success(['user' => $user, 'token' => $token]);
     }
 
-    //创建用户和客户 ssh 20220607
+    //生成用户和花店增加客户 ssh 20250307
     public function actionCreate()
     {
         $post = Yii::$app->request->post();