StoreBargainUserHelp.php 729 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\admin\model\ump;
  3. use crmeb\basic\BaseModel;
  4. use crmeb\traits\ModelTrait;
  5. /**
  6. * 砍价帮砍Model
  7. * Class StoreBargainUserHelp
  8. * @package app\admin\model\ump
  9. */
  10. class StoreBargainUserHelp extends BaseModel
  11. {
  12. /**
  13. * 数据表主键
  14. * @var string
  15. */
  16. protected $pk = 'id';
  17. /**
  18. * 模型名称
  19. * @var string
  20. */
  21. protected $name = 'store_bargain_user_help';
  22. use ModelTrait;
  23. /**
  24. * 获取砍价昌平帮忙砍价人数
  25. * @param int $bargainId
  26. * @return int|string
  27. */
  28. public static function getCountPeopleHelp($bargainId = 0){
  29. if(!$bargainId) return 0;
  30. return self::where('bargain_id',$bargainId)->count();
  31. }
  32. }