优化工单资料与审核展示
This commit is contained in:
@@ -82,7 +82,8 @@ export type WorkerCancelRequestRow = {
|
||||
created_at: string
|
||||
reviewed_at: string | null
|
||||
updated_at: string
|
||||
work_order_no?: string
|
||||
platform_order_id?: string
|
||||
shop_name?: string
|
||||
product_name?: string
|
||||
worker_username?: string
|
||||
worker_display_name?: string
|
||||
@@ -103,6 +104,7 @@ export type WorkerOrderFeedbackRow = {
|
||||
updated_at: string
|
||||
work_order_no?: string
|
||||
product_name?: string
|
||||
shop_name?: string
|
||||
worker_username?: string
|
||||
worker_display_name?: string
|
||||
share_quantity?: number | null
|
||||
|
||||
@@ -63,13 +63,22 @@ const WORK_ORDER_SHARE_SELECT = `
|
||||
const WORKER_CANCEL_REQUEST_SELECT = `
|
||||
SELECT
|
||||
cr.*,
|
||||
wo.work_order_no,
|
||||
COALESCE(NULLIF(BTRIM(wo.platform_order_id), ''), o.platform_order_id, ft.platform_order_id, '') AS platform_order_id,
|
||||
COALESCE(
|
||||
NULLIF(BTRIM(o.shop_name), ''),
|
||||
NULLIF(BTRIM(o.shop_id), ''),
|
||||
NULLIF(BTRIM(ft.shop_name), ''),
|
||||
NULLIF(BTRIM(ft.shop_id), ''),
|
||||
''
|
||||
) AS shop_name,
|
||||
wo.product_name,
|
||||
wu.username AS worker_username,
|
||||
wu.display_name AS worker_display_name,
|
||||
wos.quantity AS share_quantity
|
||||
FROM worker_order_cancel_requests cr
|
||||
INNER JOIN work_orders wo ON wo.id = cr.work_order_id
|
||||
LEFT JOIN orders o ON o.id = wo.order_id
|
||||
LEFT JOIN fulfillment_tasks ft ON ft.id = wo.task_id
|
||||
INNER JOIN worker_users wu ON wu.id = cr.worker_id
|
||||
LEFT JOIN work_order_shares wos ON wos.id = cr.work_order_share_id
|
||||
`
|
||||
@@ -79,11 +88,20 @@ const WORKER_ORDER_FEEDBACK_SELECT = `
|
||||
wf.*,
|
||||
COALESCE(NULLIF(BTRIM(wo.platform_order_id), ''), wo.work_order_no) AS work_order_no,
|
||||
wo.product_name,
|
||||
COALESCE(
|
||||
NULLIF(BTRIM(o.shop_name), ''),
|
||||
NULLIF(BTRIM(o.shop_id), ''),
|
||||
NULLIF(BTRIM(ft.shop_name), ''),
|
||||
NULLIF(BTRIM(ft.shop_id), ''),
|
||||
''
|
||||
) AS shop_name,
|
||||
wu.username AS worker_username,
|
||||
wu.display_name AS worker_display_name,
|
||||
wos.quantity AS share_quantity
|
||||
FROM worker_order_feedbacks wf
|
||||
INNER JOIN work_orders wo ON wo.id = wf.work_order_id
|
||||
LEFT JOIN orders o ON o.id = wo.order_id
|
||||
LEFT JOIN fulfillment_tasks ft ON ft.id = wo.task_id
|
||||
INNER JOIN worker_users wu ON wu.id = wf.worker_id
|
||||
LEFT JOIN work_order_shares wos ON wos.id = wf.work_order_share_id
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user