正在显示
3 个修改的文件
包含
9 行增加
和
0 行删除
| @@ -62,6 +62,9 @@ class BlogController extends BaseController | @@ -62,6 +62,9 @@ class BlogController extends BaseController | ||
| 62 | } | 62 | } |
| 63 | }); | 63 | }); |
| 64 | } | 64 | } |
| 65 | + if(isset($this->map['status']) && !empty($this->map['status'])){ | ||
| 66 | + $query = $query->where('status',$this->map['status']); | ||
| 67 | + } | ||
| 65 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ | 68 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ |
| 66 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); | 69 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); |
| 67 | } | 70 | } |
| @@ -62,6 +62,9 @@ class NewsController extends BaseController | @@ -62,6 +62,9 @@ class NewsController extends BaseController | ||
| 62 | } | 62 | } |
| 63 | }); | 63 | }); |
| 64 | } | 64 | } |
| 65 | + if(isset($this->map['status']) && !empty($this->map['status'])){ | ||
| 66 | + $query = $query->where('status',$this->map['status']); | ||
| 67 | + } | ||
| 65 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ | 68 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ |
| 66 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); | 69 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); |
| 67 | } | 70 | } |
| @@ -87,6 +87,9 @@ class ProductController extends BaseController | @@ -87,6 +87,9 @@ class ProductController extends BaseController | ||
| 87 | if(isset($this->map['title']) && !empty($this->map['title'])){ | 87 | if(isset($this->map['title']) && !empty($this->map['title'])){ |
| 88 | $query = $query->where('title','like','%'.$this->map['title'].'%'); | 88 | $query = $query->where('title','like','%'.$this->map['title'].'%'); |
| 89 | } | 89 | } |
| 90 | + if(isset($this->map['status']) && !empty($this->map['status'])){ | ||
| 91 | + $query = $query->where('status',$this->map['status']); | ||
| 92 | + } | ||
| 90 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ | 93 | if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ |
| 91 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); | 94 | $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); |
| 92 | } | 95 | } |
-
请 注册 或 登录 后发表评论