master
kira 6 years ago
commit 762a926d5a

@ -331,7 +331,7 @@
) )
</if> </if>
<if test="begin!=null">and s.date &gt;= #{begin} </if> <if test="begin!=null">and s.date &gt;= #{begin} </if>
<if test="end!=null">and s.date &lt; #{end}</if> <if test="end!=null">and s.date &lt;= #{end}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if> <if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in <if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>

@ -504,21 +504,12 @@
<select id="TotalAmountForBDLeaderPrize" resultType="java.math.BigDecimal"> <select id="TotalAmountForBDLeaderPrize" resultType="java.math.BigDecimal">
SELECT SELECT
ifnull(sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)),0) ifnull(sum(t.total),0)
total total
FROM pmt_transactions t FROM statistics_customer_order t
INNER JOIN pmt_orders o ON o.order_id = t.order_id INNER JOIN sys_clients c ON c.client_id = t.client_id AND c.org_id = 1
INNER JOIN sys_clients c ON c.client_id = o.client_id AND c.org_id = 1 WHERE year(t.date) = #{year} AND month(t.date) = #{month}
WHERE year(o.create_time) = #{year} AND month(o.create_time) = #{month} and t.client_id!=0
AND(
t.transaction_type = 'Credit'
OR t.refund_id IS NOT NULL
)
AND(
o. STATUS =5
OR o. STATUS =6
OR o. STATUS =7
)
and t.client_id in and t.client_id in
(SELECT b.client_id FROM sys_client_bd b (SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
@ -527,22 +518,13 @@
</select> </select>
<select id="TotalAmountForSydneyGMPrize" resultType="java.math.BigDecimal"> <select id="TotalAmountForSydneyGMPrize" resultType="java.math.BigDecimal">
SELECT SELECT
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)) ifnull(sum(t.total),0)
total total
FROM pmt_transactions t FROM statistics_customer_order t
INNER JOIN pmt_orders o ON o.order_id = t.order_id INNER JOIN sys_clients c ON c.client_id = t.client_id AND c.org_id = 1
INNER JOIN sys_clients c ON c.client_id = o.client_id AND c.org_id = 1 WHERE year(t.date) = #{year} AND month(t.date) = #{month}
WHERE year(o.create_time) = #{year} AND month(o.create_time) = #{month} and t.client_id!=0
AND(
t.transaction_type = 'Credit'
OR t.refund_id IS NOT NULL
)
AND(
o. STATUS =5
OR o. STATUS =6
OR o. STATUS =7
)
and t.client_id in and t.client_id in
(SELECT b.client_id FROM sys_client_bd b (SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id

@ -67,7 +67,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
params.begin = $filter('date')(new Date(), 'yyyyMMdd'); params.begin = $filter('date')(new Date(), 'yyyyMMdd');
} }
if (params.end) { if (params.end) {
params.end = $filter('date')(params.end.setMonth(params.end.getMonth()+1), 'yyyyMMdd'); params.end = $filter('date')(getLastDay(params.end.getFullYear(),params.end.getMonth()), 'yyyyMMdd');
} else { } else {
params.end = $filter('date')(new Date(), 'yyyyMMdd'); params.end = $filter('date')(new Date(), 'yyyyMMdd');
} }
@ -80,6 +80,19 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
$scope.totalChannelAmount = resp.data; $scope.totalChannelAmount = resp.data;
}); });
}; };
function getLastDay(year,month)
{
var new_year = year; //取当前的年份
var new_month = ++month;//取下一个月的第一天,方便计算(最后一天不固定)
if(month>11) //如果当前大于12月则年份转到下一年
{
new_month -=12; //月份减
new_year++; //年份增
}
var new_date = new Date(new_year,new_month,1); //取当年当月中的第一天
return new Date(new_date.getTime()-1000*60*60*24);//获取当月最后一天日期
}
$scope.thisYear(); $scope.thisYear();
var ordersHistoryConfig = { var ordersHistoryConfig = {
chart: { chart: {

Loading…
Cancel
Save