Merge branch 'hotfix20180104customerpoints' into develop

master
yixian 7 years ago
commit 17039a0e8b

@ -401,7 +401,12 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
throw new ParamInvalidException("date", "error.payment.valid.invalid_date_format");
}
params.put("channel",record.getString("channel"));
int newCustomers = transactionAnalysisMapper.countNewCustomers(params);
int newCustomers = 0;
if (client.getIntValue("client_id")==0){
newCustomers = transactionAnalysisMapper.getCountCustomers(params.getDate("end")) - transactionAnalysisMapper.getCountCustomers(params.getDate("begin"));
}else {
newCustomers = transactionAnalysisMapper.countNewCustomers(params);
}
int oldCustomers = transactionAnalysisMapper.countOldCustomers(params);
record.put("new_customers",newCustomers);
record.put("old_customers",oldCustomers);

@ -69,4 +69,6 @@ public interface TransactionAnalysisMapper {
BigDecimal getOneOrder(@Param("order_id") String order_id);
int getCountCustomers(@Param("date") Date date);
}

@ -389,6 +389,12 @@
]]>
</select>
<select id="getCountCustomers" resultType="java.lang.Integer">
<![CDATA[
SELECT count(DISTINCT o.customer_id) FROM pmt_orders o where
o.create_time < #{date} and o.status>=5
]]>
</select>
<select id="getTradePartnersInTypes" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[

@ -1,10 +1,10 @@
window.onbeforeunload = function(e) {
window.onbeforeunload = function (e) {
return '页面已过期|Page Expired';
};
$(function () {
var ctrl = {doubled: false, accessed: false};
$('.coin').click(function () {
if(ctrl.accessed && !ctrl.doubled){
if (ctrl.accessed && !ctrl.doubled) {
var coin = $(this);
coin.addClass('throwing');
$.ajax({
@ -15,20 +15,21 @@ $(function () {
$('.encourage-dialog .money-amount').html(encourage.actural_amount);
$('.encourage-dialog .double-rate').html('X ' + encourage.factor);
$('.encourage-dialog .double-text').hide();
setTimeout(function(){
setTimeout(function () {
coin.removeClass('throwing');
},1000);
}, 1000);
},
error: function () {
setTimeout(function(){
setTimeout(function () {
coin.removeClass('throwing');
},1000);
}, 1000);
}
});
ctrl.doubled = true;
}
});
function loadEncourage() {
$.ajax({
url: '/act/encourage_money/orders/' + window.order_id,
@ -39,28 +40,32 @@ $(function () {
$('.encourage-dialog .money-amount').html(encourage.actural_amount);
$('.encourage-dialog .double-rate').html('X ' + encourage.factor);
$('.encourage-dialog').removeClass('hide');
ctrl.accessed=true;
ctrl.accessed = true;
}
}
})
}
loadEncourage();
function loadPoints() {
$.ajax({
url: '/customers/points/' + window.order_id +'/check',
method: 'GET',
dataType: 'text',
success: function (data) {
if (data>0){
$('.points-dialog .points-value').html('+ ' + data);
$('.points-dialog').removeClass('hide');
}
if ([0, 1, 2, 11].indexOf(window.order_gateway) >= 0) {
$.ajax({
url: '/customers/points/' + window.order_id + '/check',
method: 'GET',
dataType: 'text',
success: function (data) {
if (data > 0) {
$('.points-dialog .points-value').html('+ ' + data);
$('.points-dialog').removeClass('hide');
}
},error:function () {
}
});
}, error: function () {
}
});
}
}
loadPoints();
$('.encourage-dialog .close-circle').click(function () {

Loading…
Cancel
Save