This commit is contained in:
aozhiwei 2024-08-01 17:29:28 +08:00
parent 2b266d045a
commit 9d327bcaad

View File

@ -88,7 +88,8 @@ class BigwheelController extends BaseAuthedController {
mt\Bigwheel::traverseMeta(
function ($meta) use(&$data, &$item1Hash, &$item2Hash, &$item1Arr, &$item2Arr) {
$gridRef = null;
$this->getGridRefByGridId($data, $meta['id'], $girdRef);
$this->getGridRefByGridId($data, $meta['id'], $gridRef);
if (empty($gridRef)) {
switch ($meta['Wheel_type']) {
case 1:{
$item1Hash[$meta['id']] = $meta;
@ -107,6 +108,7 @@ class BigwheelController extends BaseAuthedController {
}
break;
}
}
return true;
});
if (count($item1Hash) != count($item2Hash) ||
@ -141,7 +143,7 @@ class BigwheelController extends BaseAuthedController {
{
$rnd = rand(0, $randSpace1 - 1);
foreach ($item1Arr as $item) {
if ($item['weight'] <= $rnd) {
if ($rnd <= $item['weight']) {
$item1 = $item;
break;
}
@ -151,7 +153,7 @@ class BigwheelController extends BaseAuthedController {
{
$rnd = rand(0, $randSpace2 - 2);
foreach ($item2Arr as $item) {
if ($item['weight'] <= $rnd) {
if ($rnd <= $item['weight']) {
$item2 = $item;
break;
}