|
@@ -20,10 +20,11 @@ class CommonLogic
|
|
|
public static function setIsUpLevel(int $user_id, int $team_level_id): bool
|
|
public static function setIsUpLevel(int $user_id, int $team_level_id): 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;
|
|
|
$result = false;
|
|
$result = false;
|
|
|
//组合套数
|
|
//组合套数
|
|
|
- $groupCount = UserPledge::getPledgeCount($user_id) + 1;
|
|
|
|
|
|
|
+ $groupCount = UserPledge::getPledgeCount($user_id) ;
|
|
|
if($team_level_id == 0){
|
|
if($team_level_id == 0){
|
|
|
if($groupCount >= $config[$team_level_id]['num']) {
|
|
if($groupCount >= $config[$team_level_id]['num']) {
|
|
|
$result = true;
|
|
$result = true;
|
|
@@ -72,7 +73,7 @@ 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) ;
|
|
|
if($team_level_id == 1 && $groupCount < $config[0]['num']){
|
|
if($team_level_id == 1 && $groupCount < $config[0]['num']){
|
|
|
$result = true;
|
|
$result = true;
|
|
|
$team_level_id = 0;
|
|
$team_level_id = 0;
|
|
@@ -125,7 +126,7 @@ class CommonLogic
|
|
|
->select();
|
|
->select();
|
|
|
if(empty($parents_info) || empty($income)) return true;
|
|
if(empty($parents_info) || empty($income)) return true;
|
|
|
|
|
|
|
|
- //分享 1 个拿 3 层,分享 2 个拿 7 层
|
|
|
|
|
|
|
+ //分享 1 个拿 1 层,分享 2个拿 2 层
|
|
|
foreach ($parents_info as $parent){
|
|
foreach ($parents_info as $parent){
|
|
|
$send_user_id = 0; //需要发放的会员ID列表
|
|
$send_user_id = 0; //需要发放的会员ID列表
|
|
|
if($parent['team_level_id'] >= 1 && $parent['distance'] <= 1){
|
|
if($parent['team_level_id'] >= 1 && $parent['distance'] <= 1){
|