Commit dce4b572 by lizefeng

fix

parent 796088a3
......@@ -14,7 +14,7 @@ namespace AutoTurnOver.DB
/// </summary>
public class report_invest_return_dao : connectionHelper
{
public static List<dc_report_invest_return_analysis> AnaList(Condition_ConfigPromotion m, int offset, int limit, ref int total)
public static List<dc_report_invest_return_analysis> AnaList(Condition_ConfigPromotion m, int offset, int limit,string sort,string order, ref int total)
{
var list = new List<dc_report_invest_return_analysis>();
......@@ -27,6 +27,20 @@ namespace AutoTurnOver.DB
total = _connection.QuerySingleOrDefault<int>("select count(0) from (" + sql + ") tb1");
if (!string.IsNullOrEmpty(sort) && !string.IsNullOrEmpty(order))
{
sql += " order by " + sort;
if (!string.IsNullOrEmpty(order))
{
sql += " " + order;
}
else
{
sql += " asc";
}
}
var obj = _connection.Query<dc_report_invest_return_analysis>(sql + " limit " + offset + "," + limit);
return obj.AsList();
......@@ -248,7 +262,7 @@ namespace AutoTurnOver.DB
ana.adfee_rate = Math.Round(ana.adfee_day_30 .Division( ana.amount_total_day_30), 4);
// 计算最近1个月的平台费率
ana.platform_fee_day_30 = orders.Where(s => s.paid_time >= day30Btime).Sum(s => s.cost_platform_fee * s.order_to_usd_exchange_rate);
ana.platform_fee_day_30 = orders.Where(s => s.paid_time >= day30Btime).Where(s=>s.cost_platform_fee>0).Sum(s => s.cost_platform_fee * s.order_to_usd_exchange_rate);
ana.platform_fee_rate = Math.Round(ana.platform_fee_day_30 .Division( ana.amount_total_day_30), 4);
......
......@@ -15,9 +15,9 @@ namespace AutoTurnOver.Services
/// <param name="limit"></param>
/// <param name="total"></param>
/// <returns></returns>
public List<dc_report_invest_return_analysis> AnaList(Condition_ConfigPromotion m, int offset, int limit, ref int total)
public List<dc_report_invest_return_analysis> AnaList(Condition_ConfigPromotion m, int offset, int limit, string sort, string order, ref int total)
{
return DB.report_invest_return_dao.AnaList(m, offset, limit, ref total);
return DB.report_invest_return_dao.AnaList(m, offset, limit, sort, order, ref total);
}
}
}
......@@ -24,7 +24,7 @@ namespace AutoTurnOver.Controllers
{
var total = 0;
var service = new Services.ReportInvestReturnService();
var list = service.AnaList(new Condition_ConfigPromotion { }, offset, limit, ref total);
var list = service.AnaList(new Condition_ConfigPromotion { }, offset, limit, order, sort, ref total);
return new JsonResult(new
{
......@@ -37,7 +37,7 @@ namespace AutoTurnOver.Controllers
{
int total = 0;
var service = new Services.ReportInvestReturnService();
var list = service.AnaList(new Condition_ConfigPromotion { }, 0, int.MaxValue, ref total);
var list = service.AnaList(new Condition_ConfigPromotion { }, 0, int.MaxValue,null,null, ref total);
DataTable table = new DataTable();
string[] cols = new string[] {
......
......@@ -48,7 +48,7 @@ namespace ResetOutofstock
// report_invest_return_dao.SynchBtmAdFees();
//report_invest_return_dao.ShareAdFee();
//report_invest_return_dao.SynchBtmOrderRefund();
//report_invest_return_dao.CalculationStockScore();
report_invest_return_dao.CalculationStockScore("961922201");
}
catch (Exception ex)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment