This commit is contained in:
aozhiwei 2022-06-24 16:52:58 +08:00
parent a24f19601c
commit 48ca58070c

View File

@ -79,13 +79,15 @@ class Phase3Box extends BaseModel {
{
$space = 0;
for ($i = 0; $i < count($randArr); ++$i) {
$randArr[$i] += $space;
$space += $randArr[$i];
$randArr[$i] = $space;
}
}
if ($row && $row['state'] == self::INIT_STATE) {
$rnd = rand(0, 99);
$rewardIdx = -1;
error_log(json_encode($randArr));
error_log('rand:' . $rnd);
for ($i = 0; $i < count($randArr); ++$i) {
if ($rnd <= $randArr[$i]) {
$rewardIdx = $i;