|
|
|
@ -269,6 +269,9 @@ class PromoteController extends ThinkController
|
|
|
|
|
$ba = new \Admin\Model\BusinessAffairsModel();
|
|
|
|
|
$ba->add_child($_REQUEST['ba_id'],$res);
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>0,'key'=>$account,'op_name'=>'新增推广员','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-新增推广员']);
|
|
|
|
|
|
|
|
|
|
session('user_auth_promote_ids', null);
|
|
|
|
|
$this->success("添加成功", U('lists'));
|
|
|
|
|
} else {
|
|
|
|
@ -377,6 +380,13 @@ class PromoteController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,
|
|
|
|
|
'key'=>$data['account'].$data['password'].$data['second_pwd'].$data['status'].$data['child_game_permission'].$data['mark1'].$data['mark2'],
|
|
|
|
|
'op_name'=>'编辑推广员',
|
|
|
|
|
'url'=>U('Promote/edit',['id'=>$_POST['id']]),
|
|
|
|
|
'menu'=>'推广员-推广员管理-推广员列表-编辑推广员']);
|
|
|
|
|
|
|
|
|
|
$this->success("修改成功", U('lists'));
|
|
|
|
|
} else {
|
|
|
|
|
$this->error("修改失败");
|
|
|
|
@ -441,9 +451,14 @@ class PromoteController extends ThinkController
|
|
|
|
|
$model=$_REQUEST['model'];
|
|
|
|
|
unset($_REQUEST['model']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$a=0;
|
|
|
|
|
$map['id']=array('in',$_REQUEST['ids']);
|
|
|
|
|
|
|
|
|
|
$set=M('promote', 'tab_')->where($map)->setField('status', $_REQUEST['status']);
|
|
|
|
|
|
|
|
|
|
// echo M()->_sql();die();
|
|
|
|
|
|
|
|
|
|
if ($set) {
|
|
|
|
|
if ($_REQUEST['status']==1) {
|
|
|
|
|
$select=M('promote', 'tab_')->where($map)->select();
|
|
|
|
@ -451,9 +466,18 @@ class PromoteController extends ThinkController
|
|
|
|
|
if ($count=="000000") {
|
|
|
|
|
$a++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$value['account'],'op_name'=>'编辑审核解锁','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-编辑审核解锁']);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$this->success('操作成功');/**,已通知'.$a.'人'*/
|
|
|
|
|
} else {
|
|
|
|
|
$select=M('promote', 'tab_')->where($map)->select();
|
|
|
|
|
foreach ($select as $key => $value) {
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$value['account'],'op_name'=>'编辑审核锁定','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-编辑审核锁定']);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$this->success('操作成功');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -483,9 +507,20 @@ class PromoteController extends ThinkController
|
|
|
|
|
if ($count=="000000") {
|
|
|
|
|
$a++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$value['account'],'op_name'=>'编辑资质审核','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-编辑资质审核']);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$this->success('操作成功');/**,已通知'.$a.'人'*/
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$select=M('promote', 'tab_')->where($map)->select();
|
|
|
|
|
foreach ($select as $key => $value) {
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$value['account'],'op_name'=>'编辑拒绝身份通过','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-编辑拒绝身份通过']);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->success('操作成功');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -1040,6 +1075,13 @@ class PromoteController extends ThinkController
|
|
|
|
|
$res = M('config')->where(array('name'=>$config_key))->save($config);
|
|
|
|
|
S('DB_CONFIG_DATA', null);
|
|
|
|
|
if ($res !== false) {
|
|
|
|
|
|
|
|
|
|
if ($val == 0) {
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>getNowDate(),'op_name'=>'关闭自动审核','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-关闭自动审核']);
|
|
|
|
|
} else if ($val == 1) {
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>getNowDate(),'op_name'=>'开启自动审核','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-开启自动审核']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->success('操作成功');
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('操作失败');
|
|
|
|
@ -1050,9 +1092,15 @@ class PromoteController extends ThinkController
|
|
|
|
|
{
|
|
|
|
|
if (IS_AJAX) {
|
|
|
|
|
M()->startTrans();
|
|
|
|
|
|
|
|
|
|
$data = M('promote', 'tab_')->where("id={$_POST['id']} ")->find();
|
|
|
|
|
|
|
|
|
|
$result = M('promote', 'tab_')->where("chain like '%/{$_POST['id']}/%' or id={$_POST['id']} ")->delete();
|
|
|
|
|
if ($result) {
|
|
|
|
|
M()->commit();
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>2,'key'=>$data['account'],'op_name'=>'删除推广员','url'=>U('Promote/lists'),'menu'=>'推广员-推广员管理-推广员列表-删除推广员']);
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn(array('status'=>1,'msg'=>'删除成功'));
|
|
|
|
|
} else {
|
|
|
|
|
M()->rollback();
|
|
|
|
@ -1301,6 +1349,11 @@ class PromoteController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
$res = M('promote_belong', 'tab_')->add($data);
|
|
|
|
|
if ($res) {
|
|
|
|
|
|
|
|
|
|
$promote = M('promote','tab_')->where(['id'=>$promote_id])->find();
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>0,'key'=>$promote['account'],'op_name'=>'工会归属申请','url'=>U('Promote/belong'),'menu'=>'推广员-推广员管理-推广公会归属管理-工会归属申请']);
|
|
|
|
|
|
|
|
|
|
$this->success("申请成功", U('belong'));
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('申请失败');
|
|
|
|
@ -1335,6 +1388,11 @@ class PromoteController extends ThinkController
|
|
|
|
|
);
|
|
|
|
|
$res = M('promote_belong', 'tab_')->where(['id' => I('id')])->save($data);
|
|
|
|
|
if ($res) {
|
|
|
|
|
|
|
|
|
|
$promote = M('promote','tab_')->where(['id'=>$promote_id])->find();
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$promote['account'],'op_name'=>'编辑工会归属申请','url'=>U('Promote/belong_edit',['id'=>I('id')]),'menu'=>'推广员-推广员管理-推广公会归属管理-编辑工会归属申请']);
|
|
|
|
|
|
|
|
|
|
$this->success("编辑成功", U('belong'));
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('编辑失败');
|
|
|
|
@ -1361,6 +1419,8 @@ class PromoteController extends ThinkController
|
|
|
|
|
'approver_name' => getAdmin('username'),
|
|
|
|
|
'verify_time' => time()
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!is_null($res) ) {
|
|
|
|
|
if ($verify_status == 1) {//审核通过才修改推广员的归属关系
|
|
|
|
|
$promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select();
|
|
|
|
@ -1374,8 +1434,22 @@ class PromoteController extends ThinkController
|
|
|
|
|
$res = M("promote", "tab_")
|
|
|
|
|
->where("chain like '%/{$promote_belong['promote_id']}/%' or id={$promote_belong['promote_id']} ")
|
|
|
|
|
->save($update);
|
|
|
|
|
|
|
|
|
|
$promoteData = M('promote','tab_')->field('account')->where(['id'=>$promote_belong['promote_id']])->find();
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'],'op_name'=>'推广公会归属审核通过','url'=>U('Promote/belong'),'menu'=>'推广员-推广员管理-推广公会归属管理-推广公会归属审核通过']);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} else if ($verify_status == 2) {
|
|
|
|
|
|
|
|
|
|
$promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select();
|
|
|
|
|
foreach ($promote_belongs as $promote_belong) {
|
|
|
|
|
|
|
|
|
|
$promoteData = M('promote','tab_')->field('account')->where(['id'=>$promote_belong['promote_id']])->find();
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'],'op_name'=>'推广公会归属审核拒绝','url'=>U('Promote/belong'),'menu'=>'推广员-推广员管理-推广公会归属管理-推广公会归属审核拒绝']);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->success("操作成功", U('belong'));
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('操作失败');
|
|
|
|
@ -1488,6 +1562,11 @@ class PromoteController extends ThinkController
|
|
|
|
|
if ($result === false) {
|
|
|
|
|
$this->error('操作失败');
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$promoteData = M('promote','tab_')->field('account')->where(['id'=>$promoteId])->find();
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$promoteData['account'],'op_name'=>'资质认证','url'=>U('Promote/certification',['id'=>$promoteId]),'menu'=>'推广员-推广员管理-推广员列表-资质认证']);
|
|
|
|
|
|
|
|
|
|
$this->success('操作成功');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|