|
@@ -114,20 +114,30 @@ class Activity extends Base{
|
|
|
if($param['roundId']!==""){
|
|
|
$where[]=["roundId","=",$param['roundId']];
|
|
|
}
|
|
|
- $list= $this->model->with(["act","platformYz"=>["platform","good"],"promocode"])->where($where)->order("id desc")->paginate(["list_rows"=>$param['size'],"page"=>$param['page']]);
|
|
|
- $list->each(function($item,$key){
|
|
|
+ $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->visible(['id',"actCode","yz_good_code","stock_num","status","addtime","updatetime","act_name",
|
|
|
+ "company_name","contactor","mobile","startTime","endTime","act_status","final_price","good_name","unit_name","cat_name",
|
|
|
+ "brand_name","fetch_url","roundId","status_cn","act_status_cn"]);
|
|
|
+ $list->each(function (&$item){
|
|
|
$item['status_cn']=ActGood::$statusCn[$item['status']]??"";
|
|
|
- $item['act_status_cn']=\app\txx\model\Act::$statusCn[$item['act_status']]??"";
|
|
|
- return $item;
|
|
|
+ $item['act_status_cn']=\app\txx\model\Act::$statusCn[$item['act_status']];
|
|
|
+ if($item['act_status']!==4){
|
|
|
+ $item['fetch_url']=null;
|
|
|
+ }
|
|
|
});
|
|
|
$this->success("获取成功",["list"=>$list->items(),"count"=>$list->total()]);
|
|
|
}
|
|
|
public function info(){
|
|
|
$param=$this->request->param(["id"=>""],"post","trim");
|
|
|
- $info= $this->model->with(["act","platformYz"=>["platform","good"],"promocode"])->findOrEmpty($param['id']);
|
|
|
+ $info= $this->model->with(["act","platformYz"=>["platform","good"=>['unit','brand','category']],"promocode"])->findOrEmpty($param['id']);
|
|
|
if($info->isEmpty()){
|
|
|
$this->error("信息有误");
|
|
|
}
|
|
|
+ $info->visible(['id','actCode','yz_good_code','stock_num','status','addtime','updatetime','act_name',
|
|
|
+ 'company_name','contactor','mobile','startTime','endTime','act_status','final_price','good_name','unit_name','cat_name',
|
|
|
+ 'brand_name','fetch_url','roundId','status_cn','act_status_cn']);
|
|
|
$info['status_cn']=ActGood::$statusCn[$info['status']]??"";
|
|
|
$info['act_status_cn']=\app\txx\model\Act::$statusCn[$info['act_status']];
|
|
|
$this->success("获取成功",$info);
|