Commit 5763877c authored by wangjiangze's avatar wangjiangze

绑定SP权限调整

parent ceeca4be
......@@ -4,9 +4,9 @@ class FrontAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("Front");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
......@@ -14,7 +14,11 @@ class FrontAction extends CommonAction{
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$hotelModel = D("Hotel");
$hotel_lists = $hotelModel->where("`status`=0")->select();
if($userInfo['sp_ids']){
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
$hotel_lists = $hotelModel->where("`status`=0")->select();
}
$this->hotel_lists = $hotel_lists;
$this->display();
}
......@@ -35,7 +39,11 @@ class FrontAction extends CommonAction{
$storage_list = $deviceStorageModel->field("id,`path`,`size`")->where("device_id = $id")->select();
$this->storage_list = $storage_list;
}
$hotel_lists = $hotelModel->where("`status`=0")->select();
if($userInfo['sp_ids']){
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
}else{
$hotel_lists = $hotelModel->where("`status`=0")->select();
}
$this->code = GetfourStr(8);
$this->hotel_lists = $hotel_lists;
$this->display();
......
......@@ -4,9 +4,9 @@ class HotelAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("Hotel");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
......@@ -15,7 +15,12 @@ class HotelAction extends CommonAction{
}else{
$spModel = D("Sp");
$regionModel = D("Region");
$sp_lists = $spModel->where("`status`=0")->select();
if($userInfo['sp_ids']){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
}else{
$sp_lists = $spModel->where("`status`=0")->select();
}
$region_lists = $regionModel->where("`level` < 4 and pid < 999999")->select();
$this->region_lists = $region_lists;
$this->sp_lists = $sp_lists;
......@@ -36,7 +41,11 @@ class HotelAction extends CommonAction{
$info =$model->where("id = $id")->find();
$this->info = $info;
}
$sp_lists = $spModel->where("`status`=0")->select();
if($userInfo['sp_ids']){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
}else{
$sp_lists = $spModel->where("`status`=0")->select();
}
$region_lists = $regionModel->where("pid = 1 and level = 2 and `status`=0")->select();
$region_city_lists = $regionModel->where("pid > 1 and level = 3 and `status`=0")->select();
$this->sp_lists = $sp_lists;
......
......@@ -13,9 +13,6 @@ class InjectAction extends CommonAction{
$total = $count[0]["count"];
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$hotelModel = D("Hotel");
$hotel_lists = $hotelModel->where("`status`=0")->select();
$this->hotel_lists = $hotel_lists;
$this->display();
}
}
......@@ -35,9 +32,14 @@ class InjectAction extends CommonAction{
$info =$model->where("id = $id")->find();
$this->info = $info;
}
$hotel_lists = $hotelModel->where("`status`=0")->select();
$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();
$hotel_lists = $hotelModel->field("id,`name`,sp_id")->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->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;
......
......@@ -4,9 +4,9 @@ class InjectLogAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("InjectLog");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
......@@ -15,8 +15,13 @@ class InjectLogAction extends CommonAction{
}else{
$hotelModel = D("Hotel");
$spModel = D("Sp");
$hotel_lists = $hotelModel->where("`status`=0")->select();
$sp_lists = $spModel->where("`status`=0")->select();
if($userInfo['sp_ids']){
$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{
$sp_lists = $spModel->where("`status`=0")->select();
$hotel_lists = $hotelModel->where("`status`=0")->select();
}
$this->hotel_lists = $hotel_lists;
$this->sp_lists = $sp_lists;
$this->display();
......
......@@ -4,9 +4,9 @@ class PlayLogAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("PlayLog");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
......@@ -15,8 +15,13 @@ class PlayLogAction extends CommonAction{
}else{
$spModel = D("Sp");
$hotelModel = D("Hotel");
$sp_lists = $spModel->where("`status`=0")->select();
$hotel_lists = $hotelModel->where("`status`=0")->select();
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();
}else{
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->select();
$hotel_lists = $hotelModel->field("id,`name`,sp_id")->where("`status`=0")->select();
}
$this->sp_lists = $sp_lists;
$this->hotel_lists = $hotel_lists;
$this->display();
......
......@@ -4,9 +4,9 @@ class PushLogAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("PushLog");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
......@@ -14,7 +14,14 @@ class PushLogAction extends CommonAction{
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$spModel = D("Sp");
$sp_lists = $spModel->where("`status`=0")->select();
$hotelModel = D("Hotel");
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();
}else{
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->select();
$hotel_lists = $hotelModel->field("id,`name`,sp_id")->where("`status`=0")->select();
}
$this->sp_lists = $sp_lists;
$this->display();
}
......
......@@ -4,9 +4,9 @@ class HotelAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("HotelMediaMap");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
......@@ -15,8 +15,13 @@ class HotelAction extends CommonAction{
}else{
$spModel = D("Sp");
$hotelModel = D("Hotel");
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->select();
$hotel_lists = $hotelModel->field("id,`name`,sp_id")->where("`status`=0")->select();
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();
}else{
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->select();
$hotel_lists = $hotelModel->field("id,`name`,sp_id")->where("`status`=0")->select();
}
$this->sp_lists = $sp_lists;
$this->hotel_lists = $hotel_lists;
$this->display();
......
......@@ -4,9 +4,9 @@ class PlaylistAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("SpPlaylist");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
......@@ -14,7 +14,11 @@ class PlaylistAction extends CommonAction{
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$spModel = D("Sp");
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->select();
if($userInfo['sp_ids']){
$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();
}
$this->sp_lists = $sp_lists;
$this->display();
}
......
......@@ -13,9 +13,6 @@ class PlayCtrlAction extends CommonAction{
$total = $count[0]["count"];
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$hotelModel = D("Hotel");
$hotel_lists = $hotelModel->where("`status`=0")->select();
$this->hotel_lists = $hotel_lists;
$this->display();
}
}
......@@ -39,9 +36,14 @@ class PlayCtrlAction extends CommonAction{
$this->log_info = $log_info;
$this->info = $info;
}
$hotel_lists = $hotelModel->field("id,`name`,sp_id,region_id")->where("`status`=0")->select();
$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();
$hotel_lists = $hotelModel->field("id,`name`,sp_id,region_id")->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->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;
......
......@@ -4,9 +4,9 @@ class PlayCtrlLogAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("PlayCtrlLog");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
......@@ -15,8 +15,13 @@ class PlayCtrlLogAction extends CommonAction{
}else{
$hotelModel = D("Hotel");
$spModel = D("Sp");
$hotel_lists = $hotelModel->where("`status`=0")->select();
$sp_lists = $spModel->where("`status`=0")->select();
if($userInfo['sp_ids']){
$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{
$sp_lists = $spModel->where("`status`=0")->select();
$hotel_lists = $hotelModel->where("`status`=0")->select();
}
$this->hotel_lists = $hotel_lists;
$this->sp_lists = $sp_lists;
$this->display();
......
......@@ -13,9 +13,6 @@ class PlayCtrlAction extends CommonAction{
$total = $count[0]["count"];
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$hotelModel = D("Hotel");
$hotel_lists = $hotelModel->where("`status`=0")->select();
$this->hotel_lists = $hotel_lists;
$this->display();
}
}
......@@ -39,9 +36,14 @@ class PlayCtrlAction extends CommonAction{
$this->log_info = $log_info;
$this->info = $info;
}
$hotel_lists = $hotelModel->field("id,`name`,sp_id,region_id")->where("`status`=0")->select();
$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();
$hotel_lists = $hotelModel->field("id,`name`,sp_id,region_id")->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->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;
......
......@@ -4,9 +4,9 @@ class PlayCtrlLogAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("PlayCtrlLog");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
......@@ -15,8 +15,13 @@ class PlayCtrlLogAction extends CommonAction{
}else{
$hotelModel = D("Hotel");
$spModel = D("Sp");
$hotel_lists = $hotelModel->where("`status`=0")->select();
$sp_lists = $spModel->where("`status`=0")->select();
if($userInfo['sp_ids']){
$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{
$sp_lists = $spModel->where("`status`=0")->select();
$hotel_lists = $hotelModel->where("`status`=0")->select();
}
$this->hotel_lists = $hotel_lists;
$this->sp_lists = $sp_lists;
$this->display();
......
......@@ -4,9 +4,9 @@ class ConfAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("Conf");
$userInfo = $_SESSION["_USER_INFO"];
$inputs = I();
$list = $model->getList("list",$userInfo,$inputs);
$count = $model->getList("count",$userInfo,$inputs);
......@@ -14,7 +14,11 @@ class ConfAction extends CommonAction{
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$spModel = D("Sp");
$sp_lists = $spModel->where("`status`=0")->select();
if($userInfo['sp_ids']){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
}else{
$sp_lists = $spModel->where("`status`=0")->select();
}
$this->sp_lists = $sp_lists;
$this->display();
}
......@@ -32,7 +36,11 @@ class ConfAction extends CommonAction{
$info =$model->where("id = $id")->find();
$this->info = $info;
}
$sp_lists = $spModel->where("`status`=0")->select();
if($userInfo['sp_ids']){
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
}else{
$sp_lists = $spModel->where("`status`=0")->select();
}
$this->sp_lists = $sp_lists;
$this->display();
}
......
......@@ -16,15 +16,15 @@ class UserAction extends CommonAction{
}
$spModel = D("Sp");
$sp_lists = $spModel->where("`status`=0")->select();
$this->sp_lists = $sp_lists;
$sp_lists = $spModel->field("id,`name`")->where("`status`=0")->select();
$id = I('id','',int);
if($id){
$userModel = D("User");
$user=$userModel->getUserInfo($id);
$user=$user[0];
$sp_lists = $spModel->field("A.id,A.`name`,if(B.`status`=0,'true',null) as selected")->join("A left join sh_sp_user_map B on A.id = B.sp_id and B.user_id = $id")->where("A.`status`=0")->select();
foreach ($role as $key=>$value){
if($role[$key]['id']==$user['role_id'])
$role[$key]['selected']='selected';
......@@ -44,6 +44,7 @@ class UserAction extends CommonAction{
$bizUserList[$key]['selected']='selected';
}
}
$this->sp_lists = $sp_lists;
$this->assign('user',$user);
$this->assign('role',$role);
$this->assign('myDeviceGroupOwnerList',$myDeviceGroupOwnerList);
......@@ -54,6 +55,7 @@ class UserAction extends CommonAction{
public function addUserHandle(){
$UserModel = D("User");
$RoleUserModel = D("RoleUser");
$SpUserMapModel = D("SpUserMap");
$user["account"]=$_POST["account"];
$user["password"]=I("password","","md5");//
$user["nickname"]=$_POST["nickname"];
......@@ -67,10 +69,18 @@ class UserAction extends CommonAction{
$user["grade"]=$roleInfo["grade"];//用户等级与所选角色等级一致
//dump($user);exit;
$uid = $_POST['id'];
$sp_id = $_POST['sp_id']; //表sh_sp_user_map绑定
$sp_ids = $_POST['sp_id']; //表sh_sp_user_map绑定
if($uid){
$user["id"]=$uid;
$user["update_time"]=time();
$user["update_time"]=time();
$SpUserMapModel->where("user_id = $uid")->delete();
if($sp_ids){
$mapData = array();
foreach($sp_ids as $key=>$value){
$mapData[] = array("user_id"=>$uid,"sp_id"=>$value,"status"=>0,"addtime"=>date("Y-m-d H:i:s"));
}
$SpUserMapModel->addAll($mapData);
}
unset($user['account']);
unset($user['password']);
if($UserModel->save($user)){
......@@ -95,6 +105,16 @@ class UserAction extends CommonAction{
$user["remark"]='';
$uid = $UserModel->add($user);
$SpUserMapModel->where("user_id = $uid")->delete();
if($sp_ids){
$mapData = array();
foreach($sp_ids as $key=>$value){
$mapData[] = array("user_id"=>$uid,"sp_id"=>$value,"status"=>0,"addtime"=>date("Y-m-d H:i:s"));
}
$SpUserMapModel->addAll($mapData);
}
if($uid){
$role["role_id"]=I("role_id","",int);
$role["user_id"]=$uid;
......
......@@ -21,6 +21,10 @@ class ConfModel extends RelationModel{
if($searchSp){
$where .= " and A.sp_id = $searchSp ";
}
if($userInfo['sp_ids']){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
......
......@@ -21,6 +21,10 @@ class FrontModel extends RelationModel{
if($searchHotel){
$where .= " and A.hotel_id = $searchHotel ";
}
if($userInfo['sp_ids']){
$where .= " and B.sp_id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
......
......@@ -24,6 +24,9 @@ class HotelMediaMapModel extends RelationModel{
if($searchHotel){
$where .= " and A.hotel_id = $searchHotel ";
}
if($userInfo['sp_ids']){
$where .= " and C.sp_id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
......
......@@ -26,6 +26,10 @@ class HotelModel extends RelationModel{
if($searchRegion){
$where .= " and A.region_id = $searchRegion ";
}
if($userInfo['sp_ids']){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
......
......@@ -26,6 +26,10 @@ class InjectLogModel extends RelationModel{
if($searchHotel){
$where .= " and A.hotel_id = $searchHotel ";
}
if($userInfo['sp_ids']){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
......
......@@ -26,6 +26,10 @@ class PlayCtrlLogModel extends RelationModel{
if($searchHotel){
$where .= " and A.hotel_id = $searchHotel ";
}
if($userInfo['sp_ids']){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
......
......@@ -25,7 +25,9 @@ class PlayLogModel extends RelationModel{
if($searchHotel){
$where .= " and A.hotel_id = $searchHotel ";
}
if($userInfo['sp_ids']){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
//======================
......
......@@ -20,6 +20,10 @@ class PushLogModel extends RelationModel{
if($searchSp){
$where .= " and A.sp_id = $searchSp ";
}
if($userInfo['sp_ids']){
$where .= " and A.sp_id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
......
......@@ -16,7 +16,9 @@ class SpModel extends RelationModel{
if($searchValue){
$where = " and (`name` like '%".$searchValue."%' or `code` like '%".$searchValue."%') ";
}
if($userInfo['sp_ids']){
$where .= " and id in(".$userInfo['sp_ids'].") ";
}
$model = new Model();
......
......@@ -19,7 +19,11 @@ class SpPlaylistModel 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();
......
<?php
class SpUserMapModel extends RelationModel{
protected $tableName = 'sh_sp_user_map'; //重新定义表名
}
\ No newline at end of file
......@@ -12,7 +12,8 @@ class UserModel extends RelationModel{
)
);
public function getUserInfo($id){
$sql="select vru.*,vrru.role_id from rbac_user vru,rbac_role_user vrru where vru.id=".$id." and vrru.user_id=vru.id";
// $sql="select vru.*,vrru.role_id from rbac_user vru,rbac_role_user vrru where vru.id=".$id." and vrru.user_id=vru.id"; //WJZ 20190729 注释
$sql = "select A.*,GROUP_CONCAT(ssum.sp_id) sp_ids from (select vru.*,vrru.role_id from rbac_user vru,rbac_role_user vrru where vru.id=".$id." and vrru.user_id=vru.id)A left join sh_sp_user_map ssum on A.id = ssum.user_id";
$model = new Model();
return $model->query($sql);
}
......
......@@ -42,12 +42,12 @@
</form>
</div><!--hyperchanne end-->
<div class="">
<ul class="operationBox">
<!-- <ul class="operationBox">
<li class="add">
<a href="javascript:;" onclick="add()" class="on"><span></span>新增</a>
</li>
</ul>
</ul>-->
</div><!--mainBox end-->
</div>
</div>
......
......@@ -42,12 +42,12 @@
</form>
</div><!--hyperchanne end-->
<div class="">
<ul class="operationBox">
<!-- <ul class="operationBox">
<li class="add">
<a href="javascript:;" onclick="add()" class="on"><span></span>新增</a>
</li>
</ul>
</ul>-->
</div><!--mainBox end-->
</div>
</div>
......
......@@ -42,12 +42,12 @@
</form>
</div><!--hyperchanne end-->
<div class="">
<ul class="operationBox">
<!-- <ul class="operationBox">
<li class="add">
<a href="javascript:;" onclick="add()" class="on"><span></span>新增</a>
</li>
</ul>
</ul>-->
</div><!--mainBox end-->
</div>
</div>
......
......@@ -86,6 +86,10 @@ $().ready(function(){
</volist>
</select>
</div>
<div><label class="label_s">绑定合作方:</label>
<select name="sp_id[]" class="easyui-combobox" style="width:100%;" data-options='multiple:true,panelHeight:"auto",valueField:"id",textField:"name",data:{$sp_lists|json_encode}'>
</select>
</div>
<div><label class="label_s">是否启用:</label>
<span class="padding_t"><input type="radio" name="status" value="0">禁用</input>&nbsp;&nbsp;
<input type="radio" name="status" value="1" checked="checked">启用</input></span>
......@@ -94,23 +98,6 @@ $().ready(function(){
</div>
</div>
</div>
<!-- <div title="合作方绑定">
<div class="popPage">
<div class="box">
<div class="wrap">
<div class="clearfix">
<div><label class="label_s" style="min-width:120px!important">所属合作方:</label>
<select name="sp_id" class="easyui-combobox" style="width:100%;" data-options="multiple:true,panelHeight:'auto'">
<volist name="sp_lists" id="item">
<option value="{$item.id}">{$item.name}</option>
</volist>
</select>
</div>
</div>
</div>
</div>
</div>
</div>-->
</div>
<div class="btnBox">
<!-- <a class="easyui-linkbutton" data-options="iconCls:'icon-save'" href="javascript:;" onclick="submitForm()">保存</a> -->
......
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