// +---------------------------------------------------------------------- declare (strict_types=1); namespace app\api\model; use app\common\model\User; use app\common\model\UserInfo as UserInfoModel; /** * 用户资料模型类 * Class UserInfo * @package app\api\model */ class UserInfo extends UserInfoModel { protected $globalScope = ['']; /** * 隐藏字段 * @var array */ protected $hidden = [ 'store_id', 'update_time' ]; /** * 获取用户信息 * @param $where * @param array $with * @return static|array|false|null */ public static function detail($where, array $with = []) { $filter = []; if (is_array($where)) { $filter = array_merge($filter, $where); } else { $filter['user_id'] = (int)$where; } return static::get($filter, $with); } }