央企文库

首页 > 关于我们 > 资源分享

资源分享

帝国CMS插件 后台支付记录统计总、年、月、日收入代码

更新时间:2018-01-01立即下载

修改/e/admin/pay/ListPayRecord.php

在 ?>上面添加以下代码

$year=date('Y'); //读取当前年份
$month=date('Y-m'); //读取当前年月份
$day=date('Y-m-d'); //读取当前年月日份
$hj=$empire->fetch1("select sum(money) as money from {$dbtbpre}enewspayrecord");
$hj=$hj['money']; //合计
$year=$empire->fetch1("select sum(money) as money from {$dbtbpre}enewspayrecord where posttime like '".$year."%'");
$year=$year['money']; //年合计
$month=$empire->fetch1("select sum(money) as money from {$dbtbpre}enewspayrecord where posttime like '".$month."%'");
$month=$month['money']; //月合计
$day=$empire->fetch1("select sum(money) as money from {$dbtbpre}enewspayrecord where posttime like '".$day."%'");
$day=$day['money']; //日合计

 

在任意地方输出php内容:总收入<?=$hj?>元,今年收入<?=$year?>元,月收入<?=$month?>元,日收入<?=$day?>元。

QQ截图20200720105048.jpg

文章评论