ShippingTemplatesNoDelivery.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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\shipping;
  12. use crmeb\traits\ModelTrait;
  13. use crmeb\basic\BaseModel;
  14. use think\Model;
  15. /**
  16. * 不送达Model
  17. * Class ShippingTemplatesNoDelivery
  18. * @package app\model\shipping
  19. */
  20. class ShippingTemplatesNoDelivery 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 = 'shipping_templates_no_delivery';
  33. /**
  34. * 省ID搜索器
  35. * @param Model $query
  36. * @param $value
  37. * @param $data
  38. */
  39. public function searchProvinceIdAttr($query, $value)
  40. {
  41. $query->where('province_id', $value);
  42. }
  43. /**
  44. * 城市ID搜索器
  45. * @param Model $query
  46. * @param $value
  47. * @param $data
  48. */
  49. public function searchCityIdAttr($query, $value)
  50. {
  51. $query->where('city_id', $value);
  52. }
  53. /**
  54. * 模板id搜索
  55. * @param Model $query
  56. * @param $value
  57. */
  58. public function searchTempIdAttr($query, $value)
  59. {
  60. $query->where('temp_id', $value);
  61. }
  62. /**
  63. * uniqid 搜索器
  64. * @param Model $query
  65. * @param $value
  66. */
  67. public function searchUniqidAttr($query, $value)
  68. {
  69. if (is_array($value)) {
  70. $query->whereIn('uniqid', $value);
  71. } else {
  72. $query->where('uniqid', $value);
  73. }
  74. }
  75. }