From 64cdea78a36c608e48422950701305f24d5464fb Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Fri, 10 Jan 2020 09:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BC=9A=E5=BD=92=E5=B1=9E=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) 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 {