afa 5 月之前
父節點
當前提交
98ab2a41f4
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      application/api/logic/CommonLogic.php

+ 2 - 3
application/api/logic/CommonLogic.php

@@ -61,9 +61,8 @@ class CommonLogic
             $config = config('team_level_where');
             $team_level_id = $team_level_id - 1;
             $paths  = UserPathModel::where('user_id', $user_id)->where('distance', '<=', $config[$team_level_id]['level'])->order('distance', 'asc')->column('parent_id');
-            if(count($paths) > 0){
-                  //收益
-                  $income = bcmul($num, config('team_level_inc'), 2);
+            $income = bcmul($num, config('team_level_inc'), 2); //收益
+            if(count($paths) > 0 && $income > 0){
                   //余额记录
                   foreach($paths as $pathId){
                         if(!empty(Loader::model('UserModel')::getTeamLevelId($pathId))) {