| Line 278... |
Line 278... |
| 278 |
datediff(o.first_dlvyatmp_timestamp, o.created_timestamp) as first_delivery_attempt,
|
278 |
datediff(o.first_dlvyatmp_timestamp, o.created_timestamp) as first_delivery_attempt,
|
| 279 |
datediff(o.delivery_timestamp, o.created_timestamp) as actual_delivery_days,
|
279 |
datediff(o.delivery_timestamp, o.created_timestamp) as actual_delivery_days,
|
| 280 |
datediff(o.delivery_timestamp, o.created_timestamp)-datediff(o.expected_delivery_time, o.created_timestamp) as actual_estimate_diff, o.delay_reason
|
280 |
datediff(o.delivery_timestamp, o.created_timestamp)-datediff(o.expected_delivery_time, o.created_timestamp) as actual_estimate_diff, o.delay_reason
|
| 281 |
from `order` o
|
281 |
from `order` o
|
| 282 |
left join lineitem l on (o.id = l.order_id)
|
282 |
left join lineitem l on (o.id = l.order_id)
|
| 283 |
left join (select * from payment.payment order by id desc) p on (o.transaction_id = p.merchantTxnId)
|
283 |
left join payment.payment p on (o.transaction_id = p.merchantTxnId and p.id=(select max(id) from payment.payment where merchantTxnId = o.transaction_id))
|
| 284 |
left join payment.paymentattribute pa on (p.id = pa.payment_id and pa.name = 'payMethod')
|
284 |
left join payment.paymentattribute pa on (p.id = pa.payment_id and pa.name = 'payMethod')
|
| 285 |
where o.status not in (0, 1)</sql>
|
285 |
where o.status not in (0, 1)</sql>
|
| 286 |
<limit>0</limit>
|
286 |
<limit>0</limit>
|
| 287 |
<lookup/>
|
287 |
<lookup/>
|
| 288 |
<execute_each_row>N</execute_each_row>
|
288 |
<execute_each_row>N</execute_each_row>
|