fix: 修复设备标识提取、单程票逻辑及前端行程块显示
- 调整后端设备标识提取优先级,优先使用machine_id/machineId字段 - 修复单程票检票时剩余乘车次数的计算逻辑,单程票使用后直接置0 - 前端为行程块添加ID,切换单程票模式时隐藏该块并重置乘车次数为1
This commit is contained in:
@@ -504,7 +504,7 @@ router.post('/tickets/record', async (req, res) => {
|
||||
const train_type = String(b.train_type || b.trainType || b.type || '').trim();
|
||||
const cost = Number(b.cost || 0) || 0;
|
||||
const station_code = String(b.station_code || b.stationCode || '').trim();
|
||||
const device = String(b.device || b.device_id || b.deviceId || 'unknown');
|
||||
const device = String(b.machine_id || b.machineId || b.device || b.device_id || b.deviceId || 'unknown');
|
||||
|
||||
const trips_total = (b.trips_total == null) ? undefined : (Number(b.trips_total) || 0);
|
||||
const trips_remaining = (b.trips_remaining == null) ? undefined : (Number(b.trips_remaining) || 0);
|
||||
|
||||
Reference in New Issue
Block a user