Bläddra i källkod

Adjust green for roasted calculation. The performance is the same, data is the same out to at least 15 decimal places (differences at that point cannot possibly alter reported values), and there is less SQL to read and understand this way.

Neal Wilson 12 år sedan
förälder
incheckning
29c68554b5
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1
    1
      config/Reports/cogr.xml

+ 1
- 1
config/Reports/cogr.xml Visa fil

@@ -49,7 +49,7 @@
49 49
 						print("Error 1");
50 50
 					}
51 51
 				}
52
-				query.prepare("SELECT 1 / (-1 * (min((unroasted_total_quantity - roasted_quantity)  / unroasted_total_quantity) - 1)), 1 / (-1 * (max((unroasted_total_quantity - roasted_quantity)/unroasted_total_quantity) - 1)), 1 / (-1 * (avg((unroasted_total_quantity - roasted_quantity) / unroasted_total_quantity) - 1)) FROM roasting_log WHERE roasted_id = :ri AND unroasted_id = :gi AND unroasted_total_quantity > 0 AND roasted_quantity > 0 AND approval = true");
52
+				query.prepare("SELECT min(unroasted_total_quantity / roasted_quantity), max(unroasted_total_quantity / roasted_quantity), avg(unroasted_total_quantity / roasted_quantity) FROM roasting_log WHERE roasted_id = :ri AND unroasted_id = :gi AND unroasted_total_quantity > 0 AND roasted_quantity > 0 AND approval = true");
53 53
 				var mins = new Array();
54 54
 				var maxes = new Array();
55 55
 				var means = new Array();

Laddar…
Avbryt
Spara