diff --git a/application/index/controller/Search.php b/application/index/controller/Search.php index ffd1a460e..878f42f2a 100755 --- a/application/index/controller/Search.php +++ b/application/index/controller/Search.php @@ -10,6 +10,7 @@ // +---------------------------------------------------------------------- namespace app\index\controller; +use think\facade\Hook; use app\service\SearchService; use app\service\BrandService; use app\service\SeoService; @@ -149,20 +150,20 @@ class Search extends Common // 获取商品列表 $this->params['keywords'] = $this->params['wd']; $ret = SearchService::GoodsList($this->params); - if(empty($ret['data']['data'])) - { - $msg = '没有相关数据'; - $code = -100; - } else { - $msg = '操作成功'; - $code = 0; - } // 搜索记录 SearchService::SearchAdd($this->params); - // 返回 - return DataReturn($msg, $code, $ret['data']); + // 无数据直接返回 + if(empty($ret['data']) || $ret['code'] != 0) + { + return DataReturn('没有相关数据', -100); + } + + // 返回数据html + $this->assign('data', $ret['data']['data']); + $ret['data']['data'] = $this->fetch('content'); + return $ret; } } ?> \ No newline at end of file diff --git a/application/index/view/default/buy/index.html b/application/index/view/default/buy/index.html index f5bc33bc9..6fdcbb630 100755 --- a/application/index/view/default/buy/index.html +++ b/application/index/view/default/buy/index.html @@ -156,7 +156,7 @@
- 合计 ¥{{$base.total_price}} + 合计 ¥{{$base.total_price}}
{{$v.title}}
+ ++ ¥{{$v.original_price}} + 销量 {{$v.sales_count}} +
+ + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} ++ ¥{{$v.price}} +
+ + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +'+result.data.data[i]['title']+'
'; - html += ''; - html += '¥ '+result.data.data[i]['min_price']+'
'; - html += '销量'+result.data.data[i]['sales_count']+'
'; - html += '