--- Recommend.php.before +++ Recommend.php.after @@ -306,25 +306,25 @@ } if (($item['dishe']['category_two'] == 9 || $item['dishe']['category_two'] == 7) && $sssc_score == 0){ $food_infos = $this->getRatioFoods($item['dishe']['id']); - if ($food_infos['category_two'] == 38){ + if (($food_infos['category_two'] ?? null) == 38){ $sssc_score = 2; } - if ($dl_score == 0 && $food_infos['category'] == 12){ + if ($dl_score == 0 && ($food_infos['category'] ?? null) == 12){ $dl_score = 2; } } if (($item['dishe']['category_two'] == 10 || $item['dishe']['category_two'] == 9) && $hcp_score == 0){ $food_infos = $this->getRatioFoods($item['dishe']['id']); - if ($food_infos['category'] == 5){ + if (($food_infos['category'] ?? null) == 5){ $hcp_score = 2; } - if ($dl_score == 0 && $food_infos['category'] == 12){ + if ($dl_score == 0 && ($food_infos['category'] ?? null) == 12){ $dl_score = 2; } } if ($dl_score == 0){ $food_infos = $this->getRatioFoods($item['dishe']['id']); - if ($food_infos['category'] == 12){ + if (($food_infos['category'] ?? null) == 12){ $dl_score = 2; } }