|
@@ -4105,6 +4105,7 @@ WHERE
|
|
|
|
|
|
SELECT
|
|
|
hr.DIId,
|
|
|
+ ntf.Country,
|
|
|
hr.City,
|
|
|
hr.HotelName,
|
|
|
sd.Name AS BookinSite,
|
|
@@ -4123,6 +4124,7 @@ FROM
|
|
|
AND CTable = 76
|
|
|
INNER JOIN Grp_DelegationInfo di ON hr.DiId = di.Id
|
|
|
LEFT JOIN Sys_SetData sd ON hr.ReservationsWebsite = sd.Id
|
|
|
+ LEFT JOIN Grp_NationalTravelFee ntf ON hr.AreaId = ntf.Id
|
|
|
WHERE
|
|
|
hr.IsDel = 0
|
|
|
AND di.TeamDid IN (38,39,40,1048)
|
|
@@ -4150,9 +4152,32 @@ WHERE
|
|
|
ORDER BY
|
|
|
hr.CheckInDate
|
|
|
", beginDt, endDt);
|
|
|
-
|
|
|
var data = await _sqlSugar.SqlQueryable<StatisticsHotelView>(sql).ToListAsync();
|
|
|
|
|
|
+ var hotelCountryGroupByData = data.GroupBy(x => x.Country)
|
|
|
+ .Select(g => new
|
|
|
+ {
|
|
|
+ Country = g.Key,
|
|
|
+ BookingRoomNum = g.Sum(x => x.RoomTotal),
|
|
|
+ hotelData = g.GroupBy(x => x.HotelName)
|
|
|
+ .Select(g1 => new
|
|
|
+ {
|
|
|
+ hotelName = g1.Key,
|
|
|
+ roomNights = g1.Sum(x => x.RoomNights),
|
|
|
+ roomTotal = g1.Sum(x => x.RoomTotal),
|
|
|
+ singleRoomCount = g1.Sum(x => x.SingleRoomCount),
|
|
|
+ doubleRoomCount = g1.Sum(x => x.DoubleRoomCount),
|
|
|
+ suiteRoomCount = g1.Sum(x => x.SuiteRoomCount),
|
|
|
+ otherRoomCount = g1.Sum(x => x.OtherRoomCount),
|
|
|
+ })
|
|
|
+ .ToList(),
|
|
|
+ linkGroupIds = g.Select(x => x.DIId).Distinct().ToList()
|
|
|
+
|
|
|
+ })
|
|
|
+ .OrderByDescending(x => x.BookingRoomNum)
|
|
|
+ .Take(10)
|
|
|
+ .ToList();
|
|
|
+
|
|
|
var hotelData = data.OrderBy(x => x.CityStr).ToList();
|
|
|
|
|
|
var hotelCityGroupByData = data.GroupBy(x => x.CityStr)
|
|
@@ -4202,8 +4227,7 @@ ORDER BY
|
|
|
.OrderByDescending(x => x.BookingRoomNum)
|
|
|
.ToList();
|
|
|
|
|
|
-
|
|
|
- return Ok(JsonView(true, "操作成功!", new { hotelCityData = hotelCityGroupByData , hotelPlatformData = hotelPlatformGroupByData }));
|
|
|
+ return Ok(JsonView(true, "操作成功!", new { hotelCountryGroupByData = hotelCountryGroupByData, hotelCityData = hotelCityGroupByData, hotelPlatformData = hotelPlatformGroupByData }));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|