Commit 56e7af0a authored by 吴贤德's avatar 吴贤德

后台:媒资注入、播控管理增加sp_id关联及页面相关修改

parent 5ac82f03
......@@ -4,6 +4,7 @@ class InjectAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("Inject");
$userInfo = $_SESSION["_USER_INFO"];
......@@ -13,6 +14,13 @@ class InjectAction extends CommonAction{
$total = $count[0]["count"];
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$spModel = D("Sp");
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();
}
$this->sp_lists = $sp_lists;
$this->display();
}
}
......@@ -100,6 +108,7 @@ class InjectAction extends CommonAction{
echo 'false';
}
}else{
$taskData['sp_id'] = I("sp");
$taskData['name'] = I("name");
$taskData['addtime'] = date('Y-m-d H:i:s');
$taskData['remark'] = I("remark");
......
......@@ -4,6 +4,7 @@ class PlayCtrlAction extends CommonAction{
//管理
public function index(){
$op = I('op');
$userInfo = $_SESSION["_USER_INFO"];
if($op=="getjson"){
$model = D("PlayCtrl");
$userInfo = $_SESSION["_USER_INFO"];
......@@ -13,6 +14,13 @@ class PlayCtrlAction extends CommonAction{
$total = $count[0]["count"];
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{
$spModel = D("Sp");
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();
}
$this->sp_lists = $sp_lists;
$this->display();
}
}
......@@ -106,6 +114,7 @@ class PlayCtrlAction extends CommonAction{
echo 'false';
}
}else{
$taskData['sp_id'] = I("sp");
$taskData['name'] = I("name");
$taskData['addtime'] = date('Y-m-d H:i:s');
$taskData['remark'] = I("remark");
......
......@@ -13,9 +13,12 @@ class InjectModel extends RelationModel{
$searchField = $inputs["searchField"]?$inputs["searchField"]:'name';
$searchValue = $inputs["searchValue"]?$inputs["searchValue"]:'';
$searchSp = $inputs["searchSp"]?$inputs["searchSp"]:0;
if ($searchSp){
$where = " and t.sp_id=$searchSp ";
}
if($searchValue){
$where = " and (`name` like '%".$searchValue."%') ";
$where .= " and (t.`name` like '%".$searchValue."%') ";
}
$model = new Model();
......@@ -25,9 +28,11 @@ class InjectModel extends RelationModel{
//返回列表(limit分页)
if($queryType=="list"){
$where .= $sort." ".$limit;
$fields = " *,case `status` when 0 then '未注入' when 1 then '<font color=green>注入成功</font>' when 2 then '<font color=red>注入失败</font>' end as `status` ";
$fields = " t.*,s.name sp_name,case t.`status` when 0 then '未注入'
when 1 then '<font color=green>注入成功</font>'
when 2 then '<font color=red>注入失败</font>' end as `status` ";
}
$sql = "select ".$fields." from sh_task_inject where 1=1 ".$where.";";
$sql = "select ".$fields." from sh_task_inject t,sh_sp s where 1=1 and t.sp_id=s.id ".$where.";";
// echo $sql;
return $model->query($sql);
}
......
......@@ -13,9 +13,12 @@ class PlayCtrlModel extends RelationModel{
$searchField = $inputs["searchField"]?$inputs["searchField"]:'name';
$searchValue = $inputs["searchValue"]?$inputs["searchValue"]:'';
$searchSp = $inputs["searchSp"]?$inputs["searchSp"]:0;
if ($searchSp){
$where = " and t.sp_id=$searchSp ";
}
if($searchValue){
$where = " and (`name` like '%".$searchValue."%') ";
$where .= " and (t.`name` like '%".$searchValue."%') ";
}
$model = new Model();
......@@ -25,9 +28,11 @@ class PlayCtrlModel extends RelationModel{
//返回列表(limit分页)
if($queryType=="list"){
$where .= $sort." ".$limit;
$fields = " *,case `status` when 0 then '<font color=red>删除</font>' when 1 then '<font color=green>上线</font>' when 2 then '<font color=red>下线</font>' end as `status` ";
$fields = " t.*,s.name sp_name,case t.`status` when 0 then '<font color=red>删除</font>'
when 1 then '<font color=green>上线</font>'
when 2 then '<font color=red>下线</font>' end as `status` ";
}
$sql = "select ".$fields." from sh_task_ctrl where 1=1 ".$where.";";
$sql = "select ".$fields." from sh_task_ctrl t,sh_sp s where 1=1 and t.sp_id=s.id ".$where.";";
// echo $sql;
return $model->query($sql);
}
......
......@@ -23,6 +23,12 @@
<form name="searchform" method="post" action="" id ="searchform">
<input type="hidden" name="op" value="getjson">
<div class="inputBox">
<select class="select" name="searchSp">
<option value="0">合作方</option>
<volist name="sp_lists" id="item">
<option value="{$item.id}">{$item.name}</option>
</volist>
</select>
<input class="input" type="text" placeholder="任务名称" name="searchValue">
</div>
<input id="submit_search" name="" type="button" value="查询" class="btn_go_s btn_orange" />
......@@ -52,6 +58,7 @@ onRowContextMenu : onRowContextMenu
<thead>
<tr>
<th data-options="field:'name',width:100" sortable="true">任务名称</th>
<th data-options="field:'sp_name',width:40" align="center" sortable="true">合作方</th>
<th data-options="field:'addtime',width:30" sortable="true">创建时间</th>
<th data-options="field:'updatetime',width:30" sortable="true">更新时间</th>
<th data-options="field:'remark',width:30" sortable="true">备注</th>
......
......@@ -23,6 +23,12 @@
<form name="searchform" method="post" action="" id ="searchform">
<input type="hidden" name="op" value="getjson">
<div class="inputBox">
<select class="select" name="searchSp">
<option value="0">合作方</option>
<volist name="sp_lists" id="item">
<option value="{$item.id}">{$item.name}</option>
</volist>
</select>
<input class="input" type="text" placeholder="播控名称" name="searchValue">
</div>
<input id="submit_search" name="" type="button" value="查询" class="btn_go_s btn_orange" />
......@@ -52,6 +58,7 @@ onRowContextMenu : onRowContextMenu
<thead>
<tr>
<th data-options="field:'name',width:100" sortable="true">播控名称</th>
<th data-options="field:'sp_name',width:40" align="center" sortable="true">合作方</th>
<th data-options="field:'addtime',width:30" sortable="true">创建时间</th>
<th data-options="field:'updatetime',width:30" sortable="true">更新时间</th>
<th data-options="field:'status'" sortable="true" align="center">状态</th>
......
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