|
...
|
...
|
@@ -28,8 +28,20 @@ class ProductController extends BaseController |
|
|
|
if(!empty($this->param['search'])){
|
|
|
|
$map[] = ['title', 'like', "%{$this->param['search']}%"];
|
|
|
|
}
|
|
|
|
if(!empty($this->param['created_at'][0])){
|
|
|
|
$this->param['created_at'][0] .= ' 00:00:00';
|
|
|
|
}
|
|
|
|
if(!empty($this->param['created_at'][1])){
|
|
|
|
$this->param['created_at'][1] .= ' 23:59:59';
|
|
|
|
}
|
|
|
|
if(empty($this->param['created_at'][0]) && !empty($this->param['created_at'][1])){
|
|
|
|
$map[] = ['created_at', '>=', $this->param['created_at'][0]];
|
|
|
|
}
|
|
|
|
if(!empty($this->param['created_at'][0]) && empty($this->param['created_at'][1])){
|
|
|
|
$map[] = ['created_at', '<=', $this->param['created_at']];
|
|
|
|
}
|
|
|
|
if(!empty($this->param['created_at'][0]) && !empty($this->param['created_at'][1])){
|
|
|
|
$map[] = ['created_at', 'between', $this->param['created_at']];
|
|
|
|
$map[] = ['created_at', 'between', [$this->param['created_at']]];
|
|
|
|
}
|
|
|
|
if(!empty($this->param['category_id'])){
|
|
|
|
$ids = CategoryRelated::where('cate_id', $this->param['category_id'])->pluck('product_id')->toArray();
|
...
|
...
|
|