Subversion Repositories SmartDukaan

Rev

Rev 34315 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34315 Rev 37858
Line 23... Line 23...
23
                        "                      JOIN cs.position p ON p.auth_user_id = au.id" +
23
                        "                      JOIN cs.position p ON p.auth_user_id = au.id" +
24
                        "                      JOIN cs.partner_position pp ON pp.position_id = p.id" +
24
                        "                      JOIN cs.partner_position pp ON pp.position_id = p.id" +
25
                        "                      JOIN fofo.fofo_store fs ON fs.id = pp.partner_id" +
25
                        "                      JOIN fofo.fofo_store fs ON fs.id = pp.partner_id" +
26
                        "                      JOIN fofo.monthly_target mtgt ON mtgt.fofo_id = fs.id" +
26
                        "                      JOIN fofo.monthly_target mtgt ON mtgt.fofo_id = fs.id" +
27
                        "             WHERE pp.partner_id != 0" +
27
                        "             WHERE pp.partner_id != 0" +
28
                        "               AND DATE_FORMAT(mtgt.on_date, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')" +
28
                        "               AND mtgt.on_date >= :targetMonthStart AND mtgt.on_date < :targetMonthEnd" +
29
                        "               AND p.category_id = 18" +
29
                        "               AND p.category_id = 18" +
30
                        "               AND p.escalation_type = 'L1'" +
30
                        "               AND p.escalation_type = 'L1'" +
31
                        "             GROUP BY au.id, fs.id" +
31
                        "             GROUP BY au.id, fs.id" +
32
                        "" +
32
                        "" +
33
                        "             UNION ALL" +
33
                        "             UNION ALL" +
Line 42... Line 42...
42
                        "                      JOIN cs.partner_position pp ON pp.position_id = p.id" +
42
                        "                      JOIN cs.partner_position pp ON pp.position_id = p.id" +
43
                        "                      JOIN cs.partner_region pr ON pr.region_id = pp.region_id" +
43
                        "                      JOIN cs.partner_region pr ON pr.region_id = pp.region_id" +
44
                        "                      JOIN fofo.fofo_store fs ON fs.id = pr.fofo_id" +
44
                        "                      JOIN fofo.fofo_store fs ON fs.id = pr.fofo_id" +
45
                        "                      JOIN fofo.monthly_target mtgt ON mtgt.fofo_id = fs.id" +
45
                        "                      JOIN fofo.monthly_target mtgt ON mtgt.fofo_id = fs.id" +
46
                        "             WHERE pp.partner_id = 0" +
46
                        "             WHERE pp.partner_id = 0" +
47
                        "               AND DATE_FORMAT(mtgt.on_date, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')" +
47
                        "               AND mtgt.on_date >= :targetMonthStart AND mtgt.on_date < :targetMonthEnd" +
48
                        "               AND p.category_id = 18" +
48
                        "               AND p.category_id = 18" +
49
                        "               AND p.escalation_type = 'L1'" +
49
                        "               AND p.escalation_type = 'L1'" +
50
                        "             GROUP BY au.id, fs.id" +
50
                        "             GROUP BY au.id, fs.id" +
51
                        "         ) td" +
51
                        "         ) td" +
52
                        "" +
52
                        "" +