request->param(); //搜索条件 $where = []; if (!empty($param['keyword'])) { $where[] = ['title', 'like', "%{$param['keyword']}%"]; } $list = BusinessModel::where($where)->paginate(10, false, ['query' => $param]); if (!$list->isEmpty()) { foreach ($list as $v) { if (!empty($v['tags'])) { $v['tags'] = implode(' ',json_decode($v['tags'],true)); } } } $this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : ''); $this->assign('list', $list->items()); $this->assign('page', $list->render()); return $this->fetch(); } }