<?php include_once(mvc::$cfg['PATH_TPL'].'public/headBase2.php');?>
<div class="layui-card">
	<div class="layui-card-body">
		<div style="padding:0 10px 10px 0;">
			<?php foreach($yearArr as $k=>$v){?>
			<a href="<?php echo mvc::$cfg['ADMIN_URI'];?>pjl/onlineMoneyTj?year=<?php echo $v;?>" style="margin-left:10px;" class="a_blue"><?php echo $v;?>年</a>
			<?php }?>
		</div>
		<blockquote class="layui-elem-quote layui-quote-nm money-tj" style="width:800px;">
			<label>归宜配：</label><span class="gray">积分充值、汽配搜</span><br>
			<label>归跑街：</label><span class="gray">PC会员、PC资源包、打电话充值、跑街令订单(无佣金)、商城订单(8%佣金)</span>
		</blockquote>
		<table class="layui-table" style="width:1000px;">
		  <thead>
			<tr>
				<th width="55" rowspan="3">月份</th>
				<th class="center tdbg1" colspan="2">归宜配</th>
				<th class="center" colspan="6">归跑街（含商家交易手续费）</th>
				<th class="center tdbg1" colspan="3">归商家</th>
			</tr> 
			<tr>
				<th class="center tdbg1" colspan="2">微信宜配</th>

				<th class="center" colspan="2">微信跑街</th>
				<th class="center" colspan="2">支付宝</th>
				<th class="center" colspan="2">小计</th>

				<th class="center tdbg1">微信跑街</th>
				<th class="center tdbg1">支付宝</th>
				<th class="center tdbg1">小计</th>
			</tr>
			<tr>
				<th class="center tdbg1">交易</th>
				<th class="center tdbg1">手续</th>

				<th class="center">交易</th>
				<th class="center">手续</th>
				<th class="center">交易</th>
				<th class="center">手续</th>
				<th class="center">交易</th>
				<th class="center">手续</th>
				<th class="center tdbg1">交易</th>
				<th class="center tdbg1">交易</th>
				<th class="center tdbg1">交易</th>
			</tr>
		  </thead>
		  <tbody>
		  	<tr>
				<th><b>合计</b></th>
				<th class="tdbg1"><?php if($allTj['yp']['weixinYP']['total'] > 0) echo sprintf('%.2f', $allTj['yp']['weixinYP']['total']);?></th>
				<th class="tdbg1"><?php if($allTj['yp']['weixinYP']['fee'] > 0) echo sprintf('%.2f', $allTj['yp']['weixinYP']['fee']);?></th>
				
				<th><?php if($allTj['pjl']['weixinPJL']['total'] > 0) echo sprintf('%.2f', $allTj['pjl']['weixinPJL']['total']);?></th>
				<th><?php if($allTj['pjl']['weixinPJL']['fee'] > 0) echo sprintf('%.2f', $allTj['pjl']['weixinPJL']['fee']);?></th>
				<th><?php if($allTj['pjl']['alipayPJL']['total'] > 0) echo sprintf('%.2f', $allTj['pjl']['alipayPJL']['total']);?></th>
				<th><?php if($allTj['pjl']['alipayPJL']['fee'] > 0) echo sprintf('%.2f', $allTj['pjl']['alipayPJL']['fee']);?></th>
				<th><?php if($allTj['pjl']['total']['total'] > 0) echo sprintf('%.2f', $allTj['pjl']['total']['total']);?></th>
				<th><?php if($allTj['pjl']['total']['fee'] > 0) echo sprintf('%.2f', $allTj['pjl']['total']['fee']);?></th>

				<th class="tdbg1"><?php if($allTj['shop']['weixinPJL']['total'] > 0) echo sprintf('%.2f', $allTj['shop']['weixinPJL']['total']);?></th>
				<th class="tdbg1"><?php if($allTj['shop']['alipayPJL']['total'] > 0) echo sprintf('%.2f', $allTj['shop']['alipayPJL']['total']);?></th>
				<th class="tdbg1"><?php if($allTj['shop']['total']['total'] > 0) echo sprintf('%.2f', $allTj['shop']['total']['total']);?></th>
			</tr>
			<?php foreach($tjArr as $ym => $v ){ ?>
			<tr>
				<td><?php echo $ym;?></td>
				<td class="tdbg1"><?php if($v['yp']['weixinYP']['total'] > 0) echo sprintf('%.2f', $v['yp']['weixinYP']['total']);?></td>
				<td class="tdbg1"><?php if($v['yp']['weixinYP']['fee'] > 0) echo sprintf('%.2f', $v['yp']['weixinYP']['fee']);?></td>

				<td><?php if($v['pjl']['weixinPJL']['total'] > 0) echo sprintf('%.2f', $v['pjl']['weixinPJL']['total']);?></td>
				<td><?php if($v['pjl']['weixinPJL']['fee'] > 0) echo sprintf('%.2f', $v['pjl']['weixinPJL']['fee']);?></td>
				<td><?php if($v['pjl']['alipayPJL']['total'] > 0) echo sprintf('%.2f', $v['pjl']['alipayPJL']['total']);?></td>
				<td><?php if($v['pjl']['alipayPJL']['fee'] > 0) echo sprintf('%.2f', $v['pjl']['alipayPJL']['fee']);?></td>
				<td><?php if($v['pjl']['total']['total'] > 0) echo sprintf('%.2f', $v['pjl']['total']['total']);?></td>
				<td><?php if($v['pjl']['total']['fee'] > 0) echo sprintf('%.2f', $v['pjl']['total']['fee']);?></td>

				<td class="tdbg1"><?php if($v['shop']['weixinPJL']['total'] > 0) echo sprintf('%.2f', $v['shop']['weixinPJL']['total']);?></td>
				<td class="tdbg1"><?php if($v['shop']['alipayPJL']['total'] > 0) echo sprintf('%.2f', $v['shop']['alipayPJL']['total']);?></td>
				<td class="tdbg1"><?php if($v['shop']['total']['total'] > 0) echo sprintf('%.2f', $v['shop']['total']['total']);?></td>
			</tr>
			<?php }?>
		  </tbody>
		</table>
		<br>
		<hr>
		<h3>按账户统计</h3>
		<table class="layui-table" style="width:800px;">
		  <thead>
			<tr>
				<th width="55" rowspan="2">月份</th>
				<th class="center tdbg1" colspan="2">微信宜配</th>
				<th class="center" colspan="2">微信跑街</th>
				<th class="center tdbg1" colspan="2">支付宝</th>
				<th class="center" colspan="2">合计</th>
			</tr> 
			<tr>
				<th class="center tdbg1">交易</th>
				<th class="center tdbg1">手续</th>

				<th class="center">交易</th>
				<th class="center">手续</th>

				<th class="center tdbg1">交易</th>
				<th class="center tdbg1">手续</th>

				<th class="center">交易</th>
				<th class="center">手续</th>
			</tr>
		  </thead>
		  <tbody>
		  	<tr>
				<th><b>合计</b></th>
				<th class="tdbg1"><?php if($tjAcAllArr['weixinYP']['total'] > 0) echo sprintf('%.2f', $tjAcAllArr['weixinYP']['total']);?></th>
				<th class="tdbg1"><?php if($tjAcAllArr['weixinYP']['fee'] > 0) echo sprintf('%.2f', $tjAcAllArr['weixinYP']['fee']);?></th>
				
				<th><?php if($tjAcAllArr['weixinPJL']['total'] > 0) echo sprintf('%.2f', $tjAcAllArr['weixinPJL']['total']);?></th>
				<th><?php if($tjAcAllArr['weixinPJL']['fee'] > 0) echo sprintf('%.2f', $tjAcAllArr['weixinPJL']['fee']);?></th>
				
				<th class="tdbg1"><?php if($tjAcAllArr['alipayPJL']['total'] > 0) echo sprintf('%.2f', $tjAcAllArr['alipayPJL']['total']);?></th>
				<th class="tdbg1"><?php if($tjAcAllArr['alipayPJL']['fee'] > 0) echo sprintf('%.2f', $tjAcAllArr['alipayPJL']['fee']);?></th>
				
				<th><?php if($tjAcAllArr['all']['total'] > 0) echo sprintf('%.2f', $tjAcAllArr['all']['total']);?></th>
				<th><?php if($tjAcAllArr['all']['fee'] > 0) echo sprintf('%.2f', $tjAcAllArr['all']['fee']);?></th>
			</tr>
			<?php foreach($tjAcArr as $ym => $v ){ ?>
			<tr>
				<td><?php echo $ym;?></td>
				<td class="tdbg1"><?php if($v['weixinYP']['total'] > 0) echo sprintf('%.2f', $v['weixinYP']['total']);?></td>
				<td class="tdbg1"><?php if($v['weixinYP']['fee'] > 0) echo sprintf('%.2f', $v['weixinYP']['fee']);?></td>
				
				<td><?php if($v['weixinPJL']['total'] > 0) echo sprintf('%.2f', $v['weixinPJL']['total']);?></td>
				<td><?php if($v['weixinPJL']['fee'] > 0) echo sprintf('%.2f', $v['weixinPJL']['fee']);?></td>
				
				<td class="tdbg1"><?php if($v['alipayPJL']['total'] > 0) echo sprintf('%.2f', $v['alipayPJL']['total']);?></td>
				<td class="tdbg1"><?php if($v['alipayPJL']['fee'] > 0) echo sprintf('%.2f', $v['alipayPJL']['fee']);?></td>

				<td><?php if($tjAcAllArr[$ym]['total'] > 0) echo sprintf('%.2f', $tjAcAllArr[$ym]['total']);?></td>
				<td><?php if($tjAcAllArr[$ym]['fee'] > 0) echo sprintf('%.2f', $tjAcAllArr[$ym]['fee']);?></td>
			</tr>
			<?php }?>
		  </tbody>
		</table>
	</div>
	



</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>
<script>
layui.use(['table', 'laydate'], function(){
  var table = layui.table,laydate = layui.laydate;
	
	laydate.render({
       elem: '#betime'
      ,range: '~'
    });
});
</script>