diff --git a/Application/Admin/Controller/SpendCountSetController.class.php b/Application/Admin/Controller/SpendCountSetController.class.php index 881c9f03c..67cb5b0ad 100644 --- a/Application/Admin/Controller/SpendCountSetController.class.php +++ b/Application/Admin/Controller/SpendCountSetController.class.php @@ -588,8 +588,10 @@ class SpendCountSetController extends \Think\Controller $initdata = $this->getMonthInit(); $balance = $this->getBalanceUser(); $bind = $this->getBindUser(); + $deposit = $this->getBalanceDeposit(); $initdata["inside_cash_count"] = $initdata["inside_cash_count"]-0+$balance-0+$bind; - $initdata["all_count"] = $initdata["inside_cash_count"]-0+$initdata["balance_coin_count"]-0+$initdata["cash_count"]; + $initdata["balance_coin_deposit"] = $deposit; + $initdata["all_count"] = $initdata["inside_cash_count"]-0+$initdata["balance_coin_count"]-0+$initdata["cash_count"]-0+$deposit; $initdata["count_date"] = $this->date; $initdata["create_time"] = $this->nowdata; M("spend_month_count","tab_")->add($initdata); @@ -604,6 +606,17 @@ class SpendCountSetController extends \Think\Controller ); return M("spend_user_count","tab_")->field("sum(cash_count) cash_count,sum(balance_coin_count) balance_coin_count,sum(inside_cash_count) inside_cash_count")->where($tempmap)->find(); } + //获取平台币充值流水 + protected function getBalanceDeposit() + { + $map = array( + "create_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)), + "pay_status"=>1 + ); + $deposit = M("deposit","tab_")->field("SUM(pay_amount) pay_amount")->where($map)->find()['pay_amount']; + $deposit || $deposit=0; + return $deposit; + } //设置 后台发放平台币给玩家 及 回收玩家 的最终值 protected function getBalanceUser() { diff --git a/Data/update.sql b/Data/update.sql index 998966f5a..97991b298 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -245,4 +245,9 @@ CREATE TABLE `tab_spend_month_count` ( `create_time` int(11) DEFAULT NULL COMMENT '添加时间', PRIMARY KEY (`id`) USING BTREE, KEY `count_date` (`count_date`) USING BTREE -) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='流水月份聚合表'; \ No newline at end of file +) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='流水月份聚合表'; + +-- 2019-11-04 chenzhi +ALTER TABLE `tab_spend_month_count` +MODIFY COLUMN `balance_coin_count` decimal(10,2) NULL DEFAULT 0.00 COMMENT '平台币游戏支付流水' AFTER `cash_count`, +ADD COLUMN `balance_coin_deposit` decimal(10,2) NULL DEFAULT 0.00 COMMENT '平台币充值流水' AFTER `balance_coin_count`;