@@ -400,7 +401,9 @@ class CenterAction extends Action
$end=date('Y-m-d H:i:s',strtotime($_GET["end"]));
}
$sqlTotal="SELECT count(1) total FROM sh_hotel_media_map_$spid WHERE status_inject=1 AND updatetime BETWEEN '$start' AND '$end';";
$sqlTotal="SELECT count(1) total FROM sh_hotel_media_map_$spid WHERE updatetime BETWEEN '$start' AND '$end';";
// echo $sqlTotal;
$totalArr=M("")->query($sqlTotal);
$total=0;
if(count($totalArr)>0){
...
...
@@ -459,7 +462,7 @@ class CenterAction extends Action
$sql="SELECT $fields"
." FROM (SELECT hm.media_id,h.code,hm.status,hm.status_inject FROM sh_hotel_media_map_$spid hm,sh_hotel h"
." WHERE hm.status_inject=1 AND hm.updatetime BETWEEN '$start' AND '$end' AND h.id=hm.hotel_id ORDER BY hm.updatetime,hm.media_id ASC LIMIT $limit_from,$page_size) hm"
." WHERE hm.updatetime BETWEEN '$start' AND '$end' AND h.id=hm.hotel_id ORDER BY hm.updatetime,hm.media_id ASC LIMIT $limit_from,$page_size) hm"
." JOIN sh_media_wasu mw ON mw.id=hm.media_id";
// echo $sql;exit;
...
...
@@ -507,7 +510,7 @@ class CenterAction extends Action
@@ -61,9 +61,9 @@ class InjectAction extends CommonAction{
$info=$model->where("id = $id")->find();
$this->info=$info;
}
$media_lists=$mediaModel->join(" A join sh_sp B on A.site_id = B.site_id ")->field("A.id,A.title,group_concat(B.id) sp_ids")->group(" A.id ")->select();
$media_lists=$mediaModel->join(" A join sh_sp B on A.site_id = B.site_id ")->field("concat(A.id,'_',A.code) id,A.title,group_concat(B.id) sp_ids")->group(" A.id ")->select();
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists=$spModel->field("id,`name`")->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
$sp_lists=$spModel->field("A.id,`name`")->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
$hotel_lists=$hotelModel->field("id,`name`,sp_id")->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->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")->where("A.sp_id in(".$userInfo['sp_ids'].") and A.`status` = 0")->group("A.id")->select();
}else{
...
...
@@ -114,30 +114,29 @@ class InjectAction extends CommonAction{
foreach($media_listsas$k=>$v){
$logData=array();
$mapData=array();
// $isExists = M("Map_$sp_id","sh_hotel_media_")->field("id")->where("media_id = $v and hotel_id= $hotel_id")->find();
// if($isExists){
// continue;
// }
//支持重新注入(注入失败需要重新注入)
$sqlUpdate="update sh_hotel_media_map_$sp_id set status_inject=0 where media_id=$v and hotel_id=$hotel_id";
$uok=M("")->execute($sqlUpdate);
if($uok){
continue;
$tmp=explode("_",$v);
$media_id=$tmp[0];
$media_code=$tmp[1];
$isExists=M("Map_$sp_id","sh_hotel_media_")->field("id")->where("media_id = $media_id and hotel_id= $hotel_id")->find();
@@ -65,7 +65,7 @@ class PlayCtrlAction extends CommonAction{
$this->log_info=$log_info;
$this->info=$info;
}
$media_lists=$mediaModel->join(" A join sh_sp B on A.site_id = B.site_id ")->field("A.id,A.title,group_concat(B.id) sp_ids")->group(" A.id ")->select();
$media_lists=$mediaModel->join(" A join sh_sp B on A.site_id = B.site_id ")->field("concat(A.id,'_',A.code) id,A.title,group_concat(B.id) sp_ids")->group(" A.id ")->select();
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists=$spModel->field("id,`name`")->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
$hotel_lists=$hotelModel->field("id,`name`,sp_id,region_id")->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
...
...
@@ -121,26 +121,24 @@ class PlayCtrlAction extends CommonAction{
foreach($media_listsas$k=>$v){
$logData=array();
$mapData=array();
$isExists=M("Map_$sp_id","sh_hotel_media_")->field("id")->where("media_id = $v and hotel_id= $hotel_id")->find();
$tmp=explode("_",$v);
$media_id=$tmp[0];
$media_code=$tmp[1];
$mapData['media_id']=$media_id;
$mapData['media_code']="$media_code";;
$mapData['hotel_id']=$hotel_id;
$mapData['status']=I("status",1,int);
$isExists=M("Map_$sp_id","sh_hotel_media_")->field("id")->where("media_id = $media_id and hotel_id= $hotel_id")->find();