|
|
@@ -51,11 +51,18 @@ class U8ThirtyPartyDatabaseServerService extends Service
|
|
|
// U8 中 DispatchList 是发货单主表,DispatchLists 是子表
|
|
|
$pendingData = $db->table('DispatchList as H')
|
|
|
->join('DispatchLists as D', 'H.DLID', '=', 'D.DLID')
|
|
|
- ->where('H.cMemo', $cMemo)
|
|
|
- ->where('H.dDate', '<=', '2026-03-31')
|
|
|
+ ->where('H.cMemo', '接口生成')
|
|
|
+ ->where('H.dDate', '>=', '2026-04-01')
|
|
|
+ ->where('H.dDate', '<=', '2026-04-30')
|
|
|
+ ->whereNotExists(function ($query) use ($db) {
|
|
|
+ $query->select($db->raw(1))
|
|
|
+ ->from('IA_SA_UnAccountVouch as IA')
|
|
|
+ ->whereRaw('IA.IDUN = H.DLID')
|
|
|
+ ->whereRaw('IA.IDSUN = D.iDLsid');
|
|
|
+ })
|
|
|
->select([
|
|
|
- 'H.DLID as IDUN', // 发货单主表ID
|
|
|
- 'D.iDLsid as IDSUN', // 发货单子表ID
|
|
|
+ 'H.DLID as IDUN', // 发货单主表ID
|
|
|
+ 'D.iDLsid as IDSUN', // 发货单子表ID
|
|
|
])
|
|
|
->get();
|
|
|
|
|
|
@@ -70,7 +77,6 @@ class U8ThirtyPartyDatabaseServerService extends Service
|
|
|
'IDSUN' => $row->IDSUN,
|
|
|
'cVouTypeUN' => '05', // 写死固定值
|
|
|
'cBustypeUN' => '分期收款', // 写死固定值
|
|
|
- // 如果该表有其他必填字段(如日期、仓库等),请在此补充
|
|
|
];
|
|
|
}
|
|
|
|