作者 lyh

gx

@@ -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']]);