|
|
@@ -45,12 +45,6 @@ abstract class ActivityCalc {
|
|
|
$products = $products ? $products->toArray() : [];
|
|
|
return $products;
|
|
|
}
|
|
|
-
|
|
|
- protected function getPoolKey()
|
|
|
- {
|
|
|
- $KEY = 'activity:pool:';
|
|
|
- return $KEY . $this->getName();
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 用统一的架构来计算输赢
|
|
|
@@ -160,12 +154,11 @@ abstract class ActivityCalc {
|
|
|
}
|
|
|
// 如果只有 1 件商品
|
|
|
if ($pNum == 1) {
|
|
|
- $KEY = 'activity:pool';
|
|
|
// 此时,订单必为 loser
|
|
|
// 47% 概率胜
|
|
|
$itWin = false; // 这单胜了 ?
|
|
|
$dice = mt_rand(0, 100);
|
|
|
- if ( $dice < 47) {
|
|
|
+ if ( $dice < 60) {
|
|
|
$itWin = true;
|
|
|
}
|
|
|
|
|
|
@@ -183,7 +176,7 @@ abstract class ActivityCalc {
|
|
|
}
|
|
|
(new ActivityPool)->hincr_by_float('', $this->getName(), floatval($profit));
|
|
|
|
|
|
- infolog($this->getName() . ": single order[product]. dice:$dice, remain:$poolBalance, pay_count:" . $products[0]['pay_count']);
|
|
|
+ warnlog($this->getName() . ": single order[product]. dice:$dice, remain:$poolBalance, pay_count:" . $products[0]['pay_count']);
|
|
|
}
|
|
|
|
|
|
$result = $this->getResult($winners == $left);
|