|
@@ -112,13 +112,22 @@ class Activity extends Base{
|
|
|
}
|
|
|
|
|
|
public function list(){
|
|
|
- $param=$this->request->param(["actCode"=>"","status"=>"","skuCode"=>"","version"=>"","roundId"=>"","page"=>1,"size"=>15],"post","trim");
|
|
|
+ $param=$this->request->param([
|
|
|
+ "actCode"=>"",
|
|
|
+ "status"=>"",
|
|
|
+ "skuCode"=>"",
|
|
|
+ "version"=>"",
|
|
|
+ "roundId"=>"",
|
|
|
+ 'company_name'=>'',
|
|
|
+ 'contactor'=>'',
|
|
|
+ 'goodName'=>'',
|
|
|
+ "page"=>1,"size"=>15],"post","trim");
|
|
|
$where=[["is_del","=",0]];
|
|
|
if($param['actCode']!==""){
|
|
|
$where[]=["actCode","like","%".$param['actCode']."%"];
|
|
|
}
|
|
|
if($param['status']!==""){
|
|
|
- $where[]=["status","=",$param['status']];
|
|
|
+ $where[]=["act_good.status","=",$param['status']];
|
|
|
}
|
|
|
if($param['skuCode']!==""){
|
|
|
$where[]=["yz_good_code","like","%".$param['skuCode']."%"];
|
|
@@ -127,9 +136,20 @@ class Activity extends Base{
|
|
|
$where[]=["roundId","=",$param['roundId']];
|
|
|
}
|
|
|
if($param['version']!==''){
|
|
|
- $where[]=['version','=',$param['version']];
|
|
|
+ $where[]=['act_good.version','=',$param['version']];
|
|
|
+ }
|
|
|
+ if($param['company_name']!==""){
|
|
|
+ $where[]=["act.company_name","like","%".$param['company_name']."%"];
|
|
|
+ }
|
|
|
+ if($param['contactor']!==""){
|
|
|
+ $where[]=["act.contactor","like","%".$param['contactor']."%"];
|
|
|
+ }
|
|
|
+ if($param['goodName']!==""){
|
|
|
+ $where[]=["goodName","like","%".$param['goodName']."%"];
|
|
|
}
|
|
|
- $list= $this->model->with(["act","platformYz"=>["platform","good"=>['unit','brand','category']],"promocode"])->where($where)->order("id desc")->paginate(["list_rows"=>$param['size'],"page"=>$param['page']]);
|
|
|
+ $list= $this->model->with(["act","platformYz"=>["platform","good"=>['unit','brand','category']],"promocode"])
|
|
|
+ ->withJoin(["act"],"left")
|
|
|
+ ->where($where)->order("id desc")->paginate(["list_rows"=>$param['size'],"page"=>$param['page']]);
|
|
|
$list->each(function(&$item){
|
|
|
$item['status_cn']=ActGood::$statusCn[$item['status']]??"";
|
|
|
$item['ActStatus_cn']=\app\txx\model\Act::$statusCn[$item['act_status']];
|