|
@@ -203,6 +203,30 @@ class MemberService extends BaseService
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 用户缓存信息
|
|
|
|
|
+ * @param $id
|
|
|
|
|
+ * @param string $field
|
|
|
|
|
+ * @return array|mixed
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getCacheInfo($id, $field='')
|
|
|
|
|
+ {
|
|
|
|
|
+ $cacheKey = "caches:member:info:u_{$id}";
|
|
|
|
|
+ $info = RedisService::get($cacheKey);
|
|
|
|
|
+ if($info){
|
|
|
|
|
+ return $info;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $field = $field? $field : ['id','is_trade','status','parent_id','code'];
|
|
|
|
|
+ $info = $this->model->where(['id' => $id,'mark'=>1])->select($field)->first();
|
|
|
|
|
+ $info = $info? $info->toArray() : [];
|
|
|
|
|
+ if($info){
|
|
|
|
|
+ RedisService::set($cacheKey, $info, rand(5, 10));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return $info;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 用户登录
|
|
* 用户登录
|
|
|
* @param $params
|
|
* @param $params
|
|
|
* @return array|false
|
|
* @return array|false
|
|
@@ -333,6 +357,8 @@ class MemberService extends BaseService
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 修改保存用户资料
|
|
* 修改保存用户资料
|
|
|
* @param $userId
|
|
* @param $userId
|