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; }