Commit 0f2907c0 authored by wangjiangze's avatar wangjiangze

播控、播单更新

parent 5bc61f4e
......@@ -27,10 +27,13 @@ class PlaylistAction extends CommonAction{
$model = D("SpPlaylist");
$spModel = D("Sp");
$mapModel = D("SpPlaylistMediaMap");
$mediaModel = D("Media");
if($id){
$info =$model->where("id = $id")->find();
$map_lists = $mapModel->field("B.id,B.`title`")->join(" A join sh_media_wasu B on A.media_id = B.id ")->where("playlist_id = $id")->select();
$this->map_lists = $map_lists;
$this->info = $info;
}
$sp_lists = $spModel->field("id,`name`")->select();
......
......@@ -31,9 +31,12 @@ class PlayCtrlAction extends CommonAction{
$hotelModel = D("Hotel");
$spPlaylistModel = D("SpPlaylist");
$regionModel = D("Region");
$logModel = D("PlayCtrlLog");
if($id){
$info =$model->where("id = $id")->find();
$log_info = $logModel->field("group_concat(hotel_id) hotel_ids,group_concat(media_id) media_ids")->where("task_id = $id")->find();
$this->log_info = $log_info;
$this->info = $info;
}
$hotel_lists = $hotelModel->field("id,`name`,sp_id,region_id")->where("`status`=0")->select();
......
......@@ -31,9 +31,12 @@ class PlayCtrlAction extends CommonAction{
$hotelModel = D("Hotel");
$spPlaylistModel = D("SpPlaylist");
$regionModel = D("Region");
$logModel = D("PlayCtrlLog");
if($id){
$info =$model->where("id = $id")->find();
$log_info = $logModel->field("group_concat(hotel_id) hotel_ids,group_concat(media_id) media_ids")->where("task_id = $id")->find();
$this->log_info = $log_info;
$this->info = $info;
}
$hotel_lists = $hotelModel->field("id,`name`,sp_id,region_id")->where("`status`=0")->select();
......
......@@ -14,6 +14,11 @@ class UserAction extends CommonAction{
$otherDeviceGroupOwnerList=$myDeviceGroupOwnerList;
$bizUserList=D("BizUser")->select();
}
$spModel = D("Sp");
$sp_lists = $spModel->where("`status`=0")->select();
$this->sp_lists = $sp_lists;
$id = I('id','',int);
if($id){
$userModel = D("User");
......@@ -62,6 +67,7 @@ class UserAction extends CommonAction{
$user["grade"]=$roleInfo["grade"];//用户等级与所选角色等级一致
//dump($user);exit;
$uid = $_POST['id'];
$sp_id = $_POST['sp_id']; //表sh_sp_user_map绑定
if($uid){
$user["id"]=$uid;
$user["update_time"]=time();
......
......@@ -29,7 +29,7 @@ class SpPlaylistModel extends RelationModel{
//返回列表(limit分页)
if($queryType=="list"){
$where .= $sort." ".$limit;
$fields = " A.`name`,A.addtime,A.updatetime,B.`name` sp_name,case A.`status` when 0 then '<font color=green>正常</font>' when 1 then '<font color=red>禁用</font>' when 2 then '<font color=red>删除</font>' end as `status` ";
$fields = " A.id,A.`name`,A.addtime,A.updatetime,B.`name` sp_name,case A.`status` when 0 then '<font color=green>正常</font>' when 1 then '<font color=red>禁用</font>' when 2 then '<font color=red>删除</font>' end as `status` ";
}
$sql = "select ".$fields." from sh_sp_playlist A join sh_sp B on A.sp_id = B.id where 1=1 ".$where.";";
// echo $sql;
......
......@@ -176,6 +176,14 @@ $().ready(function(){
});
}
});
<if condition="$info">
$("select[name='sp_id']").find("option[value='{$info.sp_id}']").attr("selected",true);
<volist name="map_lists" id="item">
$("#multiselectMedia_to").append("<option value='{$item.id}'>{$item.title}</option>");
</volist>
</if>
});
</script>
</body>
......
......@@ -185,7 +185,7 @@ $().ready(function(){
$("#multiselect").empty();
if(spid>0&&regionid==0){
$.each(eval(hotel_json),function(i,item){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"']").length==0){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"-"+item.sp_id+"']").length==0){
if(item.sp_id==spid){
$("#multiselect").append("<option value='"+item.id+"-"+item.sp_id+"' sp_id='"+item.sp_id+"' title='"+item.name+"'>"+item.name+"</option>");
}
......@@ -194,7 +194,7 @@ $().ready(function(){
return;
}else if(spid==0&&regionid>0){
$.each(eval(hotel_json),function(i,item){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"']").length==0){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"-"+item.sp_id+"']").length==0){
if(item.region_id==regionid){
$("#multiselect").append("<option value='"+item.id+"-"+item.sp_id+"' sp_id='"+item.sp_id+"' title='"+item.name+"'>"+item.name+"</option>");
}
......@@ -203,7 +203,7 @@ $().ready(function(){
return;
}else if(spid>0&&regionid>0){
$.each(eval(hotel_json),function(i,item){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"']").length==0){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"-"+item.sp_id+"']").length==0){
if(item.sp_id==spid&&item.region_id==regionid){
$("#multiselect").append("<option value='"+item.id+"-"+item.sp_id+"' sp_id='"+item.sp_id+"' title='"+item.name+"'>"+item.name+"</option>");
}
......@@ -212,7 +212,7 @@ $().ready(function(){
return;
}
$.each(eval(hotel_json),function(i,item){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"']").length==0){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"-"+item.sp_id+"']").length==0){
$("#multiselect").append("<option value='"+item.id+"-"+item.sp_id+"' sp_id='"+item.sp_id+"' title='"+item.name+"'>"+item.name+"</option>");
}
});
......@@ -256,6 +256,21 @@ $().ready(function(){
});
}
});
<if condition="$info">
$.each(eval(media_json),function(i,item){
//console.log(tmp_ids_arr.indexOf(item.id));
if("{$log_info.media_ids}".indexOf(item.id)>=0){
$("select[name='media_lists[]']").append("<option value='"+item.id+"'>"+item.title+"</option>");
}
});
$.each(eval(hotel_json),function(i,item){
if("{$log_info.hotel_ids}".indexOf(item.id)>=0){
$("select[name='hotel_lists[]']").append("<option value='"+item.id+"-"+item.sp_id+"' sp_id='"+item.sp_id+"' title='"+item.name+"'>"+item.name+"</option>");
}
});
$("select[name='sp']").trigger("change");
</if>
});
</script>
</body>
......
......@@ -185,7 +185,7 @@ $().ready(function(){
$("#multiselect").empty();
if(spid>0&&regionid==0){
$.each(eval(hotel_json),function(i,item){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"']").length==0){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"-"+item.sp_id+"']").length==0){
if(item.sp_id==spid){
$("#multiselect").append("<option value='"+item.id+"-"+item.sp_id+"' sp_id='"+item.sp_id+"' title='"+item.name+"'>"+item.name+"</option>");
}
......@@ -194,7 +194,7 @@ $().ready(function(){
return;
}else if(spid==0&&regionid>0){
$.each(eval(hotel_json),function(i,item){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"']").length==0){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"-"+item.sp_id+"']").length==0){
if(item.region_id==regionid){
$("#multiselect").append("<option value='"+item.id+"-"+item.sp_id+"' sp_id='"+item.sp_id+"' title='"+item.name+"'>"+item.name+"</option>");
}
......@@ -203,7 +203,7 @@ $().ready(function(){
return;
}else if(spid>0&&regionid>0){
$.each(eval(hotel_json),function(i,item){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"']").length==0){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"-"+item.sp_id+"']").length==0){
if(item.sp_id==spid&&item.region_id==regionid){
$("#multiselect").append("<option value='"+item.id+"-"+item.sp_id+"' sp_id='"+item.sp_id+"' title='"+item.name+"'>"+item.name+"</option>");
}
......@@ -212,7 +212,7 @@ $().ready(function(){
return;
}
$.each(eval(hotel_json),function(i,item){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"']").length==0){
if($("select[name='hotel_lists[]'] option[value='"+item.id+"-"+item.sp_id+"']").length==0){
$("#multiselect").append("<option value='"+item.id+"-"+item.sp_id+"' sp_id='"+item.sp_id+"' title='"+item.name+"'>"+item.name+"</option>");
}
});
......@@ -256,6 +256,21 @@ $().ready(function(){
});
}
});
<if condition="$info">
$.each(eval(media_json),function(i,item){
//console.log(tmp_ids_arr.indexOf(item.id));
if("{$log_info.media_ids}".indexOf(item.id)>=0){
$("select[name='media_lists[]']").append("<option value='"+item.id+"'>"+item.title+"</option>");
}
});
$.each(eval(hotel_json),function(i,item){
if("{$log_info.hotel_ids}".indexOf(item.id)>=0){
$("select[name='hotel_lists[]']").append("<option value='"+item.id+"-"+item.sp_id+"' sp_id='"+item.sp_id+"' title='"+item.name+"'>"+item.name+"</option>");
}
});
$("select[name='sp']").trigger("change");
</if>
});
</script>
</body>
......
......@@ -94,41 +94,23 @@ $().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="my_vdgo_id" class="select_s">-->
<!--<volist id="owner" name="myDeviceGroupOwnerList">-->
<!--<option value="{$owner.VDGO_ID}" {$owner.selected}>{$owner.VDGO_NAME}</option>-->
<!--</volist>-->
<!--</select>-->
<!--</div>-->
<!--<div><label class="float_l label_s" style="min-width:120px!important">其他网络服务商:</label>-->
<!--<div class="float_l">-->
<!--<select id="other_vdgo_ids" name="other_vdgo_ids[]" size="10" multiple="multiple">-->
<!--<volist id="owner" name="otherDeviceGroupOwnerList">-->
<!--<option value="{$owner.VDGO_ID}" {$owner.selected}>{$owner.VDGO_NAME}</option>-->
<!--</volist>-->
<!--</select>-->
<!--</div>-->
<!--</div>-->
<!--<div><label class="float_l label_s" style="min-width:120px!important">业务:</label>-->
<!--<div class="float_l">-->
<!--<select id="biz_list" name="biz_list[]" size="10" multiple="multiple">-->
<!--<volist id="biz" name="bizUserList">-->
<!--<option value="{$biz.VBU_ACCOUNTS}" {$biz.selected}>{$biz.VBU_NAME}</option>-->
<!--</volist>-->
<!--</select>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</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