StorePink.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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\admin\model\ump;
  12. use basic\ModelBasic;
  13. use traits\ModelTrait;
  14. class StorePink extends ModelBasic{
  15. use ModelTrait;
  16. /**
  17. * 获取当前产品参与的人数
  18. * @param int $combinationId
  19. * @return int|string
  20. */
  21. public static function getCountPeopleAll($combinationId = 0){
  22. if(!$combinationId) return self::count();
  23. return self::where('cid',$combinationId)->count();
  24. }
  25. /**
  26. * 获取当前产品参与的团数
  27. * @param int $combinationId
  28. * @return int|string
  29. */
  30. public static function getCountPeoplePink($combinationId = 0){
  31. if(!$combinationId) return self::where('k_id',0)->count();
  32. return self::where('cid',$combinationId)->where('k_id',0)->count();
  33. }
  34. }