|
|
@@ -57,17 +57,22 @@ class Inventory extends Base
|
|
|
$type = $this->request->post('type/s', '');
|
|
|
$type_id = $this->request->post('type_id/s', '');
|
|
|
$spec_id = $this->request->post('spec/s', '');
|
|
|
- if(!empty($type)) $where['a.type'] = $type;
|
|
|
- if(!empty($type_id)) $where['a.type_id'] = $type_id;
|
|
|
- if(!empty($spec_id)) $where['a.variety_id'] = $spec_id;
|
|
|
-
|
|
|
+ $limit = $this->request->post('limit/d', 15); //条数
|
|
|
+ $time = $this->request->post('create_time/s'); //日期
|
|
|
+ if(!empty($type)) $where[] = ['a.type', '=', $type];
|
|
|
+ if(!empty($type_id)) $where[] = ['a.type_id', '=',$type_id];
|
|
|
+ if(!empty($spec_id)) $where[] = ['a.variety_id', '=',$spec_id];
|
|
|
+ if(!empty($time)){
|
|
|
+ $arr = explode(',', $time);
|
|
|
+ $where[] = ['a.createtime', '>=', strtotime($arr[0])];
|
|
|
+ $where[] = ['a.createtime', '<=', strtotime($arr[1])];
|
|
|
+ }
|
|
|
$list = $stockLog::alias('a')
|
|
|
->leftjoin('stock_config b', 'a.variety_id = b.id')
|
|
|
->where('a.user_id', $this->userinfo['id'])
|
|
|
->where($where)
|
|
|
- //->whereTime('a.createtime', '-2 days')
|
|
|
->field('a.*,b.title')
|
|
|
- ->select();
|
|
|
+ ->paginate($limit);
|
|
|
$this->success('ok', $list);
|
|
|
}
|
|
|
|