| Line 157... |
Line 157... |
| 157 |
<connection>transactionDC_Prod</connection>
|
157 |
<connection>transactionDC_Prod</connection>
|
| 158 |
<sql>SELECT o.id 'order_id', o.customer_id, o.customer_pincode,
|
158 |
<sql>SELECT o.id 'order_id', o.customer_id, o.customer_pincode,
|
| 159 |
o.status 'order_status', o.total_amount,
|
159 |
o.status 'order_status', o.total_amount,
|
| 160 |
datediff(o.created_timestamp, '20101231') as date_id, hour(o.created_timestamp) as order_hour,
|
160 |
datediff(o.created_timestamp, '20101231') as date_id, hour(o.created_timestamp) as order_hour,
|
| 161 |
o.transaction_id, l.item_id, l.quantity, l.unit_price, l.transfer_price, p.gatewayId,
|
161 |
o.transaction_id, l.item_id, l.quantity, l.unit_price, l.transfer_price, p.gatewayId,
|
| - |
|
162 |
case when pa.value is null then case when p.gatewayId = 1 then 2099 when p.gatewayId = 2 then 1099 else null end else pa.value end 'payment_method',
|
| 162 |
pa.value 'payment_method', t.coupon_code, t.session_source,
|
163 |
t.coupon_code, t.session_source,
|
| 163 |
case when datediff(t.session_start_time, '20101231') > 0 then datediff(t.session_start_time, '20101231') else 1 end as session_start_date_id,
|
164 |
case when datediff(t.session_start_time, '20101231') > 0 then datediff(t.session_start_time, '20101231') else 1 end as session_start_date_id,
|
| 164 |
hour(t.session_start_time) as session_start_hour, aff.name aff_name
|
165 |
hour(t.session_start_time) as session_start_hour, aff.name aff_name
|
| 165 |
FROM `order` o
|
166 |
FROM `order` o
|
| 166 |
left join lineitem l on(o.id = l.order_id )
|
167 |
left join lineitem l on(o.id = l.order_id )
|
| 167 |
left join (select * from payment.payment order by id desc) p on (o.transaction_id = p.merchantTxnId)
|
168 |
left join (select * from payment.payment order by id desc) p on (o.transaction_id = p.merchantTxnId)
|