mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-19 23:07:57 -05:00
Merge pull request #2806 from opensourcepos/values-keyword-patch-checkbox
Values is a mysql keyword
This commit is contained in:
@@ -373,11 +373,11 @@ class Attribute extends CI_Model
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
$query = 'UPDATE ospos_attribute_values values ';
|
||||
$query = 'UPDATE ospos_attribute_values vals ';
|
||||
$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);
|
||||
$query .= 'ON vals.attribute_id = links.attribute_id ';
|
||||
$query .= "SET links.attribute_id = IF((vals.attribute_value IN('FALSE','0','') OR (vals.attribute_value IS NULL)), $checkbox_attribute_values[0], $checkbox_attribute_values[1]) ";
|
||||
$query .= 'WHERE links.definition_id = ' . $this->db->escape($definition_id);
|
||||
$success = $this->db->query($query);
|
||||
|
||||
$this->db->trans_complete();
|
||||
@@ -664,4 +664,4 @@ class Attribute extends CI_Model
|
||||
|
||||
return $this->db->update('attribute_definitions', array('deleted' => 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user