StorePink.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\admin\model\ump;
  12. use basic\ModelBasic;
  13. use traits\ModelTrait;
  14. class StorePink extends ModelBasic
  15. {
  16. use ModelTrait;
  17. /**
  18. * 获取当前产品参与的人数
  19. * @param int $combinationId
  20. * @return int|string
  21. */
  22. public static function getCountPeopleAll($combinationId = 0)
  23. {
  24. if (!$combinationId) return self::count();
  25. return self::where('cid', $combinationId)->count();
  26. }
  27. /**
  28. * 获取当前产品参与的团数
  29. * @param int $combinationId
  30. * @return int|string
  31. */
  32. public static function getCountPeoplePink($combinationId = 0)
  33. {
  34. if (!$combinationId) return self::where('k_id', 0)->count();
  35. return self::where('cid', $combinationId)->where('k_id', 0)->count();
  36. }
  37. }