...
|
...
|
@@ -268,6 +268,7 @@ class Index extends Api |
|
|
* @ApiParams (name="rows", type="int", required=true, description="rows")
|
|
|
* @ApiParams (name="keywords", type="string", required=true, description="搜索关键字")
|
|
|
* @ApiParams (name="city", type="string", required=true, description="区域关键字")
|
|
|
* @ApiParams (name="type", type="int", required=true, description="1=首页,2=爱车养护")
|
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
|
|
|
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
|
|
|
* @ApiReturn ({
|
...
|
...
|
@@ -294,14 +295,18 @@ class Index extends Api |
|
|
$param = $this->request->param();
|
|
|
$map = [];
|
|
|
$map2 = [];
|
|
|
$map3 = [];
|
|
|
if ($param['city'] != '全市') {
|
|
|
$map['address'] = ['LIKE', '%' . $param['city'] . '%'];
|
|
|
}
|
|
|
if (!empty($param['keywords']) || $param['keywords'] != null || $param['keywords'] != '' || $param['keywords'] != "") {
|
|
|
$map2['title'] = ['LIKE', '%' . $param['keywords'] . '%'];
|
|
|
}
|
|
|
$rult = Db::name('seller')->where('is_show', 1)->where($map)->where($map2)->order('id desc')->page($param['pages'], $param['rows'])->select();
|
|
|
$count = Db::name('seller')->where('is_show', 1)->where($map)->where($map2)->order('id desc')->select();
|
|
|
if ($param['type'] == 1) {
|
|
|
$map3['is_show'] = ['eq', 1];
|
|
|
}
|
|
|
$rult = Db::name('seller')->where($map3)->where($map)->where($map2)->order('id desc')->page($param['pages'], $param['rows'])->select();
|
|
|
$count = Db::name('seller')->where($map3)->where($map)->where($map2)->order('id desc')->select();
|
|
|
if (empty($rult)) {
|
|
|
//如果为空
|
|
|
$list = [
|
...
|
...
|
|