|
|
|
@ -93,7 +93,7 @@ class User extends UserService |
|
|
|
|
$userId = self::getCurrentLoginUserId(); |
|
|
|
|
//分销表里有没有 |
|
|
|
|
$dealerInfo = \app\api\model\dealer\User::detail($userId, []); |
|
|
|
|
if (!empty($dealerInfo) && self::checkEffectiveTime()) { |
|
|
|
|
if (!empty($dealerInfo) && self::checkFxEffectiveTime()) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -113,7 +113,7 @@ class User extends UserService |
|
|
|
|
$userId = self::getCurrentLoginUserId(); |
|
|
|
|
//分销表里有没有 |
|
|
|
|
$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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -133,7 +133,7 @@ class User extends UserService |
|
|
|
|
if ($userInfo && $userInfo['user_type'] == UserTypeEnum::STORE) { |
|
|
|
|
|
|
|
|
|
$userId = $userInfo['user_id']; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//商家表里有没有 |
|
|
|
|
$model = new \app\common\model\store\User(); |
|
|
|
|
$store_id = $model->where(['user_id' => $userId])->value('store_id'); |
|
|
|
@ -160,7 +160,7 @@ class User extends UserService |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @notes:检测plus会员 分销商是否到期 |
|
|
|
|
* @notes:检测plus会员是否到期 |
|
|
|
|
* @return bool |
|
|
|
|
* @throws BaseException |
|
|
|
|
* @author: wanghousheng |
|
|
|
@ -177,6 +177,24 @@ class User extends UserService |
|
|
|
|
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方法的二次封装 |
|
|
|
|