From b5265870be57f740cd210e327c8b78ae324a2156 Mon Sep 17 00:00:00 2001 From: objecttothis Date: Tue, 24 Mar 2020 14:21:57 +0400 Subject: [PATCH] More descriptive alias --- application/models/Attribute.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/models/Attribute.php b/application/models/Attribute.php index 9f0e02662..64f15f189 100644 --- a/application/models/Attribute.php +++ b/application/models/Attribute.php @@ -340,10 +340,10 @@ class Attribute extends CI_Model $this->db->trans_start(); - $query = 'UPDATE ospos_attribute_values a '; - $query .= 'INNER JOIN ospos_attribute_links b '; - $query .= 'ON a.attribute_id = b.attribute_id '; - $query .= "SET b.attribute_id = IF((a.attribute_value IN('FALSE','0','') OR (a.attribute_value IS NULL)), $checkbox_attribute_values[0], $checkbox_attribute_values[1]) "; + $query = 'UPDATE ospos_attribute_values values '; + $query .= 'INNER JOIN ospos_attribute_links links '; + $query .= 'ON values.attribute_id = links.attribute_id '; + $query .= "SET links.attribute_id = IF((values.attribute_value IN('FALSE','0','') OR (values.attribute_value IS NULL)), $checkbox_attribute_values[0], $checkbox_attribute_values[1]) "; $query .= 'WHERE definition_id = ' . $this->db->escape($definition_id); $success = $this->db->query($query); @@ -373,10 +373,10 @@ class Attribute extends CI_Model $this->db->trans_start(); - $query = 'UPDATE ospos_attribute_values a '; - $query .= 'INNER JOIN ospos_attribute_links b '; - $query .= 'ON a.attribute_id = b.attribute_id '; - $query .= "SET b.attribute_id = IF((a.attribute_value IN('FALSE','0','') OR (a.attribute_value IS NULL)), $checkbox_attribute_values[0], $checkbox_attribute_values[1]) "; + $query = 'UPDATE ospos_attribute_values values '; + $query .= 'INNER JOIN ospos_attribute_links links '; + $query .= 'ON values.attribute_id = links.attribute_id '; + $query .= "SET links.attribute_id = IF((values.attribute_value IN('FALSE','0','') OR (values.attribute_value IS NULL)), $checkbox_attribute_values[0], $checkbox_attribute_values[1]) "; $query .= 'WHERE definition_id = ' . $this->db->escape($definition_id); $success = $this->db->query($query);