From 08f8c518a60979cadbea5b85e6082c8576ea9ee7 Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Mon, 13 Jan 2020 16:13:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=8Edev=E5=A4=8D=E5=88=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= 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 4b15764c0..bb9a5ff77 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -1296,17 +1296,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 {