diff --git a/SolarPower/Controllers/OperationController.cs b/SolarPower/Controllers/OperationController.cs index 33bc534..04caffd 100644 --- a/SolarPower/Controllers/OperationController.cs +++ b/SolarPower/Controllers/OperationController.cs @@ -643,7 +643,7 @@ namespace SolarPower.Controllers OperationRecordPersonnel operationRecordPersonnel = new OperationRecordPersonnel(); operationRecordPersonnel.OperationRecordId = id; operationRecordPersonnel.UserId = op; - + operationRecordPersonnel.CreatedBy = myUser.Id; insertOperationRecordPersonnels.Add(operationRecordPersonnel); } @@ -651,6 +651,7 @@ namespace SolarPower.Controllers { "OperationRecordId", "UserId", + "CreatedBy" }; await operationRepository.AddOperationRecordPersonnelAsync(insertOperationRecordPersonnels, operationRecordPersonnelProperties); diff --git a/SolarPower/Repository/Implement/ElectricitySoldRecordRepository.cs b/SolarPower/Repository/Implement/ElectricitySoldRecordRepository.cs index 5573c76..8865c1b 100644 --- a/SolarPower/Repository/Implement/ElectricitySoldRecordRepository.cs +++ b/SolarPower/Repository/Implement/ElectricitySoldRecordRepository.cs @@ -122,7 +122,7 @@ namespace SolarPower.Repository.Implement var sql = @$"SELECT aa.StartAt,aa.EndAt,aa.Kwh actualkwh,aa.Money actualMoney,SUM(pd.TODAYKWH) realKWH,SUM(pd.MONEY) realMoney,ps.Estimate_kwh CBAkwh,ps.EstimateEfficacy CBAeff ,ps.GeneratingCapacity capacity ,ps.PowerRate rate FROM power_station_history_day pd - LEFT JOIN ( SELECT er.* FROM electricity_sold_record er WHERE {sqlwhere} AND er.Deleted = 0 ) aa + LEFT JOIN ( SELECT er.* FROM electricity_sold_record er WHERE {sqlwhere} AND er.Deleted = 0 AND er.PowerstationId = {info.PowerstationId}) aa ON aa.PowerstationId = pd.PowerStationId LEFT JOIN power_station ps ON ps.Id = pd.PowerStationId WHERE pd.TIMESTAMP BETWEEN aa.StartAt AND aa.EndAt AND ps.Id = {info.PowerstationId} GROUP BY aa.Id"; diff --git a/SolarPower/Views/PowerStation/_UploadImage.cshtml b/SolarPower/Views/PowerStation/_UploadImage.cshtml index 7c6a288..dd89116 100644 --- a/SolarPower/Views/PowerStation/_UploadImage.cshtml +++ b/SolarPower/Views/PowerStation/_UploadImage.cshtml @@ -41,7 +41,7 @@