|
|
@@ -345,33 +345,25 @@ class MemberService extends BaseService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 收款账户
|
|
|
+ * 认证资料
|
|
|
* @param $userId
|
|
|
* @return array|mixed
|
|
|
*/
|
|
|
- public function accountInfo($userId,$type=0)
|
|
|
+ public function authInfo($userId)
|
|
|
{
|
|
|
- $cacheKey = "caches:members:account:{$userId}_{$type}";
|
|
|
- $datas = RedisService::get($cacheKey);
|
|
|
- if ($datas) {
|
|
|
- return $type?(isset($datas[$type-1])?$datas[$type-1]:[]):$datas;
|
|
|
+ $cacheKey = "caches:members:authInfo:{$userId}";
|
|
|
+ $info = RedisService::get($cacheKey);
|
|
|
+ if ($info) {
|
|
|
+ return $info;
|
|
|
}
|
|
|
|
|
|
- $datas[0] = MemberBankModel::where(['type'=>1,'user_id'=>$userId,'status'=>1,'mark'=>1])
|
|
|
- ->select(['id','user_id','type','realname','account','account_remark','status'])
|
|
|
- ->first();
|
|
|
- $datas[0] = $datas[0]? $datas[0] : ['id'=>0,'type'=>1];
|
|
|
- $datas[1] = MemberBankModel::where(['type'=>2,'user_id'=>$userId,'status'=>1,'mark'=>1])
|
|
|
- ->select(['id','user_id','type','realname','account','account_remark','status'])
|
|
|
+ $info = $this->model->where(['id' => $userId, 'mark' => 1])
|
|
|
+ ->select(['id', 'realname','idcard','bank_name','bank_card','bank_branch','is_auth', 'status'])
|
|
|
->first();
|
|
|
- $datas[1] = $datas[1]? $datas[1] : ['id'=>0,'type'=>2];
|
|
|
- if($datas){
|
|
|
- RedisService::set($cacheKey, $datas, rand(5,10));
|
|
|
- }else{
|
|
|
- $datas = [['id'=>0,'type'=>1],['id'=>0,'type'=>2]];
|
|
|
+ if($info){
|
|
|
+ RedisService::set($cacheKey, $info, rand(300,600));
|
|
|
}
|
|
|
-
|
|
|
- return $type?(isset($datas[$type-1])?$datas[$type-1]:[]):$datas;
|
|
|
+ return $info;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -610,6 +602,7 @@ class MemberService extends BaseService
|
|
|
|
|
|
$this->error = '恭喜您,已完成认证';
|
|
|
RedisService::clear($cacheLockKey);
|
|
|
+ RedisService::clear("caches:members:authInfo:{$userId}");
|
|
|
return true;
|
|
|
}
|
|
|
|