正在显示
1 个修改的文件
包含
20 行增加
和
5 行删除
| @@ -32,11 +32,8 @@ class KeywordController extends BaseController | @@ -32,11 +32,8 @@ class KeywordController extends BaseController | ||
| 32 | */ | 32 | */ |
| 33 | public function index(Keyword $keyword) | 33 | public function index(Keyword $keyword) |
| 34 | { | 34 | { |
| 35 | - if(!empty($this->map['title'])){ | ||
| 36 | - $this->map['title'] = ['like','%'.$this->map['title'].'%']; | ||
| 37 | - } | ||
| 38 | - $this->map['project_id'] = $this->user['project_id']; | ||
| 39 | - $filed = ['id', 'project_id', 'title', 'seo_title', 'seo_keywords', 'seo_description', 'status', 'created_at','route']; | 35 | + $this->map = $this->searchParam($this->map); |
| 36 | + $filed = ['id', 'project_id', 'title', 'seo_title', 'seo_keywords', 'seo_description', 'status', 'created_at','route','keyword_title']; | ||
| 40 | $data = $keyword->lists($this->map,$this->page,$this->row,$this->order,$filed); | 37 | $data = $keyword->lists($this->map,$this->page,$this->row,$this->order,$filed); |
| 41 | if(!empty($data)){ | 38 | if(!empty($data)){ |
| 42 | foreach ($data['list'] as &$v){ | 39 | foreach ($data['list'] as &$v){ |
| @@ -53,6 +50,24 @@ class KeywordController extends BaseController | @@ -53,6 +50,24 @@ class KeywordController extends BaseController | ||
| 53 | } | 50 | } |
| 54 | 51 | ||
| 55 | /** | 52 | /** |
| 53 | + * @remark :搜索 | ||
| 54 | + * @name :searchParam | ||
| 55 | + * @author :lyh | ||
| 56 | + * @method :post | ||
| 57 | + * @time :2023/12/21 17:40 | ||
| 58 | + */ | ||
| 59 | + public function searchParam($map){ | ||
| 60 | + if(!empty($map['title'])){ | ||
| 61 | + $map['title'] = ['like','%'.$map['title'].'%']; | ||
| 62 | + } | ||
| 63 | + if(!empty($map['keyword_title'])){ | ||
| 64 | + $map['keyword_title'] = ['like','%'.$map['keyword_title'].'%']; | ||
| 65 | + } | ||
| 66 | + $map['project_id'] = $this->user['project_id']; | ||
| 67 | + return $this->success($map); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + /** | ||
| 56 | * @remark :获取数据详情 | 71 | * @remark :获取数据详情 |
| 57 | * @name :info | 72 | * @name :info |
| 58 | * @author :lyh | 73 | * @author :lyh |
-
请 注册 或 登录 后发表评论