MemberRight.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\model\user\member;
  12. use crmeb\basic\BaseModel;
  13. use crmeb\traits\ModelTrait;
  14. /**
  15. * Class MemberRight
  16. * @package app\model\user\member
  17. */
  18. class MemberRight extends BaseModel
  19. {
  20. use ModelTrait;
  21. /**
  22. * 数据表主键
  23. * @var string
  24. */
  25. protected $pk = 'id';
  26. /**
  27. * 模型名称
  28. * @var string
  29. */
  30. protected $name = 'member_right';
  31. /**
  32. * 状态搜索器
  33. * @param $query
  34. * @param $value
  35. */
  36. public function searchStatusAttr($query, $value)
  37. {
  38. if ($value) {
  39. $query->where('status', $value);
  40. }
  41. }
  42. /**
  43. * 状态搜索器
  44. * @param $query
  45. * @param $value
  46. */
  47. public function searchRightTypeAttr($query, $value)
  48. {
  49. if ($value) {
  50. $query->where('right_type', $value);
  51. }
  52. }
  53. }