OutAccount.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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\out;
  12. use crmeb\basic\BaseModel;
  13. use crmeb\traits\ModelTrait;
  14. use think\Model;
  15. /**
  16. * 对外接口
  17. * Class StoreService
  18. * @package app\model\service
  19. */
  20. class OutAccount 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 = 'out_account';
  33. /**
  34. * @var bool
  35. */
  36. protected $updateTime = false;
  37. /**
  38. * 模糊条件搜索器
  39. * @param Model $query
  40. * @param $value
  41. */
  42. public function searchNameAttr($query, $value)
  43. {
  44. if ($value !== '') {
  45. $query->where('appid|title|id', 'LIKE', "%$value%");
  46. }
  47. }
  48. /**
  49. * 状态搜索器
  50. * @param Model $query
  51. * @param $value
  52. */
  53. public function searchStatusAttr($query, $value)
  54. {
  55. if ($value !== '') {
  56. $query->where('status', $value);
  57. }
  58. }
  59. /**
  60. * 删除搜索器
  61. * @param Model $query
  62. * @param $value
  63. */
  64. public function searchIsDelAttr($query, $value)
  65. {
  66. if ($value !== '') {
  67. $query->where('is_del', $value);
  68. }
  69. }
  70. }