統計
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using Model.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
@@ -18,9 +21,42 @@ public class StatisticController : BaseApiController
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/Statistic/GetStatistic")]
|
||||
public IHttpActionResult GetStatistic([FromBody] Model.ViewModel.statistic s)
|
||||
public IHttpActionResult GetStatistic([FromBody] Model.ViewModel.statistic s,string statistic_mode)
|
||||
{
|
||||
|
||||
//statistic_mode :依法會 依信眾 依分類 依付款方式
|
||||
var sqlstr = new StringBuilder(@"with o1 (order_no,price) as (
|
||||
select order_no,sum(isnull(price,0)) as price from pro_order_detail
|
||||
group by order_no
|
||||
)
|
||||
select a.num,a.kind,d.kind kindName,a.subject,isnull(b.order_no,'') order_no,isnull(c.u_name,'') u_name,
|
||||
isnull(bill.pay_type,'') pay_type,o1.price,bill.amount,bill.pay_mode,bill.status,bill.f_num,
|
||||
bill.acc_num,bill.acc_kind,isnull(bill.check_amount,0) check_amount,
|
||||
isnull(bill.remain_amount,0) remain_amount,isnull(bill.check_status,'') check_status
|
||||
from activity a
|
||||
left join pro_order b on a.num=b.activity_num
|
||||
left join transfer_register bill on a.num=bill.activity_num
|
||||
and bill.f_num=b.f_num
|
||||
left join followers c on b.f_num=c.num
|
||||
left join activity_kind d on a.kind=d.num
|
||||
left join o1 on o1.order_no=b.order_no
|
||||
where 1=1 ");
|
||||
var parameters = new List<SqlParameter>();
|
||||
if (s.num!=0)
|
||||
{//查法會
|
||||
sqlstr.Append(" and num=@num ");
|
||||
parameters.Add(new SqlParameter("@num",s.num));
|
||||
}
|
||||
if (s.kind != 0)
|
||||
{//查法會類型
|
||||
sqlstr.Append(" and kind=@kind ");
|
||||
parameters.Add(new SqlParameter("@kind",s.kind));
|
||||
}
|
||||
if (s.f_num != 0)
|
||||
{//查信眾
|
||||
sqlstr.Append(" and f_num=@f_num ");
|
||||
parameters.Add(new SqlParameter("@f_num", s.f_num));
|
||||
}
|
||||
var list=_db.Database.SqlQuery<statistic>(sqlstr.ToString(),parameters.ToArray()).ToList();
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="page_nav" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
|
||||
<v-containe class="container-fluid">
|
||||
<%-- <v-container class="container-fluid">--%>
|
||||
<div id="content" class="container-fluid py-4">
|
||||
<keep-alive>
|
||||
<component :is="currentView" :form-data="$data"
|
||||
@@ -33,7 +33,7 @@
|
||||
</component>
|
||||
</keep-alive>
|
||||
</div>
|
||||
</v-containe>
|
||||
<%-- </v-container>--%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="offCanvasRight" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
Reference in New Issue
Block a user