作者 lyh

gx

@@ -65,6 +65,9 @@ class BlogController extends BaseController @@ -65,6 +65,9 @@ class BlogController extends BaseController
65 if(isset($this->map['status'])){ 65 if(isset($this->map['status'])){
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'])){
  69 + $query = $query->where('name','like','%'.$this->map['name'].'%');
  70 + }
68 if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ 71 if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){
69 $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']]);
70 } 73 }
@@ -65,6 +65,9 @@ class NewsController extends BaseController @@ -65,6 +65,9 @@ class NewsController extends BaseController
65 if(isset($this->map['status'])){ 65 if(isset($this->map['status'])){
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'])){
  69 + $query = $query->where('name','like','%'.$this->map['name'].'%');
  70 + }
68 if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ 71 if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){
69 $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']]);
70 } 73 }