SystemGroupData.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 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\system\config;
  12. use crmeb\basic\BaseModel;
  13. use crmeb\traits\ModelTrait;
  14. use think\Model;
  15. /**
  16. * 组合数据数据列表模型
  17. * Class SystemGroupData
  18. * @package app\model\system\config
  19. */
  20. class SystemGroupData extends BaseModel
  21. {
  22. use ModelTrait;
  23. /**
  24. * 数据表主键
  25. * @var string
  26. */
  27. protected $pk = 'id';
  28. /**
  29. * 模型名称
  30. * @var string
  31. */
  32. protected $name = 'system_group_data';
  33. /**
  34. * 状态搜索器
  35. * @param $query
  36. * @param $value
  37. */
  38. public function searchStatusAttr($query, $value)
  39. {
  40. if ($value != '') {
  41. $query->where('status', $value);
  42. }
  43. }
  44. /**
  45. * Gid搜索器
  46. * @param Model $query
  47. * @param $value
  48. */
  49. public function searchGidAttr($query, $value)
  50. {
  51. if (is_array($value)) {
  52. $query->whereIn('gid', $value);
  53. } else {
  54. $query->where('gid', $value);
  55. }
  56. }
  57. }