跑通consumer下单之后派单给delivery2
This commit is contained in:
@@ -645,7 +645,16 @@ async function listWorkerTaskIds(): Promise<Array<string>> {
|
||||
return result
|
||||
}
|
||||
}
|
||||
const legacyResponse = await supa.from('hss_service_orders').select('id').eq('current_staff_id', userId).order('created_at', { ascending: false }).execute()
|
||||
let staffProfileId = ''
|
||||
const staffResponse = await supa.from('ml_delivery_staff').select('id').eq('uid', userId).limit(1).execute()
|
||||
if (staffResponse.error == null && staffResponse.data != null) {
|
||||
const staffRows = staffResponse.data as Array<any>
|
||||
if (staffRows.length > 0) {
|
||||
staffProfileId = readString(staffRows[0], 'id')
|
||||
}
|
||||
}
|
||||
const legacyStaffId = staffProfileId != '' ? staffProfileId : userId
|
||||
const legacyResponse = await supa.from('hss_service_orders').select('id').eq('current_staff_id', legacyStaffId).order('created_at', { ascending: false }).execute()
|
||||
if (legacyResponse.error != null || legacyResponse.data == null) {
|
||||
return [] as Array<string>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user