StoreBargainUserHelp.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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\activity\bargain;
  12. use crmeb\basic\BaseModel;
  13. use crmeb\traits\ModelTrait;
  14. use think\Model;
  15. /**
  16. * TODO 砍价帮砍Model
  17. * Class StoreBargainUserHelp
  18. * @package app\model\activity
  19. */
  20. class StoreBargainUserHelp extends BaseModel
  21. {
  22. /**
  23. * 数据表主键
  24. * @var string
  25. */
  26. protected $pk = 'id';
  27. /**
  28. * 模型名称
  29. * @var string
  30. */
  31. protected $name = 'store_bargain_user_help';
  32. use ModelTrait;
  33. /**
  34. * 用户搜索器
  35. * @param Model $query
  36. * @param $value
  37. * @param $data
  38. */
  39. public function searchUidAttr($query, $value, $data)
  40. {
  41. $query->where('uid', $value);
  42. }
  43. /**
  44. * 商品ID搜索器
  45. * @param Model $query
  46. * @param $value
  47. * @param $data
  48. */
  49. public function searchBargainIdAttr($query, $value, $data)
  50. {
  51. $query->where('bargain_id', $value);
  52. }
  53. /**
  54. * 砍价ID搜索器
  55. * @param $query
  56. * @param $value
  57. */
  58. public function searchBargainUserIdAttr($query, $value)
  59. {
  60. $query->where('bargain_user_id', $value);
  61. }
  62. /**
  63. * 砍价ID搜索器
  64. * @param $query
  65. * @param $value
  66. */
  67. public function searchTypeAttr($query, $value)
  68. {
  69. $query->where('type', $value);
  70. }
  71. }