|
@@ -20,17 +20,22 @@ class CombindStock extends Base
|
|
|
}
|
|
|
|
|
|
public function list(){
|
|
|
- $param=$this->request->only(['spuCode'=>'','wsm_code'=>'','good_name'=>'','cat_id'=>'','status'=>'','flag'=>'',
|
|
|
+ $param=$this->request->only(['spuCode'=>'','wsm_code'=>'','good_name'=>'','cat_id'=>'','status'=>'','flag'=>'','companyNo'=>'','companyName'=>'',
|
|
|
"create_start"=>"2023-01-01 00:00:00","create_end"=>date("Y-m-d H:i:s"),"page"=>1,"size"=>15],'post','trim');
|
|
|
$where=[["combind_stock.createtime","between",[$param['create_start']?: '2023-01-01 00:00:00',$param['create_end']?: date("Y-m-d H:i:s")]]];
|
|
|
$param['spuCode']==''?:$where[]=["combind_stock.spuCode","like","%{$param['spuCode']}%"];
|
|
|
$param['wsm_code']==''?: $where[]=["combind_stock.wsm_code","like","%{$param['wsm_code']}%"];
|
|
|
$param['good_name']==''?: $where[]=["combind_stock.good_name","like","%{$param['good_name']}%"];
|
|
|
+ $param['companyNo']==''?: $where[]=["good.companyNo","like","%{$param['companyNo']}%"];
|
|
|
+ $param['companyName']==''?: $where[]=["good.companyName","like","%{$param['companyName']}%"];
|
|
|
$param['cat_id']==''?: $where[]=["good.cat_id","=",$param['cat_id']];
|
|
|
$param['flag']==''?: $where[]=["combind_stock.flag","=",$param['flag']];
|
|
|
$param['status']==''?: $where[]=["combind_stock.status","=",$param['status']];
|
|
|
- $list = $this->combindStock->alias("a")->withJoin(["wsminfo","good"],"left")->where($where)->order("id desc")->paginate
|
|
|
- (["page"=>$param['page'],"list_rows"=>$param['size']]);
|
|
|
+ $list = $this->combindStock
|
|
|
+ ->alias("a")
|
|
|
+ ->withJoin(["wsminfo","good"],"left")
|
|
|
+ ->where($where)->order("id desc")
|
|
|
+ ->paginate(["page"=>$param['page'],"list_rows"=>$param['size']]);
|
|
|
|
|
|
return app_show(0,"获取成功",["list"=>$list->items(),"count"=>$list->total()]);
|
|
|
|