diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index fdef0879e..281e8f7ad 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -1434,17 +1434,23 @@ class PromoteController extends ThinkController public function belong_verify() { $verify_status = $_REQUEST['verify_status']; - $res = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->save(['verify_status' => $verify_status]); - if (!is_null($res)) { - $promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select(); - foreach ($promote_belongs as $promote_belong) { - $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); + $res = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->save([ + 'verify_status' => $verify_status, + 'approver_id' => getAdmin(), + 'approver_name' => getAdmin('username'), + ]); + if (!is_null($res) ) { + if ($verify_status == 1) {//审核通过才修改推广员的归属关系 + $promote_belongs = M('promote_belong', 'tab_')->where(['id' => ['in', I('ids')]])->select(); + foreach ($promote_belongs as $promote_belong) { + $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')); } else {