stanley-king vor 8 Jahren
Ursprung
Commit
ea2c820df6
3 geänderte Dateien mit 61 neuen und 9 gelöschten Zeilen
  1. 1 3
      admin/control/cache.php
  2. 1 1
      helper/special_helper.php
  3. 59 5
      mobile/control/search.php

+ 1 - 3
admin/control/cache.php

@@ -102,7 +102,6 @@ class cacheControl extends SystemControl
             $this->del_keys('discovery*');
 
             //删除手机促销相关数据
-            $this->del_keys('mb_salelist*');
             $this->mPublisher->modify_seracher_init();
 
             $this->del_keys('mb_brand');
@@ -178,8 +177,7 @@ class cacheControl extends SystemControl
 
             // 删除手机促销相关数据
             if (in_array('salelist',$todo)) {
-                $this->del_keys('mb_salelist*');
-                $this->del_keys('mb_brand');
+                dcache('brand','mb_');
                 dcache('brandex','mb_');
                 $this->mPublisher->modify_index_brands();
             }

+ 1 - 1
helper/special_helper.php

@@ -457,7 +457,7 @@ class special_formater
         }
     }
 
-    private static function scale($image)
+    public static function scale($image)
     {
         $image = trim($image);
         if(empty($image)) {

+ 59 - 5
mobile/control/search.php

@@ -16,6 +16,10 @@ define('MOBILE_SERVER',true);
 
 class searchControl extends mobileHomeControl
 {
+    const def_history_divider = '/mobile/defimg/history_divider.png';
+    const def_hot_divider = '/mobile/defimg/hot_divider.png';
+    const def_guess_divider = '/mobile/defimg/guess_like.png';
+
     public function __construct()
     {
         parent::__construct();
@@ -176,17 +180,17 @@ class searchControl extends mobileHomeControl
         $blocks = [];
         if(!empty($history))
         {
-            $blocks[] = special_formater::format_keyword($history,'历史搜索');
             if($_SESSION['is_lasted']) {
-                $blocks[] = special_formater::def_divider();
+                $blocks[] = self::history_divider();
             }
+            $blocks[] = special_formater::format_keyword($history,'历史搜索');
         }
         if(!empty($hot_search))
         {
-            $blocks[] = special_formater::format_keyword($hot_search,'热门搜索');
             if($_SESSION['is_lasted']) {
-                $blocks[] = special_formater::def_divider();
+                $blocks[] = self::hot_divider();
             }
+            $blocks[] = special_formater::format_keyword($hot_search,'热门搜索');
         }
 
         $guslike = $this->guesslike();
@@ -198,7 +202,11 @@ class searchControl extends mobileHomeControl
         else
         {
             $gus_blocks = $guslike['special_list'];
-            if(!empty($gus_blocks)) {
+            if(!empty($gus_blocks))
+            {
+                if($_SESSION['is_lasted']) {
+                    $blocks[] = self::guess_divider();
+                }
                 $blocks[] = $gus_blocks[0];
             }
 
@@ -209,6 +217,52 @@ class searchControl extends mobileHomeControl
         }
     }
 
+    private static function history_divider()
+    {
+        static $block = [];
+        if(empty($block))
+        {
+            $block['item_type'] = 'divider';
+            $block['item_title'] = '';
+            $block['bg_type'] = 'image';
+            $image = RESOURCE_SITE_URL . self::def_history_divider;
+            $block['bg_data'] = $image;
+            $block['has_margin'] = false;
+            $block['scale'] = special_formater::scale($image);
+        }
+        return $block;
+    }
+    private static function hot_divider()
+    {
+        static $block = [];
+        if(empty($block))
+        {
+            $block['item_type'] = 'divider';
+            $block['item_title'] = '';
+            $block['bg_type'] = 'image';
+            $image = RESOURCE_SITE_URL . self::def_hot_divider;
+            $block['bg_data'] = $image;
+            $block['has_margin'] = false;
+            $block['scale'] = special_formater::scale($image);
+        }
+        return $block;
+    }
+    private static function guess_divider()
+    {
+        static $block = [];
+        if(empty($block))
+        {
+            $block['item_type'] = 'divider';
+            $block['item_title'] = '';
+            $block['bg_type'] = 'image';
+            $image = RESOURCE_SITE_URL . self::def_guess_divider;
+            $block['bg_data'] = $image;
+            $block['has_margin'] = false;
+            $block['scale'] = special_formater::scale($image);
+        }
+        return $block;
+    }
+
     public function guesslike()
     {
 //        $goodslist = Model('goods_browse')->getGuessLikeGoods($_SESSION['member_id'],10);