ClearanceCalc.php 1005 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace crmeb\services\async;
  3. use think\facade\Config;
  4. use crmeb\services\async\ActivityCalc;
  5. /**
  6. * 抢清仓活动
  7. *
  8. * 玩法:
  9. * 指定一个清仓分类. 该分类下的所有商品在一个周期内一起开奖,
  10. * 中奖的退款并赔款, 未中奖的安排发货.
  11. *
  12. * 在宣传中, 抢到的发货, 未抢到的退款并赔款.
  13. *
  14. * Class ClearanceCalc
  15. * @package crmeb\services\async
  16. */
  17. class ClearanceCalc extends ActivityCalc{
  18. // 活动代号
  19. protected static $NAME = 'clr';
  20. protected function getId() {
  21. return Config::get('activity.clearance_cate_id');
  22. }
  23. protected function getName() {
  24. return self::$NAME;
  25. }
  26. protected function getNameCN() {
  27. return '抢神';
  28. }
  29. protected function repRate() {
  30. return 0.2;
  31. }
  32. protected function getResult($leftwin=true) {
  33. return 0;
  34. }
  35. protected function leaningJudge($index, $product, $attr) {
  36. return $index % 2 != 0;
  37. }
  38. }