$play_lists=$spPlaylistModel->join(" A join sh_sp_playlist_media_map B on A.id = B.playlist_id ")->field("A.id,A.`name`,A.sp_id,group_concat(B.media_id) media_ids")->group("A.id")->select();
$play_lists=$spPlaylistModel->join(" A join sh_sp_playlist_media_map B on A.id = B.playlist_id ")->field("A.id,A.`name`,A.sp_id,group_concat(B.media_id) media_ids")->group("A.id")->select();
$where=" and (`title` like '%".$searchValue."%' or `code` like '%".$searchValue."%') ";
$where=" and (E.`name` like '%".$searchValue."%') ";
}
if($searchSp){
$where.=" and A.sp_id = $searchSp ";
}
if($searchHotel){
$where.=" and A.hotel_id = $searchHotel ";
}
$model=newModel();
//======================
$fields="count(id) count";
$fields="count(A.id) count";
//返回列表(limit分页)
if($queryType=="list"){
$where.=$sort." ".$limit;
$fields=" *,case `status` when 1 then '<font color=green>上线</font>' when 2 then '<font color=red>下线</font>' when 0 then '<font>未知</font>' end as `status` ";
$fields=" A.id,A.addtime,A.updatetime,E.`name` task_name,B.`title` media_name,C.`name` hotel_name,D.`name` sp_name,case A.`status` when 1 then '<font color=green>注入成功</font>' when 2 then '<font color=red>注入失败</font>' when 0 then '<font>未注入</font>' end as `status` ";
}
$sql="select ".$fields." from sh_media_wasu where 1=1 ".$where.";";
$sql="select ".$fields." from sh_task_inject_log A join sh_task_inject E on A.task_id = E.id join sh_media_wasu B on A.media_id = B.id join sh_hotel C on A.hotel_id = C.id join sh_sp D on A.sp_id = D.id where 1=1 ".$where.";";
$where=" and (`name` like '%".$searchValue."%') ";
$where=" and (A.`name` like '%".$searchValue."%') ";
}
if($searchSp){
$where.=" and A.sp_id = $searchSp ";
}
if($searchHotel){
$where.=" and A.hotel_id = $searchHotel ";
}
$model=newModel();
//======================
$fields="count(id) count";
$fields="count(A.id) count";
//返回列表(limit分页)
if($queryType=="list"){
$where.=$sort." ".$limit;
$fields=" *,case `status` when 0 then '未注入' when 1 then '<font color=green>注入成功</font>' when 2 then '<font color=red>注入失败</font>' end as `status` ";
$fields=" A.id,A.addtime,A.updatetime,E.`name` task_name,B.`title` media_name,C.`name` hotel_name,D.`name` sp_name,case A.`status` when 0 then '未知' when 1 then '<font color=green>上线</font>' when 2 then '<font color=red>下线</font>' end as `status` ";
}
$sql="select ".$fields." from sh_task_ctrl_log where 1=1 ".$where.";";
$sql="select ".$fields." from sh_task_ctrl_log A join sh_task_ctrl E on A.task_id = E.id join sh_media_wasu B on A.media_id = B.id join sh_hotel C on A.hotel_id = C.id join sh_sp D on A.sp_id = D.id where 1=1 ".$where.";";