UserInfo.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\api\model;
  13. use app\common\model\User;
  14. use app\common\model\UserInfo as UserInfoModel;
  15. /**
  16. * 用户资料模型类
  17. * Class UserInfo
  18. * @package app\api\model
  19. */
  20. class UserInfo extends UserInfoModel
  21. {
  22. /**
  23. * 隐藏字段
  24. * @var array
  25. */
  26. protected $hidden = [
  27. 'store_id',
  28. 'update_time'
  29. ];
  30. /**
  31. * 获取用户信息
  32. * @param $where
  33. * @param array $with
  34. * @return static|array|false|null
  35. */
  36. public static function detail($where, array $with = [])
  37. {
  38. $filter = [];
  39. if (is_array($where)) {
  40. $filter = array_merge($filter, $where);
  41. } else {
  42. $filter['user_id'] = (int)$where;
  43. }
  44. return static::get($filter, $with);
  45. }
  46. }