From fa6f685e138ac1757605803ac3b1b3ebf5222ab5 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sat, 6 Jan 2024 11:22:12 +0100 Subject: [PATCH] Fix "categories" table not found error --- application/models/Services_model.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/models/Services_model.php b/application/models/Services_model.php index 527eb1ca..388610ea 100644 --- a/application/models/Services_model.php +++ b/application/models/Services_model.php @@ -96,7 +96,9 @@ class Services_model extends EA_Model // If a category was provided then make sure it really exists in the database. if (!empty($service['id_service_categories'])) { - $count = $this->db->get_where('categories', ['id' => $service['id_service_categories']])->num_rows(); + $count = $this->db + ->get_where('service_categories', ['id' => $service['id_service_categories']]) + ->num_rows(); if (!$count) { throw new InvalidArgumentException( @@ -387,7 +389,7 @@ class Services_model extends EA_Model foreach ($resources as $resource) { $service['category'] = match ($resource) { 'category' => $this->db - ->get_where('categories', [ + ->get_where('service_categories', [ 'id' => $service['id_service_categories'] ?? ($service['serviceCategoryId'] ?? null), ]) ->row_array(),