|
@@ -125,10 +125,48 @@ class Main extends Core
|
|
|
$this->data['act'] = Dever::load('push/lib/data')->get('home_act', '首页活动推荐', 3);
|
|
|
|
|
|
|
|
|
- $this->data['hot'] = Dever::load('push/lib/data')->get('home_hot', '首页热门商品', 6);
|
|
|
+ $hot = Dever::load('push/lib/data')->get('home_hot', '首页热门商品', 50);
|
|
|
+
|
|
|
+ $this->data['hot'] = array();
|
|
|
+ if ($hot) {
|
|
|
+ $shop_id = isset($this->data['shop']['id']) ? $this->data['shop']['id'] : 3;
|
|
|
+ foreach ($hot as $k => $v) {
|
|
|
+ if (count($this->data['hot']) >= 6) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $shop_id = isset($v['shop_id']) && $v['shop_id'] ? $v['shop_id'] : $shop_id;
|
|
|
+ $goods = Dever::load('shop/lib/info')->getGoodsInfo($shop_id, $v['type_id'], false, true, true, $this->uid);
|
|
|
+ if ($goods) {
|
|
|
+ if ($goods['total'] > 0) {
|
|
|
+ $this->data['hot'][] = $v;
|
|
|
+ } elseif ($goods['sku_type'] == 2) {
|
|
|
+ $this->data['hot'][] = $v;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- $this->data['top'] = Dever::load('push/lib/data')->get('home_top', '首页推荐商品', 6);
|
|
|
+ $top = Dever::load('push/lib/data')->get('home_top', '首页推荐商品', 50);
|
|
|
+
|
|
|
+ $this->data['top'] = array();
|
|
|
+ if ($top) {
|
|
|
+ $shop_id = isset($this->data['shop']['id']) ? $this->data['shop']['id'] : 3;
|
|
|
+ foreach ($hot as $k => $v) {
|
|
|
+ if (count($this->data['top']) >= 6) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $shop_id = isset($v['shop_id']) && $v['shop_id'] ? $v['shop_id'] : $shop_id;
|
|
|
+ $goods = Dever::load('shop/lib/info')->getGoodsInfo($shop_id, $v['type_id'], false, true, true, $this->uid);
|
|
|
+ if ($goods) {
|
|
|
+ if ($goods['total'] > 0) {
|
|
|
+ $this->data['top'][] = $v;
|
|
|
+ } elseif ($goods['sku_type'] == 2) {
|
|
|
+ $this->data['top'][] = $v;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
$this->data['alert'] = Dever::load('push/lib/data')->get('home_alert', '首页弹窗', 1);
|