|
|
|
@ -19,13 +19,12 @@ class AgentProductController extends Controller |
|
|
|
public function index() |
|
|
|
{ |
|
|
|
$category_id = request()->input('category_id'); |
|
|
|
$where = []; |
|
|
|
if ($category_id) { |
|
|
|
$where['category_id'] = $category_id; |
|
|
|
} |
|
|
|
|
|
|
|
$where['agent_id'] = $this->agent_id; |
|
|
|
|
|
|
|
$list = AgentProduct::list()->where($where)->orderBy('id', 'DESC')->simplePaginate(); |
|
|
|
$list = AgentProduct::list($this->agent_id)->where($where)->orderBy('id', 'DESC')->simplePaginate(); |
|
|
|
$list = $this->paginatePicAddHost($list); |
|
|
|
$list = $this->insertAd($list); |
|
|
|
|
|
|
|
@ -70,7 +69,7 @@ class AgentProductController extends Controller |
|
|
|
// 猜你喜欢
|
|
|
|
public function guessLike() |
|
|
|
{ |
|
|
|
$list = AgentProduct::list()->where('agent_id', $this->agent_id)->orderBy('id', 'DESC')->simplePaginate(); |
|
|
|
$list = AgentProduct::list($this->agent_id)->orderBy('id', 'DESC')->simplePaginate(); |
|
|
|
$list = $this->paginatePicAddHost($list); |
|
|
|
$list = $list->toArray(); |
|
|
|
if (!empty($list['data']) && is_array($list['data'])) { |
|
|
|
@ -84,7 +83,7 @@ class AgentProductController extends Controller |
|
|
|
//【我的】页面下方推荐
|
|
|
|
public function recommendList() |
|
|
|
{ |
|
|
|
$list = AgentProduct::list()->where(['agent_id' => $this->agent_id, 'is_rec' => 1]) |
|
|
|
$list = AgentProduct::list($this->agent_id)->where(['is_rec' => 1]) |
|
|
|
->orderBy('id', 'DESC')->simplePaginate(); |
|
|
|
$list = $this->paginatePicAddHost($list); |
|
|
|
$list = $this->insertAd($list); |
|
|
|
@ -95,7 +94,7 @@ class AgentProductController extends Controller |
|
|
|
//人气爆款列表,销量排序
|
|
|
|
public function hotList() |
|
|
|
{ |
|
|
|
$list = AgentProduct::list()->where('agent_id', $this->agent_id)->orderBy('id', 'DESC')->simplePaginate(); |
|
|
|
$list = AgentProduct::list($this->agent_id)->orderBy('id', 'DESC')->simplePaginate(); |
|
|
|
$list = $this->paginatePicAddHost($list); |
|
|
|
$list = $this->insertAd($list); |
|
|
|
|
|
|
|
|