|
@@ -0,0 +1,38 @@
|
|
|
+using Hotline.Orders;
|
|
|
+using Hotline.Repository.SqlSugar.Orders;
|
|
|
+using Microsoft.AspNetCore.Authorization;
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using SqlSugar;
|
|
|
+
|
|
|
+namespace Hotline.Api.Controllers
|
|
|
+{
|
|
|
+ public class BsController : BaseController
|
|
|
+ {
|
|
|
+ private readonly IOrderRepository _orderRepository;
|
|
|
+
|
|
|
+ public BsController(IOrderRepository orderRepository)
|
|
|
+ {
|
|
|
+ _orderRepository = orderRepository;
|
|
|
+ }
|
|
|
+
|
|
|
+ [AllowAnonymous]
|
|
|
+ [HttpGet("datashow")]
|
|
|
+ public async Task<dynamic> InitDataShowAync()
|
|
|
+ {
|
|
|
+ var now = DateTime.Now;
|
|
|
+ //area2
|
|
|
+ var area2 = await _orderRepository.Queryable(workflowFilter: false)
|
|
|
+ .Where(d => d.CreationTime.Month == now.Month)
|
|
|
+ .GroupBy(d => d.SourceChannel)
|
|
|
+ .Select(d => new
|
|
|
+ {
|
|
|
+ source = d.SourceChannel,
|
|
|
+ count = SqlFunc.AggregateCount(d.SourceChannel)
|
|
|
+ })
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+
|
|
|
+ return new { area2 };
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|