Compare commits
2 Commits
c82890dfc5
...
75122fffb6
Author | SHA1 | Date |
---|---|---|
weiz | 75122fffb6 | |
weiz | 59dce7661f |
|
@ -16,10 +16,16 @@
|
||||||
//土地列表
|
//土地列表
|
||||||
public function list(): Json
|
public function list(): Json
|
||||||
{
|
{
|
||||||
$params = $this->request->post(['page_no','page_size']);
|
$params = $this->request->get(['page_no','page_size','keyword']);
|
||||||
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
|
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
|
||||||
$pageSize = empty($params['page_size']) ? 6 : $params['page_size'];
|
$pageSize = empty($params['page_size']) ? 6 : $params['page_size'];
|
||||||
$data = Land::where('user_id',$this->userId)->page($pageNo,$pageSize)->order('create_time desc')->select()->each(function($item){
|
$where = [
|
||||||
|
['user_id','=',$this->userId]
|
||||||
|
];
|
||||||
|
if(!empty($params['keyword'])){
|
||||||
|
$where[] = ['title','like','%'.$params['keyword'].'%'];
|
||||||
|
}
|
||||||
|
$data = Land::where($where)->page($pageNo,$pageSize)->order('create_time desc')->select()->each(function($item){
|
||||||
$item['pic'] = json_decode($item['pic']);
|
$item['pic'] = json_decode($item['pic']);
|
||||||
return $item;
|
return $item;
|
||||||
})->toArray();
|
})->toArray();
|
||||||
|
|
Loading…
Reference in New Issue