wanghousheng 11 months ago
parent 4548d8ca45
commit b432fa2691
  1. 24
      app/api/service/User.php
  2. 3
      app/api/service/identity/PaySuccess.php

@ -93,7 +93,7 @@ class User extends UserService
$userId = self::getCurrentLoginUserId(); $userId = self::getCurrentLoginUserId();
//分销表里有没有 //分销表里有没有
$dealerInfo = \app\api\model\dealer\User::detail($userId, []); $dealerInfo = \app\api\model\dealer\User::detail($userId, []);
if (!empty($dealerInfo) && self::checkEffectiveTime()) { if (!empty($dealerInfo) && self::checkFxEffectiveTime()) {
return true; return true;
} }
} }
@ -113,7 +113,7 @@ class User extends UserService
$userId = self::getCurrentLoginUserId(); $userId = self::getCurrentLoginUserId();
//分销表里有没有 //分销表里有没有
$dealerInfo = \app\api\model\dealer\User::detail($userId, []); $dealerInfo = \app\api\model\dealer\User::detail($userId, []);
if (!empty($dealerInfo) && self::checkEffectiveTime() && $dealerInfo['type'] == DealerUserEnum::ENGINEER) { if (!empty($dealerInfo) && self::checkFxEffectiveTime() && $dealerInfo['type'] == DealerUserEnum::ENGINEER) {
return true; return true;
} }
} }
@ -160,7 +160,7 @@ class User extends UserService
} }
/** /**
* @notes:检测plus会员 分销商是否到期 * @notes:检测plus会员是否到期
* @return bool * @return bool
* @throws BaseException * @throws BaseException
* @author: wanghousheng * @author: wanghousheng
@ -177,6 +177,24 @@ class User extends UserService
return false; return false;
} }
/**
* @notes:检测分销商是否到期
* @return bool
* @throws BaseException
* @author: wanghousheng
*/
private static function checkFxEffectiveTime(): bool
{
$userInfo = static::getCurrentLoginUser();
if (!empty($userInfo) && !empty($userInfo['fx_effective_time'])) {
$effective_time = strtotime($userInfo['fx_effective_time'] . ' 23:59:59');
if (time() < $effective_time) {
return true;
}
}
return false;
}
/** /**
* 获取当前登录的用户身份 * 获取当前登录的用户身份
* getCurrentLoginUser方法的二次封装 * getCurrentLoginUser方法的二次封装

@ -392,6 +392,9 @@ class PaySuccess extends BaseService
'real_name' => $mobile, 'real_name' => $mobile,
'mobile' => $mobile, 'mobile' => $mobile,
]); ]);
} else {
//更新分销用户
User::update(['is_delete' => 0], ['user_id' => $userInfo['user_id']]);
} }
$up['fx_effective_time'] = date("Y-m-d", strtotime("+{$orderInfo['month']} months", strtotime($time))); $up['fx_effective_time'] = date("Y-m-d", strtotime("+{$orderInfo['month']} months", strtotime($time)));
} }

Loading…
Cancel
Save