School.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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\School as SchoolModel;
  14. /**
  15. * 学校模型类
  16. * Class School
  17. * @package app\api\model
  18. */
  19. class School extends SchoolModel
  20. {
  21. protected $globalScope = [''];
  22. /**
  23. * 隐藏字段
  24. * @var array
  25. */
  26. protected $hidden = [
  27. 'update_time'
  28. ];
  29. /**
  30. * 获取学校信息
  31. * @param $where
  32. * @param array $with
  33. * @return static|array|false|null
  34. */
  35. public static function detail($where, array $with = [])
  36. {
  37. $filter = [];
  38. if (is_array($where)) {
  39. $filter = array_merge($filter, $where);
  40. } else {
  41. $filter['user_id'] = (int)$where;
  42. }
  43. return static::get($filter, $with);
  44. }
  45. }