From d47ea5ee786f6db4a8ffa35d3c5e4086d2f52476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=84=E5=A4=B4?= Date: Fri, 19 Apr 2024 17:21:08 +0800 Subject: [PATCH] QueryLatestStep --- ProductionSystem_Service/ProductStepService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProductionSystem_Service/ProductStepService.cs b/ProductionSystem_Service/ProductStepService.cs index 0124ecb..3a17f0f 100644 --- a/ProductionSystem_Service/ProductStepService.cs +++ b/ProductionSystem_Service/ProductStepService.cs @@ -44,8 +44,8 @@ namespace ProductionSystem_Service return db.Queryable(). Where(m => m.StepName == stepName && m.EquipmentName == equipmentName - && m.ProductType == productType) - .Where(x=>x.ProductBarcode==productCode) + && m.ProductType == productType && m.ProductBarcode==productCode) + .OrderByDescending(x=>x.CreateTime) .First(); }