You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SystemGroupData.php 991B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace app\model\system\config;
  3. use crmeb\basic\BaseModel;
  4. use crmeb\traits\ModelTrait;
  5. use think\Model;
  6. /**
  7. * 组合数据数据列表模型
  8. * Class SystemGroupData
  9. * @package app\model\system\config
  10. */
  11. class SystemGroupData extends BaseModel
  12. {
  13. use ModelTrait;
  14. /**
  15. * 数据表主键
  16. * @var string
  17. */
  18. protected $pk = 'id';
  19. /**
  20. * 模型名称
  21. * @var string
  22. */
  23. protected $name = 'system_group_data';
  24. /**
  25. * 状态搜索器
  26. * @param $query
  27. * @param $value
  28. */
  29. public function searchStatusAttr($query, $value)
  30. {
  31. if ($value != '') {
  32. $query->where('status', $value);
  33. }
  34. }
  35. /**
  36. * Gid搜索器
  37. * @param Model $query
  38. * @param $value
  39. */
  40. public function searchGidAttr($query, $value)
  41. {
  42. if (is_array($value)) {
  43. $query->whereIn('gid', $value);
  44. } else {
  45. $query->where('gid', $value);
  46. }
  47. }
  48. }