提交 dc503d3c authored 作者: chengye's avatar chengye

修复超表示显示小数点为一长串的bug

上级 bf2d7218
......@@ -53,30 +53,14 @@ class EmPayment extends Base
//先找到账单
$data = self::alias('pay')
->field('pay.*')
->field('epi.invoice_id')
->field('em.em_numb')
->field('r.region_name,station.station_name')
->leftJoin(['em_payment_invoice'=>'epi'],'epi.payment_id = pay.payment_id')
->leftJoin(['em_invoice'=>'ei'],'ei.invoice_id=epi.invoice_id')
->leftJoin(['em_account'=>'ea'],'ea.account_id=ei.account_id')
->leftJoin(['em'],'em.id=ea.em_id')
->leftJoin(['station_info'=>'station'],'station.station_id=em.station_id')
->leftJoin(['region'=>'r'],'station.area_id = r.id')
->where($map)
->count();
$data2 = self::alias('pay')
->field('pay.*')
->field('em.em_numb,r.region_name,station.station_name')
->leftJoin(['em_account'=>'ea'],'ea.account_id=pay.account_id')
->leftJoin(['em'],'em.id=ea.em_id')
->leftJoin(['em'],'em.id=pay.em_id')
->leftJoin(['station_info'=>'station'],'station.station_id=em.station_id')
->leftJoin(['region'=>'r'],'station.area_id = r.id')
->where($map)
->count();
return intval($data + $data2);
return $data;
}
//通过缴费单id返回缴费单关联账单信息
public function getinvsInfo($payment_id){
......
......@@ -310,7 +310,7 @@
}
});
$('#current_numb').change(function(){
var $level = 100000;
var $level = 1;
var $rate = $('#rate').val();
var $baseNum = $level*$rate;
var $rNum = $(this).val()*$baseNum - $('#last_numb').val()*$baseNum;
......@@ -321,7 +321,7 @@
return;
}
var $num = $rNum/$level;
var $num = round2($rNum);
$('#repo_numb').val($num);
if($('#pricing_type').val() == 2){
......@@ -347,6 +347,10 @@
$('#price').val($price.toFixed(4))
}
})
function round2(num){
return Math.round((num + Number.EPSILON) * 100) / 100;
}
});
</script>
{/block}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论