Merge remote-tracking branch 'origin/release' into release

master
liuweiwen 5 years ago
commit efe9d25988

@ -0,0 +1,128 @@
<?php
namespace Admin\Controller;
class FinancialSummaryController extends AdminController
{
public $keyname=array(
"cash_spend"=>"现金充值收入",
"balance_coin_spend"=>"平台币充值收入",
"balance_coin_income"=>"平台币消耗",
"game_supersign_income"=>"超级签购买收入",
"test_user_income"=>"测试收入",
"reward_count"=>"奖励",
"fine_count"=>"违规处罚",
"inside_count"=>"内团",
"outer_count"=>"外团",
"outer_branch_count"=>"外团-分发",
"other_group_count"=>"无归属团",
// "inside_count"=>"内团",
// "outer_count"=>"外团",
"gfwx_count"=>"官方-微信",
"gfzfb_count"=>"官方-支付宝",
"sqzfb_count"=>"双乾-支付宝",
"sqkj_count"=>"双乾-快捷",
"wx_count"=>"微信",
"zfb_count"=>"支付宝",
"kj_count"=>"快捷"
);
public function _initialize()
{
parent::_initialize();
// echo "<pre>";
}
public function index($p=1)
{
if(!array_key_exists("year",$_REQUEST) || !array_key_exists("type",$_REQUEST)){
$this->redirect(ACTION_NAME, array('year' => date('Y',time()),"type"=>2));
}
$this->getYearList();
$this->getYearData();
$this->display();
}
//获取指定年份数据
public function getYearData()
{
$senddata = array(
"income"=>[
"count"=>[0,0,0,0,0,0,0,0,0,0,0,0,0]
],
"promote"=>[
"count"=>[0,0,0,0,0,0,0,0,0,0,0,0,0]
],
"channel"=>[
"count"=>[0,0,0,0,0,0,0,0,0,0,0,0,0]
],
"payway"=>[
"count"=>[0,0,0,0,0,0,0,0,0,0,0,0,0]
]
);
$data = [];
//初始化数据
foreach ($this->keyname as $k => $v) {
$data[$k] = array("name"=>$v,"money"=>[0,0,0,0,0,0,0,0,0,0,0,0,0]);
}
$map = array(
"count_year"=>$_REQUEST['year'],
"type"=>array("IN","1,{$_REQUEST['type']},4,5")
);
$dbres = M("FinancialSummary","tab_")->field("*")->where($map)->select();
foreach ($dbres as $k => $v) {
if($v['type'] == 1){
if(!in_array($v['key_name'],$senddata['income']['list'])){
$senddata['income']['list'][] = $v['key_name'];
}
}
if($v['type'] == 4){
if(!in_array($v['key_name'],$senddata['channel']['list'])){
$senddata['channel']['list'][] = $v['key_name'];
}
}
if($v['type'] == 5){
if(!in_array($v['key_name'],$senddata['payway']['list'])){
$senddata['payway']['list'][] = $v['key_name'];
}
}
if($v['type'] == $_REQUEST['type']){
if(!in_array($v['key_name'],$senddata['promote']['list'])){
$senddata['promote']['list'][] = $v['key_name'];
}
}
$data[$v['key_name']]["money"][((int)$v['count_month']-1)] = $v['sum_money'];
# code...
}
foreach ($senddata as $k => $v) {
foreach ($v as $ke => $va) {
if($ke !='count'){
foreach ($va as $key => $val) {
for ($i=0; $i < 12; $i++) {
$data[$val]["money"][12] += $data[$val]["money"][$i];
$senddata[$k]['count'][$i] += $data[$val]["money"][$i];
$senddata[$k]['count'][12] +=$data[$val]["money"][$i];
}
$senddata[$k][$ke][$key] = $data[$val];
}
}
}
}
$this->assign('data', $senddata);
}
//获取历史年份
public function getYearList()
{
$star = 2019;
$end = date("Y",time());
$list = [];
for ($i=$star; $i <= $end; $i++) {
$temp = array(
"value"=>$i,
"name"=>"{$i}年"
);
$list[] = $temp ;
}
$this->assign('YearList', $list);
}
}

