|
|
|
@ -162,17 +162,108 @@ class CompanyRelationController extends AdminController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function marketAgree(){
|
|
|
|
|
|
|
|
|
|
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
|
|
|
|
|
$ids = $_REQUEST['ids'];
|
|
|
|
|
$dbres = $this->DBlogModel->field("id,status,verify_log")->where("id in ({$ids})")->select();
|
|
|
|
|
foreach($dbres as $k=>&$v){
|
|
|
|
|
if($v['status'] != 0) continue;
|
|
|
|
|
$v['verify_log'] = json_decode($v['verify_log'],true);
|
|
|
|
|
$v['verify_log']['market_user']=$this->admininfo["username"];
|
|
|
|
|
$v['verify_log']['market_time']=date("Y-m-d H:i:s");
|
|
|
|
|
$v['verify_log'] = json_encode($v['verify_log']);
|
|
|
|
|
$v['status']=1;
|
|
|
|
|
$this->DBlogModel->save($v);
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"市场部审核",'url'=>U('index')]);
|
|
|
|
|
}
|
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
|
'status' => 1,
|
|
|
|
|
"info"=>"市场部审核通过成功"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
public function marketRefuse(){
|
|
|
|
|
|
|
|
|
|
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
|
|
|
|
|
$ids = $_REQUEST['ids'];
|
|
|
|
|
$dbres = $this->DBlogModel->field("id,status,verify_log")->where("id in ({$ids})")->select();
|
|
|
|
|
foreach($dbres as $k=>&$v){
|
|
|
|
|
if($v['status'] != 0) continue;
|
|
|
|
|
$v['verify_log'] = json_decode($v['verify_log'],true);
|
|
|
|
|
$v['verify_log']['market_user']=$this->admininfo["username"];
|
|
|
|
|
$v['verify_log']['market_time']=date("Y-m-d H:i:s");
|
|
|
|
|
$v['verify_log'] = json_encode($v['verify_log']);
|
|
|
|
|
$v['status']=-1;
|
|
|
|
|
$this->DBlogModel->save($v);
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"市场部审核",'url'=>U('index')]);
|
|
|
|
|
}
|
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
|
'status' => 1,
|
|
|
|
|
"info"=>"市场部审核拒绝成功"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
public function adminRefuse(){
|
|
|
|
|
|
|
|
|
|
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
|
|
|
|
|
$ids = $_REQUEST['ids'];
|
|
|
|
|
$dbres = $this->DBlogModel->field("id,status,verify_log")->where("id in ({$ids})")->select();
|
|
|
|
|
foreach($dbres as $k=>&$v){
|
|
|
|
|
if($v['status'] != 1) continue;
|
|
|
|
|
$v['verify_log'] = json_decode($v['verify_log'],true);
|
|
|
|
|
$v['verify_log']['admin_user']=$this->admininfo["username"];
|
|
|
|
|
$v['verify_log']['admin_time']=date("Y-m-d H:i:s");
|
|
|
|
|
$v['verify_log'] = json_encode($v['verify_log']);
|
|
|
|
|
$v['status']=-2;
|
|
|
|
|
$this->DBlogModel->save($v);
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"管理员审核",'url'=>U('index')]);
|
|
|
|
|
}
|
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
|
'status' => 1,
|
|
|
|
|
"info"=>"管理员审核拒绝成功"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
//管理员成功
|
|
|
|
|
public function adminAgree(){
|
|
|
|
|
|
|
|
|
|
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
|
|
|
|
|
$ids = $_REQUEST['ids'];
|
|
|
|
|
$dbres = $this->DBlogModel->field("*")->where("id in ({$ids})")->select();
|
|
|
|
|
foreach($dbres as $k=>&$v){
|
|
|
|
|
if($v['status'] != 1) continue;
|
|
|
|
|
$v['verify_log'] = json_decode($v['verify_log'],true);
|
|
|
|
|
$v['verify_log']['admin_user']=$this->admininfo["username"];
|
|
|
|
|
$v['verify_log']['admin_time']=date("Y-m-d H:i:s");
|
|
|
|
|
$v['verify_log'] = json_encode($v['verify_log']);
|
|
|
|
|
$v['status']=2;
|
|
|
|
|
$this->DBlogModel->save($v);
|
|
|
|
|
$id = $v['id'];
|
|
|
|
|
//保存到其他表
|
|
|
|
|
//查找是否存在
|
|
|
|
|
unset($v['id']);
|
|
|
|
|
unset($v['remark']);
|
|
|
|
|
unset($v['status']);
|
|
|
|
|
unset($v['verify_log']);
|
|
|
|
|
$where = "
|
|
|
|
|
(
|
|
|
|
|
(first_company_type ='{$v['first_company_type']}' and first_company_id = '{$v['first_company_id']}')
|
|
|
|
|
OR
|
|
|
|
|
(first_company_type ='{$v['second_company_type']}' and first_company_id = '{$v['second_company_id']}')
|
|
|
|
|
)
|
|
|
|
|
AND
|
|
|
|
|
(
|
|
|
|
|
(second_company_type ='{$v['first_company_type']}' and second_company_id = '{$v['first_company_id']}')
|
|
|
|
|
OR
|
|
|
|
|
(second_company_type ='{$v['second_company_type']}' and second_company_id = '{$v['second_company_id']}')
|
|
|
|
|
)
|
|
|
|
|
";
|
|
|
|
|
$hasdb = $this->DBModel->where($where)->find();
|
|
|
|
|
if(isset($hasdb['id'])){
|
|
|
|
|
$v['id'] = $hasdb['id'];
|
|
|
|
|
$this->DBModel->save($v);
|
|
|
|
|
}else{
|
|
|
|
|
$this->DBModel->add($v);
|
|
|
|
|
}
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$id,"op_name"=>"管理员审核",'url'=>U('index')]);
|
|
|
|
|
}
|
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
|
'status' => 1,
|
|
|
|
|
"info"=>"管理员审核通过成功"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function addRelation()
|
|
|
|
@ -264,7 +355,7 @@ class CompanyRelationController extends AdminController
|
|
|
|
|
"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>"
|
|
|
|
|
"adminRefuse"=>"<a class='butn' id='adminRefuse' style='background-color: red;'>管理员审核拒绝</a>"
|
|
|
|
|
];
|
|
|
|
|
$resarr = [];
|
|
|
|
|
foreach ($mentBtn as $k => $v) {
|
|
|
|
|