工会归属管理

master
liuweiwen 5 years ago
parent 5d593cf266
commit 64cdea78a3

@ -1434,17 +1434,23 @@ class PromoteController extends ThinkController
public function belong_verify() public function belong_verify()
{ {
$verify_status = $_REQUEST['verify_status']; $verify_status = $_REQUEST['verify_status'];
$res = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->save(['verify_status' => $verify_status]); $res = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->save([
if (!is_null($res)) { 'verify_status' => $verify_status,
$promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select(); 'approver_id' => getAdmin(),
foreach ($promote_belongs as $promote_belong) { 'approver_name' => getAdmin('username'),
$update = [ ]);
'company_belong' => $promote_belong['company_belong'], if (!is_null($res) ) {
'company_relation' => $promote_belong['company_relation'] if ($verify_status == 1) {//审核通过才修改推广员的归属关系
]; $promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select();
$res = M("promote", "tab_") foreach ($promote_belongs as $promote_belong) {
->where("chain like '%/{$promote_belong['promote_id']}/%' or id={$promote_belong['promote_id']} ") $update = [
->save($update); 'company_belong' => $promote_belong['company_belong'],
'company_relation' => $promote_belong['company_relation']
];
$res = M("promote", "tab_")
->where("chain like '%/{$promote_belong['promote_id']}/%' or id={$promote_belong['promote_id']} ")
->save($update);
}
} }
$this->success("操作成功", U('belong')); $this->success("操作成功", U('belong'));
} else { } else {

Loading…
Cancel
Save