Created
February 28, 2014 13:22
-
-
Save jmoren/9271007 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def stats | |
| @ivr = Smrt::Ivr.find(params[:id]) | |
| @stats = @ivr.action_flows | |
| @rules_by_containers = Smrt::IvrActionFlow.execute_query('SELECT container_name, name, SUM(case when rule_type = "invalid" then 1 else 0 end) AS invalid_rule, SUM(case when rule_type = "match" then 1 else 0 end) AS match_rule FROM ivr_dev.ivr_action_flows WHERE ivr_id = 2008 GROUP BY name;') | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mysql> SELECT name, input, count(input) from ivr_action_flows where ivr_id = 2008 and input IS NOT NULL group by input, name;
+---------+-------+--------------+
| name | input | count(input) |
+---------+-------+--------------+
| Primero | 1 | 7 |
| Segundo | 5 | 3 |
| Tercero | 8 | 1 |
+---------+-------+--------------+
3 rows in set (0.00 sec)