来到 根目录
打开 ajax.php
来到16-22行(有的不一样,根据自己目录操作)
修改如下 两行:
$count1 = $DB->count("SELECT count(*) from shua_orders");
$count7 = round($count6, 2);
改成这样:
$count1 = $DB->count("SELECT count(*)*3+100 from shua_orders");
$count7 = round($count6*3+100, 2);
在 (*)后面乘以了个3还加了100
$count6也乘以了个3还加了100
保存 返回前台发现 订单数 和 今日交易额 都被翻了3倍还多了100
方法会了 自己就去根据自己需求随意改动把
这里给个表 分别告诉你们哪行是改什么的
***********************
//所有订单数
$count1 = $DB->count("SELECT count(*) from shua_orders");
//完成订单数
$count2 = $DB->count("SELECT count(*) from shua_orders where status>=1");
//不需要懂这行
$count3 = $DB->count("SELECT sum(money) from shua_pay where status=1");
//总交易额
$count4 = round($count3, 2);
//今日订单数
$count5 = $DB->count("SELECT count(*) from `shua_orders` WHERE `addtime` > '$time'");.
//不需要懂这行
$count6 = $DB->count("SELECT sum(money) FROM `shua_pay` WHERE `addtime` > '$time' AND `status` = 1");
//今日交易额
$count7 = round($count6, 2);
***********************
改好的示例代码:
$count1 = $DB->count("SELECT count(*)*2+1214 from shua_orders");
$count2 = $DB->count("SELECT count(*)*2+1210 from shua_orders where status>=1");
$count3 = $DB->count("SELECT sum(money)*3+3056 from shua_pay where status=1");
$count4 = round($count3, 2);
$count5 = $DB->count("SELECT count(*)*2+138 from `shua_orders` WHERE `addtime` > '$time'");
$count6 = $DB->count("SELECT sum(money) FROM `shua_pay` WHERE `addtime` > '$time' AND `status` = 1");
$count7 = round($count6 * 3 + 359, 2);