|
|
@@ -26,7 +26,6 @@ class Inventory extends Base
|
|
|
//添加出入库
|
|
|
public function stock(StockLog $stockLog, StockService $stockService)
|
|
|
{
|
|
|
-
|
|
|
$data = $this->request->post();
|
|
|
$result = false;
|
|
|
Db::startTrans();
|
|
|
@@ -54,13 +53,18 @@ class Inventory extends Base
|
|
|
//出入库记录
|
|
|
public function stocklog(StockLog $stockLog)
|
|
|
{
|
|
|
-
|
|
|
- $data = $this->request->post();
|
|
|
-
|
|
|
- //$result = $userEnterLog::create($data);
|
|
|
+ $where = [];
|
|
|
+ $type_id = $this->request->post('type_id/s', '');
|
|
|
+ if(!empty($type_id)) $where['a.type_id'] = $type_id;
|
|
|
|
|
|
-
|
|
|
- $this->success();
|
|
|
+ $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();
|
|
|
+ $this->success('ok', $list);
|
|
|
}
|
|
|
|
|
|
|