diff --git a/app/Models/GoodPool.php b/app/Models/GoodPool.php index 269d17f0..ad271494 100755 --- a/app/Models/GoodPool.php +++ b/app/Models/GoodPool.php @@ -30,7 +30,13 @@ class GoodPool extends Model public static function _rand($sClass) { - $aGood = self::where("class", $sClass)->get()->toArray(); + $oGood = self::where("class", $sClass)->get(); + + if ($oGood->isEmpty()) { + return []; + } + + $aGood = $oGood->toArray(); $iGoodRandKey = array_rand($aGood);