master
kira 6 years ago
commit 762a926d5a

@ -331,7 +331,7 @@
)
</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_ids!=null">and c.org_id in
<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
ifnull(sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount)),0)
ifnull(sum(t.total),0)
total
FROM pmt_transactions t
INNER JOIN pmt_orders o ON o.order_id = t.order_id
INNER JOIN sys_clients c ON c.client_id = o.client_id AND c.org_id = 1
WHERE year(o.create_time) = #{year} AND month(o.create_time) = #{month}
AND(
t.transaction_type = 'Credit'
OR t.refund_id IS NOT NULL
)
AND(
o. STATUS =5
OR o. STATUS =6
OR o. STATUS =7
)
FROM statistics_customer_order t
INNER JOIN sys_clients c ON c.client_id = t.client_id AND c.org_id = 1
WHERE year(t.date) = #{year} AND month(t.date) = #{month}
and t.client_id!=0
and t.client_id in
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
@ -527,22 +518,13 @@
</select>
<select id="TotalAmountForSydneyGMPrize" resultType="java.math.BigDecimal">
SELECT
sum(if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount))
SELECT
ifnull(sum(t.total),0)
total
FROM pmt_transactions t
INNER JOIN pmt_orders o ON o.order_id = t.order_id
INNER JOIN sys_clients c ON c.client_id = o.client_id AND c.org_id = 1
WHERE year(o.create_time) = #{year} AND month(o.create_time) = #{month}
AND(
t.transaction_type = 'Credit'
OR t.refund_id IS NOT NULL
)
AND(
o. STATUS =5
OR o. STATUS =6
OR o. STATUS =7
)
FROM statistics_customer_order t
INNER JOIN sys_clients c ON c.client_id = t.client_id AND c.org_id = 1
WHERE year(t.date) = #{year} AND month(t.date) = #{month}
and t.client_id!=0
and t.client_id in
(SELECT b.client_id FROM sys_client_bd b
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');
}
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 {
params.end = $filter('date')(new Date(), 'yyyyMMdd');
}
@ -80,6 +80,19 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
$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();
var ordersHistoryConfig = {
chart: {

Loading…
Cancel
Save