Qrcode.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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\other;
  12. use crmeb\basic\BaseModel;
  13. use crmeb\traits\ModelTrait;
  14. use think\Model;
  15. /**
  16. * Class Qrcode
  17. * @package app\model\other
  18. */
  19. class Qrcode extends BaseModel
  20. {
  21. use ModelTrait;
  22. /**
  23. * 数据表主键
  24. * @var string
  25. */
  26. protected $pk = 'id';
  27. /**
  28. * 模型名称
  29. * @var string
  30. */
  31. protected $name = 'qrcode';
  32. /**
  33. * type 搜索器
  34. * @param Model $query
  35. * @param $value
  36. */
  37. public function searchTypeAttr($query, $value)
  38. {
  39. if ($value != '') {
  40. $query->whereLike('type', $value);
  41. }
  42. }
  43. /**
  44. * status 搜索器
  45. * @param Model $query
  46. * @param $value
  47. */
  48. public function searchStatusAttr($query, $value)
  49. {
  50. if ($value != '') {
  51. $query->whereLike('status', $value);
  52. }
  53. }
  54. /**
  55. * third_type 搜索器
  56. * @param Model $query
  57. * @param $value
  58. */
  59. public function searchThirdTypeAttr($query, $value)
  60. {
  61. if ($value != '') {
  62. $query->whereLike('third_type', $value);
  63. }
  64. }
  65. /**
  66. * third_id 搜索器
  67. * @param Model $query
  68. * @param $value
  69. */
  70. public function searchThirdIdAttr($query, $value)
  71. {
  72. if ($value != '') {
  73. $query->whereLike('third_id', $value);
  74. }
  75. }
  76. }