ShippingTemplatesFree.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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\product\shipping;
  12. use crmeb\traits\ModelTrait;
  13. use crmeb\basic\BaseModel;
  14. use think\Model;
  15. /**
  16. * 包邮Model
  17. * Class ShippingTemplatesFree
  18. * @package app\model\product\shipping
  19. */
  20. class ShippingTemplatesFree 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_free';
  33. /**
  34. * 城市ID搜索器
  35. * @param Model $query
  36. * @param $value
  37. * @param $data
  38. */
  39. public function searchCityIdAttr($query, $value)
  40. {
  41. $query->where('city_id', $value);
  42. }
  43. /**
  44. * 模板id搜索
  45. * @param Model $query
  46. * @param $value
  47. */
  48. public function searchTempIdAttr($query, $value)
  49. {
  50. $query->where('temp_id', $value);
  51. }
  52. /**
  53. * uniqid 搜索器
  54. * @param Model $query
  55. * @param $value
  56. */
  57. public function searchUniqidAttr($query, $value)
  58. {
  59. if (is_array($value)) {
  60. $query->whereIn('uniqid', $value);
  61. } else {
  62. $query->where('uniqid', $value);
  63. }
  64. }
  65. }