|
@@ -32,7 +32,7 @@ class CommonLogic
|
|
|
//组合套数
|
|
//组合套数
|
|
|
$groupCount = UserPledge::getPledgeCount($user_id) + 1;
|
|
$groupCount = UserPledge::getPledgeCount($user_id) + 1;
|
|
|
//直推
|
|
//直推
|
|
|
- $teamCount = UserModel::where('parent_id', $user_id)->where('team_level_id', $team_level_id)->count();
|
|
|
|
|
|
|
+ $teamCount = UserModel::where('parent_id', $user_id)->where('team_level_id','>=', $team_level_id)->count();
|
|
|
if($teamCount >= $config[$team_level_id]['direct'] && $groupCount >= $config[$team_level_id]['num']){
|
|
if($teamCount >= $config[$team_level_id]['direct'] && $groupCount >= $config[$team_level_id]['num']){
|
|
|
$result = true;
|
|
$result = true;
|
|
|
$team_level_id += 1; //+1
|
|
$team_level_id += 1; //+1
|
|
@@ -53,7 +53,7 @@ class CommonLogic
|
|
|
$parent = $userModel::where('id', $item)->find();
|
|
$parent = $userModel::where('id', $item)->find();
|
|
|
if($parent->team_level_id > 0){
|
|
if($parent->team_level_id > 0){
|
|
|
//推广人数
|
|
//推广人数
|
|
|
- $teamCount = $userModel::where('parent_id', $item)->where('team_level_id', $parent->team_level_id)->count() +1;
|
|
|
|
|
|
|
+ $teamCount = $userModel::where('parent_id', $item)->where('team_level_id', '>=',$parent->team_level_id)->count() +1;
|
|
|
//组合套数
|
|
//组合套数
|
|
|
$groupCount = $userPledge::getPledgeCount($item);
|
|
$groupCount = $userPledge::getPledgeCount($item);
|
|
|
if($teamCount >= $config[$parent->team_level_id]['direct'] && $groupCount >= $config[$parent->team_level_id]['num']){
|
|
if($teamCount >= $config[$parent->team_level_id]['direct'] && $groupCount >= $config[$parent->team_level_id]['num']){
|
|
@@ -71,16 +71,15 @@ class CommonLogic
|
|
|
$config = config('team_level_where');
|
|
$config = config('team_level_where');
|
|
|
$result = false;
|
|
$result = false;
|
|
|
//组合套数
|
|
//组合套数
|
|
|
- $groupCount = UserPledge::getPledgeCount($user_id) -1 ;
|
|
|
|
|
|
|
+ $groupCount = UserPledge::getPledgeCount($user_id) -1;
|
|
|
if($team_level_id == 1 && ($groupCount == 0 || $address_level < $config[0]['direct'])){
|
|
if($team_level_id == 1 && ($groupCount == 0 || $address_level < $config[0]['direct'])){
|
|
|
$result = true;
|
|
$result = true;
|
|
|
$team_level_id = 0;
|
|
$team_level_id = 0;
|
|
|
self::setIsOuLevelParent($user_id, $config);
|
|
self::setIsOuLevelParent($user_id, $config);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if($team_level_id > 1){
|
|
if($team_level_id > 1){
|
|
|
//直推
|
|
//直推
|
|
|
- $teamCount = UserModel::where('parent_id', $user_id)->where('team_level_id', $team_level_id)->count();
|
|
|
|
|
|
|
+ $teamCount = UserModel::where('parent_id', $user_id)->where('team_level_id','>=', $team_level_id)->count()-1;
|
|
|
if($teamCount < $config[$team_level_id]['direct'] && $groupCount < $config[$team_level_id]['num']){
|
|
if($teamCount < $config[$team_level_id]['direct'] && $groupCount < $config[$team_level_id]['num']){
|
|
|
$result = true;
|
|
$result = true;
|
|
|
$team_level_id -= 1;
|
|
$team_level_id -= 1;
|
|
@@ -100,7 +99,7 @@ class CommonLogic
|
|
|
$parent = $userModel::where('id', $item)->find();
|
|
$parent = $userModel::where('id', $item)->find();
|
|
|
if($parent->team_level_id > 0){
|
|
if($parent->team_level_id > 0){
|
|
|
//推广人数
|
|
//推广人数
|
|
|
- $teamCount = $userModel::where('parent_id', $item)->where('team_level_id', $parent->team_level_id)->count()-1;
|
|
|
|
|
|
|
+ $teamCount = $userModel::where('parent_id', $item)->where('team_level_id', '>=',$parent->team_level_id)->count()-1;
|
|
|
//组合套数
|
|
//组合套数
|
|
|
$groupCount = $userPledge::getPledgeCount($item);
|
|
$groupCount = $userPledge::getPledgeCount($item);
|
|
|
if($teamCount < $config[$parent->team_level_id]['direct'] || $groupCount < $config[$parent->team_level_id]['num']){
|
|
if($teamCount < $config[$parent->team_level_id]['direct'] || $groupCount < $config[$parent->team_level_id]['num']){
|