| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace tw\async\activities;
- use think\facade\Config;
- // use crmeb\services\async\ActivityCalc;
- /**
- * 抢清仓活动
- *
- * 玩法:
- * 指定一个清仓分类. 该分类下的所有商品在一个周期内一起开奖,
- * 中奖的退款并赔款, 未中奖的安排发货.
- *
- * 在宣传中, 抢到的发货, 未抢到的退款并赔款.
- *
- * Class ClearanceCalc
- * @package crmeb\services\async
- */
- class ClearanceCalc extends ActivityCalc{
- // 活动代号
- protected static $NAME = 'clr';
- protected function getId() {
- return Config::get('activity.clearance_cate_id');
- }
- protected function getName() {
- return self::$NAME;
- }
- protected function getNameCN() {
- return '神抢手';
- }
- // 赔款比例, 为利润的比例
- protected function repRate() {
- return 0.3;
- }
- protected function getMinimalProductNum()
- {
- return 1;
- }
- protected function getResult($leftwin=true) {
- return 0;
- }
- /**
- * 分边函数,返回 true 分到左边
- *
- */
- protected function leaningJudge($index, $product, $attr) {
- return $index % 2 != 0;
- }
- }
|