|
|
@@ -3244,6 +3244,10 @@ class UserRepository extends BaseRepository
|
|
3244
|
3244
|
}
|
|
3245
|
3245
|
|
|
3246
|
3246
|
$userData = $this->dao->get($uid)->toArray();
|
|
|
3247
|
+ // 只升级 不降级
|
|
|
3248
|
+ if ($identityId < $userData['user_group']) {
|
|
|
3249
|
+ $identityId = $userData['user_group'];
|
|
|
3250
|
+ }
|
|
3247
|
3251
|
$data = ['user_group' => $identityId];
|
|
3248
|
3252
|
if (empty($userData['identity_up_time'] ?? null) && $userData['user_group'] == 1 && $identityId > 1) {
|
|
3249
|
3253
|
$data['identity_up_time'] = date('Y-m-d H:i:s');
|
|
|
@@ -3339,7 +3343,6 @@ class UserRepository extends BaseRepository
|
|
3339
|
3343
|
// 从小向大循环,满足则去 下一等级继续验证,不满足 则 返回上次循环记录的值,并结束循环
|
|
3340
|
3344
|
if ($item['arrive_num_own'] <= $arriveNumOwn && $item['arrive_num_team'] <= $arriveNumTeam) {
|
|
3341
|
3345
|
$identityId = $item['user_group_id'];
|
|
3342
|
|
-
|
|
3343
|
3346
|
// 用户等级限制,本次获取身份 最大可获取什么身份,比如 用户没有 团队贡献值,他最高只能升到 2 级 即业务员
|
|
3344
|
3347
|
if ($identityId == $maxLvRestrict) {
|
|
3345
|
3348
|
break;
|
|
|
@@ -3348,6 +3351,9 @@ class UserRepository extends BaseRepository
|
|
3348
|
3351
|
break;
|
|
3349
|
3352
|
}
|
|
3350
|
3353
|
}
|
|
|
3354
|
+ if ($identityId < $userData['user_group']) {
|
|
|
3355
|
+ $identityId = $userData['user_group'];
|
|
|
3356
|
+ }
|
|
3351
|
3357
|
return $identityId;
|
|
3352
|
3358
|
}
|
|
3353
|
3359
|
|
|
|
@@ -3638,13 +3644,13 @@ class UserRepository extends BaseRepository
|
|
3638
|
3644
|
break;
|
|
3639
|
3645
|
}
|
|
3640
|
3646
|
}
|
|
3641
|
|
- if (!empty($myIdentityUpTime) && !empty($yeWuYuanId)) {
|
|
3642
|
|
- $userData['identity_up_time'] = $myIdentityUpTime;
|
|
3643
|
|
- $userData['user_group'] = $yeWuYuanId;
|
|
3644
|
|
- $this->dao->update($uid, [
|
|
3645
|
|
- 'identity_up_time' => $userData['identity_up_time'],
|
|
3646
|
|
- 'user_group' => $yeWuYuanId
|
|
3647
|
|
- ]);
|
|
|
3647
|
+ if (!empty($myIdentityUpTime)) {
|
|
|
3648
|
+ $data['identity_up_time'] = $userData['identity_up_time'] = $myIdentityUpTime;
|
|
|
3649
|
+ // 只升级 不降级
|
|
|
3650
|
+ if ($userData['user_group'] == 1) {
|
|
|
3651
|
+ $userData['user_group'] = $yeWuYuanId;
|
|
|
3652
|
+ }
|
|
|
3653
|
+ $this->dao->update($uid, $data);
|
|
3648
|
3654
|
}
|
|
3649
|
3655
|
}
|
|
3650
|
3656
|
}
|