(SELECT SUM(reservation_num) FROM logpm_distribution_reservation_stocklist WHERE reservation_id = ldr.id ) inventoryNub,
IFNULL((SELECT SUM(loaded_nub) FROM logpm_distribution_loadscan WHERE reservation_id = lds.reservation_id AND is_abnormal_loading != 2 AND is_deleted = 0 ),0) + IFNULL((SELECT SUM(loaded_nub) FROM logpm_distribution_loadscaninvn WHERE reservation_id = lds.reservation_id AND scan_status != 1 AND is_deleted = 0 ),0) AS loadingNub,
IFNULL((SELECT SUM(stock_quantity) FROM logpm_distribution_stock WHERE reservation_id = lds.reservation_id AND is_deleted = 0 ),0) AS stockupNum
IFNULL((SELECT SUM(stock_quantity) FROM logpm_distribution_stock WHERE reservation_id = lds.reservation_id AND is_deleted = 0 ),0) AS stockupNum,
(SELECT
GROUP_CONCAT( DISTINCT lwga.qr_code ) stockupArea
FROM
logpm_distribution_signfor AS sign
LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = sign.reservation_id
LEFT JOIN logpm_warehouse_goods_allocation AS lwga ON lds.stockup_area_id = lwga.id
WHERE
sign.reservation_id = ldr.id
GROUP BY
sign.delivery_id) AS stockupArea
FROM
logpm_distribution_signfor lds
LEFT JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id