@ -0,0 +1,475 @@
<?php
namespace Admin\Controller;
/**
* 游戏流水聚合接口
* @author chenzhi
*/
class FinancialSummarySetController extends \Think\Controller
{
public $beginThismonth;
public $endThismonth;
public $date;
public $nowdata;
public $month;//月份
public $year;//年份
public $adddata;//要添加的数据
//数据库
public $FinancialSummaryModel;
public function _initialize(){
//初始化
$this->beginThismonth = mktime(0,0,0,date('m')-1,1,date('Y'));
$this->endThismonth = mktime(0,0,0,date('m'),1,date('Y'))-1;
$temp = strtotime(date('Y-m-01 00:00:00',strtotime('-1 month')));
$this->year= date('Y',$temp);
$this->month= date('m',$temp);
$this->date = $this->year."-".$this->month;
$this->nowdata =time();
$this->FinancialSummaryModel =M("FinancialSummary",'tab_');
$this->DepositModel =M("Deposit",'tab_');
$this->SpendModel = M("Spend",'tab_');
$this->GameSupersignModel = M("GameSupersign",'tab_');
$this->CoinPayOrderModel = M("CoinPayOrder",'tab_');//会长充值平台币表
}
/**
* 更新某月数据
*/
public function setMonthFinancialSummary($count_date)
{
$month = $count_date;
if(empty($month)) die("参数错误");
$this->adddata = [];//置空否者会脚本进来会重复计算
$this->date = $month;
$tarry = explode('-',$month);
$this->year= $tarry[0];
if(strlen($tarry[1]) < 2) $tarry[1]="0".$tarry[1];
$this->month= $tarry[1];
$this->beginThismonth=mktime(0,0,0,$tarry[1],1,$tarry[0]);
$this->endThismonth=mktime(0,0,0,$tarry[1]-0+1,1,$tarry[0])-1;
$this->reCount();
$this->setFinancialSummary();
}
/**
* 强制重新聚合
*/
public function reCount()
{
$recount = I("recount");
if(empty($recount) || $recount != 1){return ;}
# code...
//清理之前的聚合
$temp =array(
"count_year"=>$this->year,
"count_month"=>$this->month
);
$this->FinancialSummaryModel->where($temp)->delete();
echo "重置成功执行重新生成:";
}
/**
* 每个月的统计接口
*/
public function setFinancialSummary()
{
set_time_limit(0);
$t1 = microtime(true);
//判断是否已经聚合
$countRes = $this->FinancialSummaryModel->field("IFNULL(COUNT(*),0) count")->where("count_year = '{$this->year}' and count_month= '{$this->month}'")->find()['count'];
if($countRes > 0){
die("error:Repeated statistics,msg:{$this->date}已经聚合过");
}
//按收入类型
$this->setIncomeMoney();
//按合作方类型
$this->setPromoteMoney();
//支付渠道/支付类型
$this->setPayWayMoney();
//存入数据
$this->addDb();
$t2 = microtime(true);
echo ("success {$this->date}:ok runtime:".round($t2-$t1,3).'s'.PHP_EOL);
}
/**
* 获取类型为1的数据,按收入类型
*/
public function setIncomeMoney()
{
$this->getCashAndBalanCoinSpend();
$this->getBalanceCoinIncome();
$this->getGameSupersignIncome();
$this->getTestUserIncome();
$this->getRewardRecordIncome();
}
//现金充值及平台币消耗
protected function getCashAndBalanCoinSpend()
{
$map = array(
"pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1
);
$res = $this->SpendModel
->field("IFNULL(SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END),0) as cash_count,IFNULL(SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END),0) as balance_coin_count")
->where($map)
->find();
$cash_spend["key_name"] = "cash_spend";
$cash_spend["type"] = 1;
$cash_spend["sort"] = 1;
$cash_spend["sum_money"] = $res['cash_count'];
$this->adddata[]=$cash_spend;
$balance_coin_spend["key_name"] = "balance_coin_spend";
$balance_coin_spend["type"] = 1;
$balance_coin_spend["sort"] = 2;
$balance_coin_spend["sum_money"] = $res['balance_coin_count'];
$this->adddata[]=$balance_coin_spend;
}
//平台币充值(deposit/CoinPayOrder)玩家及会长充值的平台币总额
protected function getBalanceCoinIncome()
{
$temparr = array(
"key_name"=>'balance_coin_income',
"type"=>1,
"sort"=>3,
);
$map = array(
"create_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1
);
$temparr['sum_money'] = $this->DepositModel->field("IFNULL(sum(pay_amount),0) pay_amount")->where($map)->find()['pay_amount'];
//获取会长充值的平台币
$map1= array(
"pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"order_status"=>array("EGT",1)
);
$COMoney= $this->CoinPayOrderModel->field("IFNULL(sum(pay_amount),0) pay_amount")->where($map1)->find()['pay_amount'];
$temparr['sum_money'] = number_format(($temparr['sum_money']*100+$COMoney*100)/100, 2, '.', '');
$this->adddata[]=$temparr;
}
//超级签购买收入
protected function getGameSupersignIncome()
{
$temparr = array(
"key_name"=>'game_supersign_income',
"type"=>1,
"sort"=>4,
);
$map = array(
"pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1
);
$temparr['sum_money'] = $this->GameSupersignModel->field("IFNULL(sum(pay_price),0) pay_price")->where($map)->find()['pay_price'];
$this->adddata[]=$temparr;
}
//测试账号收入
protected function getTestUserIncome()
{
$temparr = array(
"key_name"=>'test_user_income',
"type"=>1,
"sort"=>5
);
//获取测试白名单
$testlist = M("TestWhiteList",'tab_')->field("user_id")->select();
if($testlist){
$testlist = implode(",",array_column($testlist, 'user_id'));
}else{
$testlist = false;
}
//获取现金充值
$map = array(
"pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1,
"pay_way"=>array("GT",0)
);
if($testlist) $map['user_id']=array("in",$testlist);
$cash_spend = $this->SpendModel
->field("IFNULL(SUM(pay_amount),0) as pay_amount")
->where($map)
->find()['pay_amount'];
//获取平台币充值
$map1 = array(
"create_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1
);
if($testlist) $map1['user_id']=array("in",$testlist);
$deposit = $this->DepositModel->field("IFNULL(sum(pay_amount),0) pay_amount")->where($map1)->find()['pay_amount'];
$temparr['sum_money'] = number_format(($cash_spend*100+$deposit*100)/100, 2, '.', '');
$this->adddata[]=$temparr;
}
//奖罚收入
protected function getRewardRecordIncome()
{
$map = array(
"reward_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
);
$rrres = M("RewardRecord","tab_")
->field("
IFNULL(SUM(CASE WHEN reward_type = 1 THEN money ELSE 0 END),0) as reward_count,
IFNULL(SUM(CASE WHEN reward_type = 2 THEN money ELSE 0 END),0) as fine_count
")
->where($map)
->find();
//奖励负,惩罚正
$this->adddata[] = array(
"key_name"=>'reward_count',
"type"=>1,
"sort"=>6,
'sum_money'=>$rrres['reward_count']
);
$this->adddata[] = array(
"key_name"=>'fine_count',
"type"=>1,
"sort"=>7,
'sum_money'=>$rrres['fine_count']
);
}
/**
* 获取类型为2,3的数据/按合作方类型
*/
public function setPromoteMoney()
{
$map = array(
"pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1
);
$res = $this->SpendModel
->alias('s')
->field("IFNULL(SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END),0) as cash_count,
IFNULL(SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END),0) as balance_coin_count,
IFNULL(SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END),0) as bind_coin_count,
promote.company_belong")
->where($map)
->join("tab_promote promote ON s.promote_id = promote.id", "left")
->group("company_belong")
->select();
$inside_count = 0;//内团
$outer_count = 0;//外团
$outer_branch_count = 0;//外团分发
$other_group_count = 0;//其他
$inside_nobind_count = 0;
$outer_nobind_count = 0;
$outer_branch_nobind_count = 0;
$other_group_nobind_count = 0;//其他
foreach ($res as $k => $v) {
if($v['company_belong'] == 1){
$outer_count = $v['cash_count']*100+$v['balance_coin_count']*100+$v['bind_coin_count']*100;
$outer_nobind_count = $v['cash_count']*100+$v['balance_coin_count']*100;
}elseif($v['company_belong'] == 2){
//外团分发
$outer_branch_count = $v['cash_count']*100+$v['balance_coin_count']*100+$v['bind_coin_count']*100;
$outer_branch_nobind_count = $v['cash_count']*100+$v['balance_coin_count']*100;
}elseif($v['company_belong'] == 3){
//其他
$other_group_count = $v['cash_count']*100+$v['balance_coin_count']*100+$v['bind_coin_count']*100;
$other_group_nobind_count = $v['cash_count']*100+$v['balance_coin_count']*100;
}else{
//有可能存在官方渠道company_belong=null
$inside_count += ($v['cash_count']*100+$v['balance_coin_count']*100+$v['bind_coin_count']*100);
$inside_nobind_count += ($v['cash_count']*100+$v['balance_coin_count']*100);
}
}
//处理数据
$this->adddata[] = array(
"key_name"=>'inside_count',
"type"=>2,"sort"=>1,
"sum_money"=>number_format($inside_count/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'outer_count',
"type"=>2,"sort"=>2,
"sum_money"=>number_format($outer_count/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'outer_branch_count',
"type"=>2,"sort"=>3,
"sum_money"=>number_format($outer_branch_count/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'other_group_count',
"type"=>2,"sort"=>4,
"sum_money"=>number_format($other_group_count/100, 2, '.', '')
);
//不含绑定币
$this->adddata[] = array(
"key_name"=>'inside_count',
"type"=>3,"sort"=>1,
"sum_money"=>number_format($inside_nobind_count/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'outer_count',
"type"=>3,"sort"=>2,
"sum_money"=>number_format($outer_nobind_count/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'outer_branch_count',
"type"=>3,"sort"=>3,
"sum_money"=>number_format($outer_branch_nobind_count/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'other_group_count',
"type"=>3,"sort"=>4,
"sum_money"=>number_format($other_group_nobind_count/100, 2, '.', '')
);
}
/**
* 获取类型为4,5的数据/按支付渠道类型,支付类型类型
*/
public function setPayWayMoney()
{
$moneyarry=[
"wx"=>0,
"zfb"=>0,
"gfzfb"=>0,
"sqzfb"=>0,
"sqkj"=>0
];
$this->getSpendPayWay($moneyarry);
$this->getGameSupersignPayWay($moneyarry);
$this->getDepositPayWay($moneyarry);
$this->getCoinPayOrderPayWay($moneyarry);
//统计数据
$moneyarry['zfb'] = ($moneyarry['gfzfb']-0+$moneyarry['sqzfb']);
$this->adddata[] = array(
"key_name"=>'gfwx_count',
"type"=>4,"sort"=>1,
"sum_money"=>number_format($moneyarry['wx']/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'gfzfb_count',
"type"=>4,"sort"=>2,
"sum_money"=>number_format($moneyarry['gfzfb']/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'sqzfb_count',
"type"=>4,"sort"=>3,
"sum_money"=>number_format($moneyarry['sqzfb']/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'sqkj_count',
"type"=>4,"sort"=>4,
"sum_money"=>number_format($moneyarry['sqkj']/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'wx_count',
"type"=>5,"sort"=>1,
"sum_money"=>number_format($moneyarry['wx']/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'zfb_count',
"type"=>5,"sort"=>2,
"sum_money"=>number_format($moneyarry['zfb']/100, 2, '.', '')
);
$this->adddata[] = array(
"key_name"=>'kj_count',
"type"=>5,"sort"=>3,
"sum_money"=>number_format($moneyarry['sqkj']/100, 2, '.', '')
);
}
//获取spend表
protected function getSpendPayWay(&$moneyarry){
$map = array(
"pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1,
"pay_way"=>array("IN","1,2,3,9,15")
);
$dbres=$this->SpendModel
->field("
IFNULL(SUM(CASE WHEN pay_way = 2 THEN pay_amount ELSE 0 END),0) as wxsm_count,
IFNULL(SUM(CASE WHEN pay_way = 3 THEN pay_amount ELSE 0 END),0) as wxapp_count,
IFNULL(SUM(CASE WHEN pay_way = 1 THEN pay_amount ELSE 0 END),0) as zfbgf_count,
IFNULL(SUM(CASE WHEN pay_way = 9 THEN pay_amount ELSE 0 END),0) as zfbsq_count,
IFNULL(SUM(CASE WHEN pay_way = 15 THEN pay_amount ELSE 0 END),0) as kjsq_count
")
->where($map)
->find();
$moneyarry['wx'] += ($dbres['wxsm_count']*100+$dbres['wxapp_count']*100);
$moneyarry['gfzfb'] += $dbres['zfbgf_count']*100;
$moneyarry['sqzfb'] += $dbres['zfbsq_count']*100;
$moneyarry['sqkj'] += $dbres['kjsq_count']*100;
}
//获取超级签购买
protected function getGameSupersignPayWay(&$moneyarry)
{
$map = array(
"pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1
);
$dbres=$this->GameSupersignModel
->field("
IFNULL(SUM(CASE WHEN pay_way = 2 THEN pay_price ELSE 0 END),0) as wx_count,
IFNULL(SUM(CASE WHEN pay_way = 1 THEN pay_price ELSE 0 END),0) as zfb_count
")
->where($map)
->find();
$moneyarry['wx'] += $dbres['wx_count'];
$moneyarry['gfzfb'] += $dbres['zfb_count'];
}
//玩家购买平台币
protected function getDepositPayWay(&$moneyarry)
{
$map = array(
"create_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"pay_status"=>1,
"pay_way"=>array("IN","1,2,3,9,15")
);
$dbres=$this->DepositModel
->field("
IFNULL(SUM(CASE WHEN pay_way = 2 THEN pay_amount ELSE 0 END),0) as wxsm_count,
IFNULL(SUM(CASE WHEN pay_way = 3 THEN pay_amount ELSE 0 END),0) as wxapp_count,
IFNULL(SUM(CASE WHEN pay_way = 1 THEN pay_amount ELSE 0 END),0) as zfbgf_count,
IFNULL(SUM(CASE WHEN pay_way = 9 THEN pay_amount ELSE 0 END),0) as zfbsq_count,
IFNULL(SUM(CASE WHEN pay_way = 15 THEN pay_amount ELSE 0 END),0) as kjsq_count
")
->where($map)
->find();
$moneyarry['wx'] += ($dbres['wxsm_count']*100+$dbres['wxapp_count']*100);
$moneyarry['gfzfb'] += $dbres['zfbgf_count']*100;
$moneyarry['sqzfb'] += $dbres['zfbsq_count']*100;
$moneyarry['sqkj'] += $dbres['kjsq_count']*100;
}
//会长充值平台币
protected function getCoinPayOrderPayWay(&$moneyarry)
{
$map= array(
"pay_time"=> array('BETWEEN',array($this->beginThismonth, $this->endThismonth)),
"order_status"=>array("EGT",1)
);
$dbres= $this->CoinPayOrderModel
->field("
IFNULL(SUM(CASE WHEN pay_way = 2 THEN pay_amount ELSE 0 END),0) as wx_count,
IFNULL(SUM(CASE WHEN pay_way = 1 THEN pay_amount ELSE 0 END),0) as zfb_count
")
->where($map)
->find();
$moneyarry['wx'] += $dbres['wx_count'];
$moneyarry['gfzfb'] += $dbres['zfb_count'];
}
public function addDb()
{
foreach ($this->adddata as $k=> &$v) {
$v["count_month"] = $this->month;
$v["count_year"] = $this->year;
$v["create_time"] = $this->nowdata;
}
$res = $this->FinancialSummaryModel->addAll($this->adddata);
if(!$res){
echo "DB save error";
}else{
}
}
}

@ -176,10 +176,10 @@ class GameController extends ThinkController
$downloadWays = $_POST['download_ways'] ?? [];
if (in_array(GameService::DOWNLOAD_BETA, $downloadWays)) {
if (empty($_POST['beta_url'])) {
return $this->error("请在Beta按钮开启的情况填写Beta链接");
return $this->error("请在极速版下载按钮开启的情况填写极速版下载链接");
}
if (!preg_match("/^((https|http|itms-beta)?:\/\/)[^\s]+/i", $_POST['beta_url'])) {
return $this->error("请填写正确的Beta链接");
return $this->error("请填写正确的极速版下载链接");
}
}
$_POST['relation_game_name'] = $_POST['game_name'];
@ -355,10 +355,10 @@ class GameController extends ThinkController
$downloadWays = $_POST['download_ways'] ?? [];
if (in_array(GameService::DOWNLOAD_BETA, $downloadWays)) {
if (empty($_POST['beta_url'])) {
return $this->error("请在Beta按钮开启的情况填写Beta链接");
return $this->error("请在极速版下载按钮开启的情况填写极速版下载链接");
}
if (!preg_match("/^((https|http|itms-beta)?:\/\/)[^\s]+/i", $_POST['beta_url'])) {
return $this->error("请填写正确的Beta链接");
return $this->error("请填写正确的极速版下载链接");
}
}
/*if($_POST['apply_status']==0&&$_POST['game_status']==1){

@ -1,4 +1,5 @@
<?php
use Admin\FinancialSummarySetController;
namespace Admin\Controller;
/**
@ -7,6 +8,20 @@ namespace Admin\Controller;
*/
class OldCountController extends \Think\Controller
{
//财务分类汇总统计旧数据聚合
public function FinancialSummaryInit()
{
//清空数据库
$sql = "truncate table tab_financial_summary";
$res = M()->execute($sql);
echo "tab_financial_summary 清空成功".PHP_EOL;
//获取19年9月到上个月的所有月份
$monthList = $this->getMonthsList();
$Financial = new FinancialSummarySetController();
foreach ($monthList as $k => $v) {
$Financial->setMonthFinancialSummary($v);
}
}
//超级签订单新增识别微信或者支付宝2019-12-11
public function gameSupersignPaywayInit()
{
@ -87,5 +102,25 @@ class OldCountController extends \Think\Controller
}
die("init ok");
}
//获取公司月结所需要的所有月份截止至上个月
public function getMonthsList()
{
$start_month = "2019-09";
$temp = strtotime(date('Y-m-01 00:00:00',strtotime('-1 month')));
$end_month = date('Y',$temp)."-".date('m',$temp);
$time_arr = [];
$begin = new \DateTime($start_month);
$end = new \DateTime($end_month);
$end = $end->modify('+1 month');
$interval = new \DateInterval('P1M');
$daterange = new \DatePeriod($begin, $interval ,$end);
foreach($daterange as $date){
$time_arr[] = $date->format("Y-m");
}
return $time_arr;
}
}

@ -0,0 +1,442 @@
<extend name="Public/base" />
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;
height: 35px;
height: 28px;
border-radius: 3px;
font-size: 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 35px;
line-height: 28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height: 26px;
line-height: 26px;
font-size: 12px;
}
.select2-results__option[aria-selected] {
font-size: 12px;
}
.tooltip {
position: relative;
/* display: block; */
/* color: #056dae; */
}
.tooltip .tooltiptext {
display: none;
width: 100%;
background-color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 10px 5px 5px;
position: absolute;
z-index: 1;
bottom: 80%;
left: 0;
border: #000 solid 1px;
line-height: 20px;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: black transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
color: #333;
display: block;
}
</style>
<!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">财务汇总统计</h3>
<p class="description_text"></p>
</div>
<style>
</style>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch search_list fl cf">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list input-list-resway search_label_rehab">
<select id="year" name="year" class="select_gallery" style="width:150px;">
<volist name="YearList" id="vo">
<option value="{$vo.value}" <if condition="I('year') && $vo.value eq I('year')">selected
</if> >{$vo.name}</option>
</volist>
</select>
</div>
<div class="input-list input-list-resway search_label_rehab">
<select id="type" name="type" class="select_gallery" style="width:150px;">
<option value="2" <if condition="I('type') && $vo.value eq 2">selected
</if> >不包含绑币</option>
<option value="3" <if condition="I('type') && $vo.value eq 3">selected
</if> >包含绑币</option>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search"
url="{:U('FinancialSummary/index','model='.$model['name'] .'&row='.I('row'),false)}">
搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<table>
<caption class="" style="text-align: left;font-size: 20px;font-weight: 600;">按收入类型</caption>
<thead>
<tr>
<th>序号</th><th>流水类型</th><th>1月</th><th>2月</th><th>3月</th><th>4月</th><th>5月</th><th>6月</th><th>7月</th><th>8月</th><th>9月</th><th>10月</th><th>11月</th><th>12月</th><th>年度合计</th>
</tr>
</thead>
<tbody>
<volist name="data.income.list" id="income" key="incomekey">
<tr>
<td>{$incomekey}</td>
<td>{$income.name}</td>
<volist name="income.money" id="incomemoney" >
<td>{$incomemoney}</td>
</volist>
</tr>
</volist>
<tr class="data_summary">
<td colspan="2" style="text-align: center;">合计:</td>
<volist name="data.income.count" id="incomecount" >
<td>{$incomecount}</td>
</volist>
</tr>
</tbody>
</table>
<table style="margin-top: 30px;">
<caption class="" style="text-align: left;font-size: 20px;font-weight: 600;">按合作方类型</caption>
<thead>
<tr>
<th>序号</th><th>流水类型</th><th>1月</th><th>2月</th><th>3月</th><th>4月</th><th>5月</th><th>6月</th><th>7月</th><th>8月</th><th>9月</th><th>10月</th><th>11月</th><th>12月</th><th>年度合计</th>
</tr>
</thead>
<tbody>
<volist name="data.promote.list" id="promote" key="promotekey">
<tr>
<td>{$promotekey}</td>
<td>{$promote.name}</td>
<volist name="promote.money" id="promotemoney" >
<td>{$promotemoney}</td>
</volist>
</tr>
</volist>
<tr class="data_summary">
<td colspan="2" style="text-align: center;">合计:</td>
<volist name="data.promote.count" id="promotecount" >
<td>{$promotecount}</td>
</volist>
</tr>
</tbody>
</table>
<table style="margin-top: 30px;">
<caption class="" style="text-align: left;font-size: 20px;font-weight: 600;">按支付渠道类型</caption>
<thead>
<tr>
<th>序号</th><th>流水类型</th><th>1月</th><th>2月</th><th>3月</th><th>4月</th><th>5月</th><th>6月</th><th>7月</th><th>8月</th><th>9月</th><th>10月</th><th>11月</th><th>12月</th><th>年度合计</th>
</tr>
</thead>
<tbody>
<volist name="data.channel.list" id="channel" key="channelkey">
<tr>
<td>{$channelkey}</td>
<td>{$channel.name}</td>
<volist name="channel.money" id="channelmoney" >
<td>{$channelmoney}</td>
</volist>
</tr>
</volist>
<tr class="data_summary">
<td colspan="2" style="text-align: center;">合计:</td>
<volist name="data.channel.count" id="channelcount" >
<td>{$channelcount}</td>
</volist>
</tr>
</tbody>
</table>
<table style="margin-top: 30px;">
<caption class="" style="text-align: left;font-size: 20px;font-weight: 600;">支付类型类型</caption>
<thead>
<tr>
<th>序号</th><th>流水类型</th><th>1月</th><th>2月</th><th>3月</th><th>4月</th><th>5月</th><th>6月</th><th>7月</th><th>8月</th><th>9月</th><th>10月</th><th>11月</th><th>12月</th><th>年度合计</th>
</tr>
</thead>
<tbody>
<volist name="data.payway.list" id="payway" key="paywaykey">
<tr>
<td>{$paywaykey}</td>
<td>{$payway.name}</td>
<volist name="payway.money" id="paywaymoney" >
<td>{$paywaymoney}</td>
</volist>
</tr>
</volist>
<tr class="data_summary">
<td colspan="2" style="text-align: center;">合计:</td>
<volist name="data.payway.count" id="paywaycount" >
<td>{$paywaycount}</td>
</volist>
</tr>
</tbody>
</table>
<div style="width: 100%;height: 50px;"></div>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script type="text/javascript">
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U("FinancialSummary/index")}');
$(function () {
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
});
</script>
<script type="text/javascript">
$(function () {
$(".coin-detail").click(function () {
var pay_type = $(this).data('pay_type');
var url = $(this).data('url');
var title = pay_type == -1 ? '内充支出明细' :(pay_type == 0 ? '平台币直充明细': '平台币内充明细');
layer.open({
type: 2,
title: title,
shadeClose: true,
shade: 0.8,
area: ['70%', '80%'],
content: url
});
});
$(".select_gallery").select2();
//搜索功能
$("#search").click(function () {
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
var start = $("#time_start").val();
var end = $("#time_end").val();
if (start != '' && end != '') {
if (Date.parse(start) > Date.parse(end)) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
}
window.location.href = url;
});
$(".paixu").click(function () {
var that = $(this);
$data_order = that.attr('data-order');
$order_type = '{$userarpu_order}';
if ($order_type == '' || $order_type == '4') {
$(".sortBy").attr('name', 'data_order');
val = '3,' + $data_order;
$(".sortBy").attr('value', val);
$("#search").click();
} else if ($order_type == '3') {
$(".sortBy").attr('name', 'data_order');
val = '4,' + $data_order;
$(".sortBy").attr('value', val);
$("#search").click();
}
});
$('.jssamlllist').click(function () {
var that = $(this), url = that.attr('data-url');
var url =
layer.open({
type: 2,
title: "【" + that.attr('data-account') + "】小号列表",
shadeClose: true,
shade: 0.8,
area: ['1062px', '80%'],
content: url,//iframe的url
});
return false;
});
$(".paixu").click(function () {
var val = $(this).attr('data-order');
if (val == 1) {
val = 2;
} else if (val == 2) {
val = 1;
}
var name = $(this).attr('name');
if (name == 'balance_status') {
$('#key').val(1);
} else {
$('#key').val(2);
}
$("#" + name).val(val);
$("#search").click();
});
//回车自动提交
$('.jssearch').find('input').keyup(function (event) {
if (event.keyCode === 13) {
$("#search").click();
}
});
$("#total_status").click(function () {
$("#search").click();
})
$('#time_start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
var promote_id = "{:I('promote_id')}";
var company_id = "{:I('company_id')}";
function getPromotersByCompanyid() {
var company_id = $("#company_id option:selected").val();
if(!company_id){
company_id = -1;
}
$.ajax({
url: "{:U('Ajax/getPromotersByCompanyid')}",
type: "get",
data: { company_id:company_id},
dataType: 'json',
success: function (response) {
str = '<option value="">请选择会长</option>';
if(company_id == 0 || company_id ==-1){
str +='<option value="0"' + (promote_id && 0 == promote_id ? 'selected' : '') + '>官方渠道</option>';
}
data = response.data;
for (var i in data) {
str += "<option value='" + data[i].id + "' " + (promote_id && data[i].id == promote_id ? 'selected' : '') + ">" + data[i].nickname + "</option>"
}
$("#promote_id").empty();
$("#promote_id").append(str);
$("#promote_id").select2();
}
})
}
getPromotersByCompanyid();
$("#company_id").change(function(){
getPromotersByCompanyid();
})
})
function shenhe(status) {
var text = $("input:checkbox[name='ids[]']:checked").map(function (index, elem) {
return $(elem).val();
}).get().join("\n");
var desc = '';
if (status == 0) {
desc = '锁定';
} else {
desc = '开启';
}
layer.prompt({
formType: 2,
value: text,
placeholder: '玩家账号(一个账号一行)',
title: '请输入要' + desc + '的玩家账号(一个账号一行)',
area: ['800px', '350px'] //自定义文本域宽高
}, function (value, index, elem) {
if (value == '') {
layer.msg("请输入账户ID");
return;
}
$.ajax({
cache: true,
type: "POST",
url: "{:U('Member/lock_status')}",
data: { accounts: value, lock_status: status },// 你的formid
async: false,
error: function (data) {
layer.alert("服务器故障,请稍后重试!", { icon: 2 });
},
success: function (data) {
// var obj = JSON.parse(data);
// layer.alert(obj.info,{icon:obj.status})
layer.alert(data.info, { icon: data.status })
window.location.reload()
}
});
layer.close(index);
});
}
</script>
</block>

@ -258,7 +258,7 @@
<div class="text-wrapper">
<div style="padding: 0 0.39rem 0.15rem 0.36rem;">
<?php if (($game['download_ways'] & 2) == 2):?>
<div class="text">极速下载:畅享稳定游戏拒绝频繁掉签极速下载不丢游戏不丢数据高端定制仅针对IOS用户免费开放!</div>
<div class="text">极速下载:免费极速下载高端定制游戏稳定仅针对IOS用户开放!</div>
<?php endif;?>
<?php if (($game['download_ways'] & 4) == 4):?>
<div class="text">至尊下载10元购买永不闪退、不丢数据稳定与保障。同意设备安装一次可在一年内无限次下载重装并赠送限量至尊超级礼包</div>

@ -1332,3 +1332,18 @@ ALTER TABLE `tab_promote_company`
CHANGE COLUMN `bank_address` `bank_address` VARCHAR(60) NOT NULL DEFAULT '' COMMENT '开户网点' AFTER `bank_name`,
CHANGE COLUMN `platform_name` `platform_name` VARCHAR(60) NOT NULL DEFAULT '' COMMENT '平台名称' AFTER `bank_address`,
CHANGE COLUMN `contact_begin` `contact_begin` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '合同开始时间' AFTER `platform_name`;
--- chenzhi----
CREATE TABLE `tab_financial_summary` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`type` tinyint(3) NOT NULL DEFAULT '0' COMMENT '汇总分类:1按收入类型,2按合作方不包含绑币,3按合作方包含绑币,4按支付渠道,5支付类型',
`key_name` varchar(50) DEFAULT '' COMMENT '类型名称',
`sort` int(11) DEFAULT '0' COMMENT '排序',
`sum_money` decimal(10,2) DEFAULT '0.00' COMMENT '流水',
`count_month` varchar(10) DEFAULT '' COMMENT '统计月份',
`count_year` varchar(10) DEFAULT '' COMMENT '统计年份',
`create_time` int(10) NOT NULL DEFAULT '0' COMMENT '最后更新时间',
PRIMARY KEY (`id`) USING BTREE,
KEY `count_year` (`count_year`) USING BTREE,
KEY `key_name` (`key_name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='财务分类汇总统计';

Loading…
Cancel
Save