|
|
@@ -31,7 +31,7 @@ class Merchant extends BaseController
|
|
|
{
|
|
|
parent::__construct($app);
|
|
|
$this->repository = $repository;
|
|
|
- $this->userInfo =$this->request->isLogin() ? $this->request->userInfo():null;
|
|
|
+ $this->userInfo = $this->request->isLogin() ? $this->request->userInfo() : null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -43,6 +43,9 @@ class Merchant extends BaseController
|
|
|
{
|
|
|
[$page, $limit] = $this->getPage();
|
|
|
$where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id']);
|
|
|
+ if (!$where['location']) {
|
|
|
+ $where['location'] = $this->userInfo['now_local'];
|
|
|
+ }
|
|
|
return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo));
|
|
|
}
|
|
|
|
|
|
@@ -73,9 +76,9 @@ class Merchant extends BaseController
|
|
|
public function productList($id)
|
|
|
{
|
|
|
[$page, $limit] = $this->getPage();
|
|
|
- $where = $this->request->params(['keyword','order','mer_cate_id','cate_id', 'order', 'price_on', 'price_off', 'brand_id', 'pid']);
|
|
|
- if(!$this->repository->apiGetOne($id)) return app('json')->fail(' 店铺已打烊');
|
|
|
- return app('json')->success($this->repository->productList($id,$where, $page, $limit,$this->userInfo));
|
|
|
+ $where = $this->request->params(['keyword', 'order', 'mer_cate_id', 'cate_id', 'order', 'price_on', 'price_off', 'brand_id', 'pid']);
|
|
|
+ if (!$this->repository->apiGetOne($id)) return app('json')->fail(' 店铺已打烊');
|
|
|
+ return app('json')->success($this->repository->productList($id, $where, $page, $limit, $this->userInfo));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -86,14 +89,14 @@ class Merchant extends BaseController
|
|
|
*/
|
|
|
public function categoryList($id)
|
|
|
{
|
|
|
- if(!$this->repository->merExists($id))
|
|
|
+ if (!$this->repository->merExists($id))
|
|
|
return app('json')->fail('店铺已打烊');
|
|
|
return app('json')->success($this->repository->categoryList($id));
|
|
|
}
|
|
|
|
|
|
public function qrcode($id)
|
|
|
{
|
|
|
- if(!$this->repository->merExists($id))
|
|
|
+ if (!$this->repository->merExists($id))
|
|
|
return app('json')->fail('店铺已打烊');
|
|
|
$url = $this->request->param('type') == 'routine' ? $this->repository->routineQrcode(intval($id)) : $this->repository->wxQrcode(intval($id));
|
|
|
return app('json')->success(compact('url'));
|