新增平台币流水充值

master
chenzhi 5 years ago
parent 1201180f79
commit c8da11a12e

@ -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()
{

@ -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='流水月份聚合表';
) 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`;

Loading…
Cancel
Save