StorePink.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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\order;
  12. use crmeb\basic\BaseModel;
  13. use crmeb\traits\ModelTrait;
  14. use think\Model;
  15. /**
  16. * Class StorePink
  17. * @package app\model\order
  18. */
  19. class StorePink 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 = 'store_pink';
  32. protected $insert = ['add_time'];
  33. /**
  34. * 创建时间修改器
  35. * @return int
  36. */
  37. protected function setAddTimeAttr()
  38. {
  39. return time();
  40. }
  41. /**
  42. * 拼团订单id搜索器
  43. * @param Model $query
  44. * @param $value
  45. * @param $data
  46. */
  47. public function searchOrderIdKeyAttr($query, $value, $data)
  48. {
  49. $query->whereIn('order_id_key', $value);
  50. }
  51. }