|
@@ -3,6 +3,9 @@
|
|
|
|
|
|
defined('InShopNC') or exit('Access Invalid!');
|
|
|
|
|
|
+require_once (BASE_ROOT_PATH . '/helper/category_helper.php');
|
|
|
+require_once (BASE_ROOT_PATH . '/helper/goods_helper.php');
|
|
|
+
|
|
|
class searchControl extends mobileHomeControl
|
|
|
{
|
|
|
public function __construct()
|
|
@@ -31,7 +34,9 @@ class searchControl extends mobileHomeControl
|
|
|
initpage($page,$curpage);
|
|
|
|
|
|
$model_goods = Model('goods');
|
|
|
+
|
|
|
$condition = array();
|
|
|
+ //原有分类查询
|
|
|
if (!empty(trim($_GET['gc_id']))) {
|
|
|
$condition['gc_id'] = intval($_GET['gc_id']);
|
|
|
}
|
|
@@ -48,11 +53,20 @@ class searchControl extends mobileHomeControl
|
|
|
$condition['efficacy_id'] = intval($_GET['efficacy_id']);
|
|
|
}
|
|
|
|
|
|
- //所需字段
|
|
|
- $fieldstr = "goods_id,goods_commonid,store_id,brand_id,gc_id,goods_name,goods_price,goods_marketprice,goods_image,goods_salenum,evaluation_good_star,evaluation_count,goods_storage,goods_storage_alarm";
|
|
|
+ if (!empty(trim($_GET['hot_id']))) {
|
|
|
+ $id = intval($_GET['hot_id']);
|
|
|
+ $cids = category_helper::instance()->cids($id);
|
|
|
+ $condition['gc_id'] = array('in', $cids);
|
|
|
+ }
|
|
|
+
|
|
|
+// //所需字段
|
|
|
+// $fieldstr = "goods_id,goods_commonid,store_id,brand_id,gc_id,goods_name,goods_price,goods_marketprice,goods_image,goods_salenum,evaluation_good_star,evaluation_count,goods_storage,goods_storage_alarm";
|
|
|
+// // 添加3个状态字段
|
|
|
+// $fieldstr .= ',is_virtual,is_presell,is_fcode,have_gift';
|
|
|
|
|
|
- // 添加3个状态字段
|
|
|
- $fieldstr .= ',is_virtual,is_presell,is_fcode,have_gift';
|
|
|
+ $fieldstr = 'goods_id,goods_commonid,store_id,brand_id,gc_id,goods_name,goods_price,goods_marketprice,goods_promotion_price,goods_jingle,
|
|
|
+ goods_image,goods_salenum,evaluation_good_star,evaluation_count,goods_storage,goods_storage_alarm,is_virtual,is_presell,
|
|
|
+ is_fcode,have_gift,goods_mobile_name';
|
|
|
|
|
|
//排序方式
|
|
|
$order = $this->_goods_list_order($_GET['key'], $_GET['order']);
|
|
@@ -73,14 +87,22 @@ class searchControl extends mobileHomeControl
|
|
|
// $goods_list = $model_goods->getGoodsListByColorDistinct($condition, $fieldstr, $order, $this->page);
|
|
|
// }
|
|
|
|
|
|
- $goods_list = $model_goods->getGoodsListByColorDistinct($condition, $fieldstr, $order, $this->page);
|
|
|
+ $goods_list = $model_goods->getGoodsListByColorDistinct($condition, 'goods_id', $order, $this->page);
|
|
|
$page_count = $model_goods->gettotalpage();
|
|
|
$model_goods->cls();
|
|
|
|
|
|
- //处理商品列表(抢购、限时折扣、商品图片)
|
|
|
- $goods_list = $this->_goods_list_extend($goods_list);
|
|
|
+ $goods_ids = array();
|
|
|
+ foreach($goods_list as $val) {
|
|
|
+ array_push($goods_ids,$val['goods_id']);
|
|
|
+ }
|
|
|
+
|
|
|
+ $helper = new goods_helper();
|
|
|
+ $goods_list = $helper->get_infos($goods_ids,$fieldstr);
|
|
|
|
|
|
- joutput_data(array('goods_list' => $goods_list, 'mobile_page' => mobile_page($page_count)));
|
|
|
+// //处理商品列表(抢购、限时折扣、商品图片)
|
|
|
+// $goods_list = $this->_goods_list_extend($goods_list);
|
|
|
+//
|
|
|
+ self::outsuccess(array('goods_list' => $goods_list, 'mobile_page' => mobile_page($page_count)));
|
|
|
}
|
|
|
|
|
|
/**
|