| | |
| | | code2.label as specialNeedsStr, |
| | | CONCAT(q.customer_province, q.customer_city,q.customer_region,q.customer_address) AS customerAddress, |
| | | (select Sum(COALESCE(oi.num, 0) * COALESCE(oi.supplier_price, 0)) |
| | | from t_order_item oi where order_id = q.id) supplierAmount |
| | | from t_order_item oi where order_id = q.id) supplierAmount, |
| | | (select Sum(oi.num) from t_order_item oi where order_id = q.id) saleNum |
| | | FROM t_order q |
| | | left join t_user u on q.create_by = u.id |
| | | LEFT JOIN (SELECT ct.label, ct.value from t_code_value ct where type_code = 'ORDER_STATUS_BACKEND') code ON q.status_backend = code.value |