You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
3.3 KiB
PHTML

<?php
// 公司关系绑定
namespace Admin\Controller;
class CompanyRelationController extends AdminController
{
public $admininfo;
public $DBModel;
public $DBlogModel;
public $OpAuthList=[];
public $Status = [
"-2"=>"管理员拒绝",
"-1"=>"市场部拒绝",
"0"=>"待审核",
"1"=>"市场部通过",
"2"=>"管理员通过"
];
public $CompanyType = [
"0"=>"己方公司",
"1"=>"上游cp公司",
"2"=>"联运下游渠道公司"
];
public function _initialize()
{
$this->admininfo = $_SESSION['onethink_admin']['user_auth'];
$this->DBlogModel = M("company_relation_log","tab_");
$this->DBModel = M("company_relation","tab_");
parent::_initialize();
}
//生效列表
public function index()
{
}
//审核列表
public function lists()
{
$this->display();
}
public function marketAgree(){
}
public function marketRefuse(){
}
public function adminRefuse(){
}
//管理员成功
public function adminAgree(){
}
public function addRelation()
{
$this->assign('companyType',$this->CompanyType);
$this->display();
}
public function editRelation()
{
}
public function delRelation()
{
}
public function menuAuth()
{
$addurl = U("addRelation");
$mentBtn = [
"addRelation"=>"<a class='butn' href='{$addurl}'>新增推广游戏分成</a>",
"marketAgree"=>"<a class='butn' id='marketAgree'>市场部审批通过</a>",
"marketRefuse"=>"<a class='butn' id='marketRefuse' style='background-color: red;'>市场部审核拒绝</a>",
"adminAgree"=>"<a class='butn' id='adminAgree'>管理员审核通过</a>",
"adminRefuse"=>"<a class='butn' id='marketRefuse' style='background-color: red;'>管理员审核拒绝</a>"
];
$resarr = [];
foreach ($mentBtn as $k => $v) {
if(IS_ROOT){
$resarr[] = $v;
}else{
if(in_array($k,$this->OpAuthList)){
$resarr[] = $v;
}
}
}
return $resarr;
}
public function OpAuth($info)
{
$id = $info['id'];
//原始列表
$opBtn = [
"editRelation"=>"<a class='confirm editRelation' data-id='{$id}'>编辑</a>",
"delRelation"=>"<a class='confirm delRelation' data-id='{$id}' style='color: red;'>删除</a>",
];
//操作对应菜单
if($info['status'] == 2){
$optist = [];
}else{
$optist = ["editRatio","delRatio"];
}
//
$resarr = [];
foreach ($optist as $k => $v) {
if(IS_ROOT){
$resarr[] = $opBtn[$v];
}else{
if(in_array($v,$this->OpAuthList)){
$resarr[] = $opBtn[$v];
}
}
}
return $resarr;
}
public function error($data)
{
header('Content-Type:application/json; charset=utf-8');
$data =json_encode(['msg'=>$data,"code"=>4000],JSON_UNESCAPED_UNICODE);
exit($data);
}
}