From 34e25f293a18507f1c4a53cac01de1e1253a3451 Mon Sep 17 00:00:00 2001 From: "elf@home" <360197197@qq.com> Date: Thu, 21 Jan 2021 22:48:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=AF=8F=E7=BA=A7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Service/PromoteService.class.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 23828a922..383da0f30 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -205,11 +205,13 @@ class PromoteService { M('promote', 'tab_')->where($firstMap)->save([ 'parent_id' => $toPromote['id'], 'parent_name' => $toPromote['account'], - 'chain' => $toPromote['chain'] . $toPromote['id'] . '/' + 'chain' => $toPromote['chain'] . $toPromote['id'] . '/', + 'level' . $toPromote['level'] => $toPromote['id'] ]); M('promote', 'tab_')->where($secondMap)->save([ 'chain' => ['exp', 'REPLACE(chain, "/' . $fromPromote['id'] . '/","/' . $toPromote['id'] . '/")'], + 'level' . $toPromote['level'] => $toPromote['id'] ]); $status = M('ShiftTask')->where('id=' . $task['id'])->save(['status' => 1, 'handle_time' => time()]); @@ -1069,6 +1071,16 @@ class PromoteService { resetUserAuth(); } + $fullChain = $data['chain'] . $insert; + $fullChainList = explode('/', trim($fullChain, '/')); + + M('promote', 'tab_')->where(['id' => $insert])->update([ + 'level1_id' => $fullChainList[0] ?? 0, + 'level2_id' => $fullChainList[1] ?? 0, + 'level3_id' => $fullChainList[2] ?? 0, + 'level4_id' => $fullChainList[3] ?? 0, + ]); + return $insert; }