| | |
| | | use app\api\model\plus\bargain\Product as BargainProductModel; |
| | | use app\api\model\plus\bargain\Active as BargainActiveModel; |
| | | use app\api\model\plus\live\Room as RoomModel; |
| | | use app\api\model\plus\release\Project; |
| | | |
| | | /** |
| | | * 首页模型 |
| | |
| | | $items[$key]['data'] = $model->getCouponList($user, $item, true, 1); |
| | | } else if ($item['type'] === 'article') { |
| | | $items[$key]['data'] = $model->getArticleList($item); |
| | | }else if ($item['type'] === 'hdzq') { |
| | | $items[$key]['data'] = $model->getReleaseList($item); |
| | | }else if ($item['type'] === 'gxpp') { |
| | | $items[$key]['data'] = $model->getReleaseList($item,$user); |
| | | } else if ($item['type'] === 'special') { |
| | | $items[$key]['data'] = $model->getSpecialList($item); |
| | | } else if ($item['type'] === 'seckillProduct') { |
| | |
| | | $data[] = [ |
| | | 'product_id' => $product['product_id'], |
| | | 'product_name' => $product['product_name'], |
| | | 'cart' => $product['cart'], |
| | | 'product_sku' => $product['product_sku'], |
| | | 'selling_point' => $product['selling_point'], |
| | | 'image' => $product['image'][0]['file_path'], |
| | | 'product_image' => $product['image'][0]['file_path'], |
| | |
| | | { |
| | | // 获取文章数据 |
| | | $model = new Article; |
| | | $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum'],0); |
| | | $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum']); |
| | | return $articleList->isEmpty() ? [] : $articleList->toArray()['data']; |
| | | } |
| | | |
| | | /** |
| | | * 获取供需列表 |
| | | */ |
| | | private function getReleaseList($item,$user=[]) |
| | | { |
| | | // 获取数据 |
| | | $model = new Project; |
| | | $list = $model->getIndexList($user,$item['params']['auto']['showNum']); |
| | | return $list->isEmpty() ? [] : $list->toArray()['data']; |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | // 获取头条数据 |
| | | $model = new Article; |
| | | $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum'],0); |
| | | $articleList = $model->getList($item['params']['auto']['category'], $item['params']['auto']['showNum']); |
| | | return $articleList->isEmpty() ? [] : $articleList->toArray()['data']; |
| | | } |
| | | |