正在显示
1 个修改的文件
包含
10 行增加
和
0 行删除
@@ -511,6 +511,8 @@ class Store extends Api | @@ -511,6 +511,8 @@ class Store extends Api | ||
511 | * @ApiRoute (/api/store/house_list) | 511 | * @ApiRoute (/api/store/house_list) |
512 | * | 512 | * |
513 | * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") | 513 | * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") |
514 | + * @ApiParams (name="area", type="string", required=false, description="市区地址例如:'天津市/西青区'") | ||
515 | + * @ApiParams (name="keyword", type="string", required=false, description="关键字") | ||
514 | * | 516 | * |
515 | * | 517 | * |
516 | * @ApiReturn({ | 518 | * @ApiReturn({ |
@@ -534,6 +536,14 @@ class Store extends Api | @@ -534,6 +536,14 @@ class Store extends Api | ||
534 | $where = [ | 536 | $where = [ |
535 | 'id' => ['in',$store['house_ids']] | 537 | 'id' => ['in',$store['house_ids']] |
536 | ]; | 538 | ]; |
539 | + $area = $this->request->param('area'); | ||
540 | + $keyword = $this->request->param('keyword'); | ||
541 | + if(!empty($area)){ | ||
542 | + $where['area'] = ['like',"%$area%"]; | ||
543 | + } | ||
544 | + if(!empty($keyword)){ | ||
545 | + $where['name'] = ['like',"%$keyword%"]; | ||
546 | + } | ||
537 | $data = Db::name('house') | 547 | $data = Db::name('house') |
538 | ->where($where) | 548 | ->where($where) |
539 | ->field('id,name,area') | 549 | ->field('id,name,area') |
-
请 注册 或 登录 后发表评论