#393 legend fixed

parent 9c7a5da6
Showing with 2 additions and 7 deletions
......@@ -572,17 +572,12 @@ module.exports = {
},
/*
* Updates legend in student pictos
* legend is not updated for categories
* Updates legend in all student pictos for one id_grid
*/
update_legend: function(id_grid, legend_value, cb) {
var query='UPDATE stu_picto' +
' SET attributes = json_set(attributes, \'$.legend\',\''+legend_value+'\')' +
' WHERE id_grid=' + id_grid + ' AND ' +
' (json_extract(attributes, \'$.id_cat\') LIKE \'null\' AND ' +
' json_extract(attributes, \'$.coord_y\') = 0 OR ' +
' json_extract(attributes, \'$.id_cat\') NOT LIKE \'null\' AND ' +
' json_extract(attributes, \'$.coord_y\') >= 0);'
' WHERE id_grid=' + id_grid + ';'
;
StuPicto.query(query, function(err, result) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment