TradeLogs 添加商户数统计

master
duLingLing 5 years ago
parent b6b2c25154
commit d6b152a933

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.2.51</version>
<version>1.2.52</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -146,58 +146,58 @@
<include refid="tradelog_list_keys"/>
</if>
FROM (
select oo.order_id,oo.client_id,oo.total_amount,oo.display_amount,
oo.customer_payment_amount,oo.coupon_payment_amount,oo.currency,
oo.create_time,oo.confirm_time,oo.status,oo.order_description,oo.order_detail,
oo.client_order_id,oo.gateway,oo.channel,oo.pre_authorization,oo.refund_amount,oo.customer_id
from pmt_orders oo
<where>
<if test="search_text != null">
<bind name="name_pattern" value="'%' + search_text + '%'"/>
<if test="text_type == 'remark'">
AND oo.order_detail LIKE #{name_pattern}
</if>
<if test="text_type == 'channel'">
AND oo.channel = #{search_text}
</if>
<if test="text_type == 'order_id'">
AND oo.order_id = #{search_text}
</if>
</if>
<if test="order_id != null">
AND oo.order_id = #{order_id}
</if>
<if test="trade_type != null">
AND oo.gateway IN
<foreach collection="trade_type" item="gateway" open="(" close=")" separator=",">
#{gateway}
</foreach>
</if>
<if test="from != null">
AND oo.create_time &gt;= #{from}
</if>
<if test="to != null">
AND oo.create_time &lt; #{to}
</if>
<if test="date != null">
AND oo.transaction_date = DATE(#{date})
</if>
<if test="dev_id != null">
AND oo.dev_id = #{dev_id}
</if>
<if test="status != null">
AND
<foreach collection="status" item="std" open="(" close=")" separator=" or ">
oo.status = #{std}
</foreach>
</if>
<if test="channel != null">
AND
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">
oo.channel = #{chan}
</foreach>
</if>
</where>
select oo.order_id,oo.client_id,oo.total_amount,oo.display_amount,
oo.customer_payment_amount,oo.coupon_payment_amount,oo.currency,
oo.create_time,oo.confirm_time,oo.status,oo.order_description,oo.order_detail,
oo.client_order_id,oo.gateway,oo.channel,oo.pre_authorization,oo.refund_amount,oo.customer_id
from pmt_orders oo
<where>
<if test="search_text != null">
<bind name="name_pattern" value="'%' + search_text + '%'"/>
<if test="text_type == 'remark'">
AND oo.order_detail LIKE #{name_pattern}
</if>
<if test="text_type == 'channel'">
AND oo.channel = #{search_text}
</if>
<if test="text_type == 'order_id'">
AND oo.order_id = #{search_text}
</if>
</if>
<if test="order_id != null">
AND oo.order_id = #{order_id}
</if>
<if test="trade_type != null">
AND oo.gateway IN
<foreach collection="trade_type" item="gateway" open="(" close=")" separator=",">
#{gateway}
</foreach>
</if>
<if test="from != null">
AND oo.create_time &gt;= #{from}
</if>
<if test="to != null">
AND oo.create_time &lt; #{to}
</if>
<if test="date != null">
AND oo.transaction_date = DATE(#{date})
</if>
<if test="dev_id != null">
AND oo.dev_id = #{dev_id}
</if>
<if test="status != null">
AND
<foreach collection="status" item="std" open="(" close=")" separator=" or ">
oo.status = #{std}
</foreach>
</if>
<if test="channel != null">
AND
<foreach collection="channel" item="chan" open="(" close=")" separator=" or ">
oo.channel = #{chan}
</foreach>
</if>
</where>
) o
INNER JOIN sys_clients p
ON p.client_id = o.client_id
@ -220,12 +220,12 @@
<bind name="name_pattern" value="'%' + search_text + '%'"/>
<if test="text_type == 'all'">
AND (
p.client_moniker = #{search_text}
OR p.short_name LIKE #{name_pattern}
OR o.order_detail LIKE #{name_pattern}
OR t.system_transaction_id = #{search_text}
OR o.channel = #{search_text}
OR o.order_id = #{search_text}
p.client_moniker = #{search_text}
OR p.short_name LIKE #{name_pattern}
OR o.order_detail LIKE #{name_pattern}
OR t.system_transaction_id = #{search_text}
OR o.channel = #{search_text}
OR o.order_id = #{search_text}
)
</if>
<if test="text_type == 'client_moniker'">
@ -250,26 +250,26 @@
<if test="bd_group != null">
AND p.client_id IN(
SELECT distinct b.client_id
FROM sys_client_bd b
INNER JOIN financial_bd_config c
ON c.manager_id = b.bd_id
WHERE b.is_valid = 1
AND b.start_date &lt;= now()
AND (b.end_date is null or b.end_date &gt;= now())
AND (c.bd_group = #{bd_group} or c.manager_id = #{bd_group})
<if test="bd_group_bd">
AND c.manager_id = #{bd_group_bd}
</if>
SELECT distinct b.client_id
FROM sys_client_bd b
INNER JOIN financial_bd_config c
ON c.manager_id = b.bd_id
WHERE b.is_valid = 1
AND b.start_date &lt;= now()
AND (b.end_date is null or b.end_date &gt;= now())
AND (c.bd_group = #{bd_group} or c.manager_id = #{bd_group})
<if test="bd_group_bd">
AND c.manager_id = #{bd_group_bd}
</if>
)
</if>
<if test="bd_user != null">
AND p.client_id in(select distinct d.client_id
from sys_client_bd d
where d.bd_id = #{bd_user}
AND d.is_valid = 1
AND DATE(d.start_date) &lt;= curdate()
AND (d.end_date IS NULL OR DATE(d.end_date) &gt;= curdate()))
AND d.is_valid = 1
AND DATE(d.start_date) &lt;= curdate()
AND (d.end_date IS NULL OR DATE(d.end_date) &gt;= curdate()))
</if>
</where>
GROUP BY o.order_id
@ -393,6 +393,7 @@
ifnull(sum(if(l.refund_id is not null AND l.pre_authorization=1,l.clearing_amount,0)),0)
pre_refund_fee,
count(DISTINCT l.customer_id) customers,
count(DISTINCT l.client_id) clients,
ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency!='CNY',l.display_amount,0)),0)
display_amount,
ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency!='CNY' and

@ -21,6 +21,37 @@
.line_height_{
line-height: 22px;
}
.col-xs-1-5,
.col-sm-1-5,
.col-md-1-5,
.col-lg-1-5 {
position: relative;
min-height: 1px;
padding-right: 10px;
padding-left: 10px;
}
.col-xs-1-5 {
width: 20%;
float: left;
}
@media (min-width: 768px) {
.col-sm-1-5 {
width: 20%;
float: left;
}
}
@media (min-width: 992px) {
.col-md-1-5 {
width: 20%;
float: left;
}
}
@media (min-width: 1200px) {
.col-lg-1-5 {
width: 20%;
float: left;
}
}
</style>
<section class="content-header">
<h1>Trade Logs</h1>
@ -88,16 +119,16 @@
</div>-->
</div>
<!-- <div class="col-sm-6 col-xs-8" ng-if="orgs.length>1 && currentUser.org_id">
<label class="control-label col-xs-3 col-sm-4">Organization</label>
<div class="col-xs-9 col-sm-8">
<select id="org-clild" class="form-control" ng-model="params.org_id"
ng-options="org.org_id as org.name group by org.type for org in orgs"
ng-change="loadTradeLogs(1)">
<option value="">All</option>
</select>
</div>
</div>-->
<!-- <div class="col-sm-6 col-xs-8" ng-if="orgs.length>1 && currentUser.org_id">
<label class="control-label col-xs-3 col-sm-4">Organization</label>
<div class="col-xs-9 col-sm-8">
<select id="org-clild" class="form-control" ng-model="params.org_id"
ng-options="org.org_id as org.name group by org.type for org in orgs"
ng-change="loadTradeLogs(1)">
<option value="">All</option>
</select>
</div>
</div>-->
</div>
<div class="form-group col-xs-12">
<label class="control-label col-xs-4 col-sm-2">Status</label>
@ -232,9 +263,9 @@
<i class="fa fa-search"></i> Search
</button>
<!--<div class="pull-right">-->
<!--<button class="btn btn-danger" ng-if="('10000000000'|withRole)" type="button" ui-sref="refundReview">-->
<!--<i class="fa fa-wrench"></i> Audit Refund-->
<!--</button>-->
<!--<button class="btn btn-danger" ng-if="('10000000000'|withRole)" type="button" ui-sref="refundReview">-->
<!--<i class="fa fa-wrench"></i> Audit Refund-->
<!--</button>-->
<!--</div>-->
</div>
</div>
@ -244,7 +275,7 @@
<div class="box">
<div class="box-header">
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="col-md-1-5 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-aqua box-icon_small"><i class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
@ -255,7 +286,7 @@
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12" ng-if="!analysis.cny_display_amount">
<div class="col-md-1-5 col-sm-6 col-xs-12" ng-if="!analysis.cny_display_amount">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-aqua box-icon_small"><i class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
@ -266,7 +297,7 @@
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12" ng-if="analysis.cny_display_amount">
<div class="col-md-1-5 col-sm-6 col-xs-12" ng-if="analysis.cny_display_amount">
<div class="info-box info_box_bottom" ng-class="{'line_height':analysis.pre_display_amount||analysis.pre_cny_display_amount}">
<span class="info-box-icon bg-aqua box-icon_small"><i class="ion ion-social-usd"></i></span>
<div class="info-box-content box-content_left">
@ -285,7 +316,7 @@
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="col-md-1-5 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-red box-icon_small"><i class="ion ion-android-warning"></i></span>
<div class="info-box-content box-content_left">
@ -298,7 +329,18 @@
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="col-md-1-5 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-red box-icon_small"><i class="ion ion-android-warning"></i></span>
<div class="info-box-content box-content_left">
<span class="info-box-text">Merchants</span>
<span class="info-box-number box-number_font"
ng-bind="analysis.clients"></span>
</span>
</div>
</div>
</div>
<div class="col-md-1-5 col-sm-6 col-xs-12">
<div class="info-box info_box_bottom">
<span class="info-box-icon bg-yellow box-icon_small"><i class="ion ion-ios-people"></i></span>
<div class="info-box-content box-content_left">

@ -115,8 +115,8 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.gatewaySelected = function (arr) {
return $scope.params.gateway != null && $scope.params.gateway.filter(function (gateway) {
return arr.indexOf(gateway) >= 0
}).length > 0
return arr.indexOf(gateway) >= 0
}).length > 0
};
$scope.showTradeDetail = function (order) {
orderService.managerOrderDetail(order)

Loading…
Cancel
Save