|
@@ -17,7 +17,7 @@ class CommonLogic
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
// 升级
|
|
// 升级
|
|
|
- public static function setIsUpLevel(int $user_id, int $team_level_id, int $address_level, int $parent_id): bool
|
|
|
|
|
|
|
+ public static function setIsUpLevel(int $user_id, int $team_level_id, int $address_level): bool
|
|
|
{
|
|
{
|
|
|
$config = config('team_level_where');
|
|
$config = config('team_level_where');
|
|
|
if($team_level_id == count($config)) return false;
|
|
if($team_level_id == count($config)) return false;
|
|
@@ -66,7 +66,7 @@ class CommonLogic
|
|
|
|
|
|
|
|
|
|
|
|
|
//降级
|
|
//降级
|
|
|
- public static function setIsOuLevelSave($user_id, $team_level_id, $address_level, $parent_id)
|
|
|
|
|
|
|
+ public static function setIsOuLevelSave($user_id, $team_level_id, $address_level)
|
|
|
{
|
|
{
|
|
|
$config = config('team_level_where');
|
|
$config = config('team_level_where');
|
|
|
$result = false;
|
|
$result = false;
|
|
@@ -75,7 +75,7 @@ class CommonLogic
|
|
|
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($parent_id, $config);
|
|
|
|
|
|
|
+ self::setIsOuLevelParent($user_id, $config);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if($team_level_id > 1){
|
|
if($team_level_id > 1){
|
|
@@ -84,7 +84,7 @@ class CommonLogic
|
|
|
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;
|
|
|
- self::setIsOuLevelParent($parent_id, $config);
|
|
|
|
|
|
|
+ self::setIsOuLevelParent($user_id, $config);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return $result? UserModel::where('id', $user_id)->update(['team_level_id'=> $team_level_id]): false;
|
|
return $result? UserModel::where('id', $user_id)->update(['team_level_id'=> $team_level_id]): false;
|