Commit eaf05089 authored by wangjiangze's avatar wangjiangze

SP权限更新

parent 5763877c
......@@ -36,11 +36,13 @@ class InjectAction extends CommonAction{
if($userInfo['sp_ids']){
$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();
}else{
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->select();
$hotel_lists = $hotelModel->field("id,`name`,sp_id")->where("`status`=0")->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();
}
$this->hotel_lists = $hotel_lists;
$this->sp_lists = $sp_lists;
$this->media_lists_json = json_encode($media_lists);
......
......@@ -51,7 +51,7 @@ class LoginAction extends Action{
RBAC::saveAccessList();
// $this->redirect('System/Log/logList');
if ($userInfo[0]["grade"] == 3) {
$this->redirect('Portal/index');
$this->redirect('Index/index');
} else {
$this->redirect('Index/index');
}
......
......@@ -40,9 +40,15 @@ class PlaylistAction extends CommonAction{
$this->map_lists = $map_lists;
$this->info = $info;
}
$sp_lists = $spModel->field("id,`name`")->select();
$media_lists = $mediaModel->field("id,title")->select();
if($userInfo['sp_ids']){
$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{
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->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")->group("A.id")->select();
}
$media_lists = $mediaModel->field("id,title")->select();
$this->sp_lists = $sp_lists;
$this->media_lists = json_encode($media_lists);
$this->play_lists = $play_lists;
......
......@@ -40,11 +40,13 @@ class PlayCtrlAction extends CommonAction{
if($userInfo['sp_ids']){
$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();
}else{
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->select();
$hotel_lists = $hotelModel->field("id,`name`,sp_id,region_id")->where("`status`=0")->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();
}
$region_lists = $regionModel->where("`level` < 4 and pid < 999999")->select();
$this->region_lists = $region_lists;
$this->hotel_lists = $hotel_lists;
......
......@@ -40,11 +40,13 @@ class PlayCtrlAction extends CommonAction{
if($userInfo['sp_ids']){
$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();
}else{
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->select();
$hotel_lists = $hotelModel->field("id,`name`,sp_id,region_id")->where("`status`=0")->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();
}
$region_lists = $regionModel->where("`level` < 4 and pid < 999999")->select();
$this->region_lists = $region_lists;
$this->hotel_lists = $hotel_lists;
......
......@@ -19,7 +19,11 @@ class SpPlaylistMediaMapModel extends RelationModel{
}
if($searchSp){
$where = " and A.sp_id = $searchSp ";
$where .= " and A.sp_id = $searchSp ";
}
if($userInfo['sp_ids']){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
......
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