作者 lyh

Merge branch 'dev' of http://47.244.231.31:8099/zhl/globalso-v6 into dev

@@ -28,8 +28,20 @@ class ProductController extends BaseController @@ -28,8 +28,20 @@ class ProductController extends BaseController
28 if(!empty($this->param['search'])){ 28 if(!empty($this->param['search'])){
29 $map[] = ['title', 'like', "%{$this->param['search']}%"]; 29 $map[] = ['title', 'like', "%{$this->param['search']}%"];
30 } 30 }
  31 + if(!empty($this->param['created_at'][0])){
  32 + $this->param['created_at'][0] .= ' 00:00:00';
  33 + }
  34 + if(!empty($this->param['created_at'][1])){
  35 + $this->param['created_at'][1] .= ' 23:59:59';
  36 + }
  37 + if(empty($this->param['created_at'][0]) && !empty($this->param['created_at'][1])){
  38 + $map[] = ['created_at', '>=', $this->param['created_at'][0]];
  39 + }
  40 + if(!empty($this->param['created_at'][0]) && empty($this->param['created_at'][1])){
  41 + $map[] = ['created_at', '<=', $this->param['created_at']];
  42 + }
31 if(!empty($this->param['created_at'][0]) && !empty($this->param['created_at'][1])){ 43 if(!empty($this->param['created_at'][0]) && !empty($this->param['created_at'][1])){
32 - $map[] = ['created_at', 'between', $this->param['created_at']]; 44 + $map[] = ['created_at', 'between', [$this->param['created_at']]];
33 } 45 }
34 if(!empty($this->param['category_id'])){ 46 if(!empty($this->param['category_id'])){
35 $ids = CategoryRelated::where('cate_id', $this->param['category_id'])->pluck('product_id')->toArray(); 47 $ids = CategoryRelated::where('cate_id', $this->param['category_id'])->pluck('product_id')->toArray();