Эх сурвалжийг харах

Merge branch 'master' into dev

shish 1 сар өмнө
parent
commit
0e0d533a0f

+ 1 - 0
app-hd/controllers/GhsController.php

@@ -461,6 +461,7 @@ class GhsController extends BaseController
     //寻找附近批发店
     public function actionSearchNearbyGhs()
     {
+        //util::complete();
         $get = Yii::$app->request->get();
         $locationType = $get['locationType'];
         $toLat = $get['lat'] ?? '';

+ 21 - 3
app-hd/controllers/OrderController.php

@@ -1318,7 +1318,6 @@ class OrderController extends BaseController
     {
         $get = Yii::$app->request->get();
         $searchText = $get['searchText'] ?? '';
-        $searchStyle = $get['searchStyle'] ?? 0;
         $shopId = $this->shopId ?? 0;
         if (empty($shopId)) {
             //没有登录不显示数据
@@ -1347,8 +1346,9 @@ class OrderController extends BaseController
         if (!empty($get['shopAdminId'])) {
             $where['shopAdminId'] = $get['shopAdminId'];
         }
-        if ($searchStyle == 1 && !empty($searchText)) {
-            $where['sendNum'] = $searchText;
+        // 按搜索词自动识别:纯数字查货号,否则查姓名
+        if (!empty($searchText)) {
+            $this->appendOrderListSearchWhere($where, $searchText);
         }
         if (isset($get['repeat']) && $get['repeat'] > -1) {
             $where['repeat'] = $get['repeat'];
@@ -1567,4 +1567,22 @@ class OrderController extends BaseController
         util::success(['sedCost' => 10]);
     }
 
+    /**
+     * 订单列表搜索条件:纯数字按货号精确匹配,否则按客户姓名模糊匹配
+     * @param array $where 查询条件(引用传递)
+     * @param string $searchText 搜索关键词
+     */
+    private function appendOrderListSearchWhere(&$where, $searchText)
+    {
+        $searchText = trim((string)$searchText);
+        if ($searchText === '') {
+            return;
+        }
+        if (preg_match('/^\d+$/', $searchText)) {
+            $where['sendNum'] = $searchText;
+            return;
+        }
+        $where['customName'] = ['like', $searchText];
+    }
+
 }

BIN
app-hd/web/buy_list.mp4


BIN
app-hd/web/open_shop.mp4


+ 2 - 3
app-mall/controllers/ShopController.php

@@ -51,10 +51,9 @@ class ShopController extends BaseController
                     $custom->save();
                 }
             }
+            StatVisitClass::addHdCustomVisit($shop->id, $user->id);
         }
 
-        StatVisitClass::addHdCustomVisit($shop->id, $user->id);
-
         util::success(['info' => $info, 'hd' => $hd, 'custom' => $custom]);
     }
 
@@ -83,4 +82,4 @@ class ShopController extends BaseController
         util::success(['ad' => $ad, 'shop' => $shop, 'newUserGift' => $newUserGift]);
     }
 
-}
+}