|
|
@@ -203,17 +203,20 @@ class SystemUserTask extends BaseModel
|
|
|
$max = 0;
|
|
|
$team_achievement=0;
|
|
|
$teamUids = UserController::getAllTeamMembers($uid); //获取团队所有成员
|
|
|
+ @file_put_contents('quanju.txt', json_encode($teamUids) . "-团队直属下级uid\r\n", 8);
|
|
|
$team_achievement = 0;
|
|
|
if (!empty($teamUids)) {
|
|
|
$team_achievement = User::whereIn('uid', $teamUids)
|
|
|
->sum('achievement');
|
|
|
}
|
|
|
if (!empty($directSubordinateUids)) {
|
|
|
+ $directSubordinateUids = array_unique($directSubordinateUids);
|
|
|
@file_put_contents('quanju.txt', json_encode($directSubordinateUids) . "-直属下级uid\r\n", 8);
|
|
|
foreach ($directSubordinateUids as $key => $value){
|
|
|
$teamUids = UserController::getAllTeamMembers($value); //获取直推下级的团队所有成员
|
|
|
@file_put_contents('quanju.txt', json_encode($teamUids) . "-各直属下级团队uid\r\n", 8);
|
|
|
if (!empty($teamUids)) {
|
|
|
+ $teamUids=array_unique($teamUids);
|
|
|
$personal_achievement = User::whereIn('uid', $teamUids)
|
|
|
->sum('achievement');
|
|
|
// $team_achievement += $personal_achievement;
|
|
|
@@ -230,6 +233,7 @@ class SystemUserTask extends BaseModel
|
|
|
@file_put_contents('quanju.txt', $max . "-大区消费\r\n", 8);
|
|
|
@file_put_contents('quanju.txt', $community_achievement . "-小区消费\r\n", 8);
|
|
|
$SumPayPrice =$community_achievement;
|
|
|
+ @file_put_contents('quanju.txt', $number . "-小区消费指标\r\n", 8);
|
|
|
if ($SumPayPrice >= $number) $isComplete = UserTaskFinish::setFinish($uid, $task_id) ? true : false;
|
|
|
return ['还需消费{$num}元', $SumPayPrice, $isComplete];
|
|
|
}
|