...
|
...
|
@@ -19,17 +19,17 @@ class SalesmangoodsController extends AdminBaseController{ |
|
|
if(!empty($_POST['start_time']) && !empty($_POST['end_time'])){
|
|
|
$start_time = strtotime($_POST['start_time']);
|
|
|
$end_time = strtotime($_POST['end_time']);
|
|
|
$where['create_time'] = [['>=',$start_time],['<=',$end_time]];
|
|
|
$where['a.create_time'] = [['>=',$start_time],['<=',$end_time]];
|
|
|
}
|
|
|
if(!empty($_POST['keyword'])){
|
|
|
$keyword = $_POST['keyword'];
|
|
|
$where['book_name'] = ['like',"%$keyword%"];
|
|
|
$where['a.book_name'] = ['like',"%$keyword%"];
|
|
|
}
|
|
|
$data = Db::name('goods') -> where($where) -> paginate(1000000);
|
|
|
$data = Db::name('goods') -> alias('a') -> field('a.*,b.user_nickname') -> join('user b',"a.uid=b.id",'LEFT') -> where($where) -> paginate(1000000);
|
|
|
$this -> assign('data',$data);
|
|
|
return $this -> fetch();
|
|
|
}else{
|
|
|
$data = Db::name('goods') -> where('type',2) -> paginate(12);
|
|
|
$data = Db::name('goods') -> alias('a') -> field('a.*,b.user_nickname') -> join('user b',"a.uid=b.id",'LEFT') -> where('type',2) -> paginate(12);
|
|
|
$this -> assign('data',$data);
|
|
|
return $this -> fetch();
|
|
|
}
|
...
|
...
|
|