SystemCrudData.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * +----------------------------------------------------------------------
  4. * | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  5. * +----------------------------------------------------------------------
  6. * | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  7. * +----------------------------------------------------------------------
  8. * | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  9. * +----------------------------------------------------------------------
  10. * | Author: CRMEB Team <admin@crmeb.com>
  11. * +----------------------------------------------------------------------
  12. */
  13. namespace app\model\system;
  14. use crmeb\basic\BaseModel;
  15. /**
  16. * Class SystemCrudData
  17. * @author 等风来
  18. * @email 136327134@qq.com
  19. * @date 2023/7/28
  20. * @package app\model\system
  21. */
  22. class SystemCrudData extends BaseModel
  23. {
  24. /**
  25. * @var string
  26. */
  27. protected $name = 'system_crud_data';
  28. /**
  29. * @var string
  30. */
  31. protected $pk = 'id';
  32. public function getValueAttr($value)
  33. {
  34. return json_decode($value, true);
  35. }
  36. /**
  37. * @param $query
  38. * @param $value
  39. * @author 等风来
  40. * @email 136327134@qq.com
  41. * @date 2023/8/10
  42. */
  43. public function searchNameAttr($query, $value)
  44. {
  45. if ($value != '') {
  46. $query->where('name', 'like', '%' . $value . '%');
  47. }
  48. }
  49. }