Commit 980ee345 authored by wangjiangze's avatar wangjiangze

优化SP权限,grade>=3

parent b52338d4
......@@ -14,7 +14,7 @@ class FrontAction extends CommonAction{
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$hotelModel = D("Hotel");
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
$hotel_lists = $hotelModel->where("`status`=0")->select();
......@@ -39,7 +39,7 @@ class FrontAction extends CommonAction{
$storage_list = $deviceStorageModel->field("id,`path`,`size`")->where("device_id = $id")->select();
$this->storage_list = $storage_list;
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
$hotel_lists = $hotelModel->where("`status`=0")->select();
......
......@@ -15,7 +15,7 @@ class HotelAction extends CommonAction{
}else{
$spModel = D("Sp");
$regionModel = D("Region");
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
}else{
$sp_lists = $spModel->where("`status`=0")->select();
......@@ -41,7 +41,7 @@ class HotelAction extends CommonAction{
$info =$model->where("id = $id")->find();
$this->info = $info;
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
}else{
$sp_lists = $spModel->where("`status`=0")->select();
......
......@@ -32,7 +32,7 @@ class InjectAction extends CommonAction{
}else{
$hotelModel = D("Hotel");
$spModel = D("Sp");
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
......@@ -62,7 +62,7 @@ class InjectAction extends CommonAction{
$this->info = $info;
}
$media_lists = $mediaModel->field("id,title")->select();
if($userInfo['sp_ids']){
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")->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'].")")->group("A.id")->select();
......
......@@ -15,7 +15,7 @@ class InjectLogAction extends CommonAction{
}else{
$hotelModel = D("Hotel");
$spModel = D("Sp");
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
......
......@@ -15,7 +15,7 @@ class PlayLogAction extends CommonAction{
}else{
$spModel = D("Sp");
$hotelModel = D("Hotel");
if($userInfo['sp_ids']){
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")->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
......
......@@ -15,7 +15,7 @@ class PushLogAction extends CommonAction{
}else{
$spModel = D("Sp");
$hotelModel = D("Hotel");
if($userInfo['sp_ids']){
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")->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
......
......@@ -15,7 +15,7 @@ class HotelAction extends CommonAction{
}else{
$spModel = D("Sp");
$hotelModel = D("Hotel");
if($userInfo['sp_ids']){
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")->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
......
......@@ -14,7 +14,7 @@ class PlaylistAction extends CommonAction{
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$spModel = D("Sp");
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->field("id,`name`")->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
}else{
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->select();
......@@ -40,7 +40,7 @@ class PlaylistAction extends CommonAction{
$this->map_lists = $map_lists;
$this->info = $info;
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->field("id,`name`")->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
$play_lists = $model->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'].")")->group("A.id")->select();
}else{
......
......@@ -32,7 +32,7 @@ class PlayCtrlAction extends CommonAction{
}else{
$hotelModel = D("Hotel");
$spModel = D("Sp");
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
......@@ -66,7 +66,7 @@ class PlayCtrlAction extends CommonAction{
$this->info = $info;
}
$media_lists = $mediaModel->field("id,title")->select();
if($userInfo['sp_ids']){
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();
$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'].")")->group("A.id")->select();
......
......@@ -15,7 +15,7 @@ class PlayCtrlLogAction extends CommonAction{
}else{
$hotelModel = D("Hotel");
$spModel = D("Sp");
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
......
......@@ -32,7 +32,7 @@ class PlayCtrlAction extends CommonAction{
}else{
$hotelModel = D("Hotel");
$spModel = D("Sp");
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
......@@ -66,7 +66,7 @@ class PlayCtrlAction extends CommonAction{
$this->info = $info;
}
$media_lists = $mediaModel->field("id,title")->select();
if($userInfo['sp_ids']){
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();
$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'].")")->group("A.id")->select();
......
......@@ -15,7 +15,7 @@ class PlayCtrlLogAction extends CommonAction{
}else{
$hotelModel = D("Hotel");
$spModel = D("Sp");
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
......
......@@ -14,7 +14,7 @@ class ConfAction extends CommonAction{
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$spModel = D("Sp");
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
}else{
$sp_lists = $spModel->where("`status`=0")->select();
......@@ -36,7 +36,7 @@ class ConfAction extends CommonAction{
$info =$model->where("id = $id")->find();
$this->info = $info;
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
}else{
$sp_lists = $spModel->where("`status`=0")->select();
......
......@@ -22,7 +22,7 @@ class ConfModel extends RelationModel{
$where .= " and A.sp_id = $searchSp ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
......
......@@ -22,7 +22,7 @@ class FrontModel extends RelationModel{
$where .= " and A.hotel_id = $searchHotel ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and B.sp_id in(".$userInfo['sp_ids'].") ";
}
......
......@@ -24,7 +24,7 @@ class HotelMediaMapModel extends RelationModel{
if($searchHotel){
$where .= " and A.hotel_id = $searchHotel ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and C.sp_id in(".$userInfo['sp_ids'].") ";
}
......
......@@ -27,7 +27,7 @@ class HotelModel extends RelationModel{
$where .= " and A.region_id = $searchRegion ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
......
......@@ -32,7 +32,7 @@ class InjectLogModel extends RelationModel{
$where .= " and A.task_id = $searchTaskID ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
......
......@@ -32,7 +32,7 @@ class PlayCtrlLogModel extends RelationModel{
$where .= " and A.task_id = $searchTaskID ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
......
......@@ -25,7 +25,7 @@ class PlayLogModel extends RelationModel{
if($searchHotel){
$where .= " and A.hotel_id = $searchHotel ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
......
......@@ -21,7 +21,7 @@ class PushLogModel extends RelationModel{
$where .= " and A.sp_id = $searchSp ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
......
......@@ -16,7 +16,7 @@ class SpModel extends RelationModel{
if($searchValue){
$where = " and (`name` like '%".$searchValue."%' or `code` like '%".$searchValue."%') ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and id in(".$userInfo['sp_ids'].") ";
}
......
......@@ -22,7 +22,7 @@ class SpPlaylistMediaMapModel extends RelationModel{
$where .= " and A.sp_id = $searchSp ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
......
......@@ -22,7 +22,7 @@ class SpPlaylistModel extends RelationModel{
$where .= " and A.sp_id = $searchSp ";
}
if($userInfo['sp_ids']){
if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment