SourceShoolApply.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.thinkphp.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: thinkphp <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\common\model;
  13. use cores\BaseModel;
  14. /**
  15. * 生源学校模型类
  16. * Class SourceShoolApply
  17. * @package app\common\model
  18. */
  19. class SourceShoolApply extends BaseModel
  20. {
  21. protected $globalScope = [''];
  22. // 定义表名
  23. protected $name = 'source_shools_apply';
  24. // 定义主键
  25. protected $pk = 'id';
  26. /**
  27. * 获取老师已经申请的生源学校
  28. * @param $userId
  29. * @return array
  30. */
  31. public static function getSchoolsByUser($userId)
  32. {
  33. return self::where(['user_id'=> $userId,'status'=>1])
  34. ->column('source_shools_id');
  35. }
  36. }