| Line 24... |
Line 24... |
| 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 |
" WHERE pp.partner_id != 0" +
|
26 |
" WHERE pp.partner_id != 0" +
|
| 27 |
" AND p.category_id = 18" +
|
27 |
" AND p.category_id = 18" +
|
| 28 |
" AND p.escalation_type = 'L1'" +
|
28 |
" AND p.escalation_type = 'L1'" +
|
| 29 |
" AND fs.active = 1" +
|
29 |
" AND fs.store_status in ('ACTIVE','PAUSED')" +
|
| 30 |
" AND fs.internal = false" +
|
30 |
" AND fs.internal = false" +
|
| 31 |
" UNION ALL" +
|
31 |
" UNION ALL" +
|
| 32 |
" SELECT au.id AS auth_id, fs.id AS fofo_id, fs.warehouse_id" +
|
32 |
" SELECT au.id AS auth_id, fs.id AS fofo_id, fs.warehouse_id" +
|
| 33 |
" FROM auth.auth_user au" +
|
33 |
" FROM auth.auth_user au" +
|
| 34 |
" JOIN cs.position p ON p.auth_user_id = au.id" +
|
34 |
" JOIN cs.position p ON p.auth_user_id = au.id" +
|
| Line 36... |
Line 36... |
| 36 |
" JOIN cs.region r ON pp.region_id = r.id" +
|
36 |
" JOIN cs.region r ON pp.region_id = r.id" +
|
| 37 |
" JOIN cs.partner_region pr ON pr.region_id = pp.region_id" +
|
37 |
" JOIN cs.partner_region pr ON pr.region_id = pp.region_id" +
|
| 38 |
" JOIN fofo.fofo_store fs ON fs.id = pr.fofo_id" +
|
38 |
" JOIN fofo.fofo_store fs ON fs.id = pr.fofo_id" +
|
| 39 |
" WHERE pp.partner_id = 0" +
|
39 |
" WHERE pp.partner_id = 0" +
|
| 40 |
" AND p.category_id = 18" +
|
40 |
" AND p.category_id = 18" +
|
| 41 |
" AND fs.active = 1" +
|
41 |
" AND fs.store_status in ('ACTIVE','PAUSED')" +
|
| 42 |
" AND fs.internal = false" +
|
42 |
" AND fs.internal = false" +
|
| 43 |
" AND p.escalation_type = 'L1') a" +
|
43 |
" AND p.escalation_type = 'L1') a" +
|
| 44 |
" JOIN transaction.order odr ON odr.customer_id = a.fofo_id" +
|
44 |
" JOIN transaction.order odr ON odr.customer_id = a.fofo_id" +
|
| 45 |
" JOIN transaction.lineitem li ON li.order_id = odr.id" +
|
45 |
" JOIN transaction.lineitem li ON li.order_id = odr.id" +
|
| 46 |
" WHERE a.auth_id = :authId" +
|
46 |
" WHERE a.auth_id = :authId" +
|