正在显示
2 个修改的文件
包含
2 行增加
和
2 行删除
| @@ -66,7 +66,7 @@ class BlogController extends BaseController | @@ -66,7 +66,7 @@ class BlogController extends BaseController | ||
| 66 | $query = $query->where('status',$this->map['status']); | 66 | $query = $query->where('status',$this->map['status']); |
| 67 | } | 67 | } |
| 68 | if(isset($this->map['name']) && !empty($this->map['name'])){ | 68 | if(isset($this->map['name']) && !empty($this->map['name'])){ |
| 69 | - $query = $query->where('name','like','%'.$this->map['name'].'%'); | 69 | + $query = $query->where('name',$this->map['name'][0],'%'.$this->map['name'][1].'%'); |
| 70 | } | 70 | } |
| 71 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ | 71 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ |
| 72 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); | 72 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); |
| @@ -66,7 +66,7 @@ class NewsController extends BaseController | @@ -66,7 +66,7 @@ class NewsController extends BaseController | ||
| 66 | $query = $query->where('status',$this->map['status']); | 66 | $query = $query->where('status',$this->map['status']); |
| 67 | } | 67 | } |
| 68 | if(isset($this->map['name']) && !empty($this->map['name'])){ | 68 | if(isset($this->map['name']) && !empty($this->map['name'])){ |
| 69 | - $query = $query->where('name','like','%'.$this->map['name'].'%'); | 69 | + $query = $query->where('name',$this->map['name'][0],'%'.$this->map['name'][1].'%'); |
| 70 | } | 70 | } |
| 71 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ | 71 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ |
| 72 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); | 72 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); |
-
请 注册 或 登录 后发表评论