Merge pull request 'release' (#189) from release into master
Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/189master
commit
9958c8a281
@ -1,327 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Admin\Controller;
|
||||
use User\Api\UserApi as UserApi;
|
||||
|
||||
/**
|
||||
* 推广查询控制器
|
||||
* @author 王贺
|
||||
*/
|
||||
class QueryController extends ThinkController {
|
||||
public function settlement($p=0) {
|
||||
$group = I('group',1);
|
||||
$this->assign('group',$group);
|
||||
if(isset($_REQUEST['total_status'])){
|
||||
unset($_REQUEST['total_status']);
|
||||
}
|
||||
if ($group == 1) {
|
||||
if($_REQUEST['unum']==1){
|
||||
$order='unum';
|
||||
$order_type=SORT_ASC;
|
||||
}else if($_REQUEST['unum']==0){
|
||||
$order='unum';
|
||||
$order_type=SORT_DESC;
|
||||
}
|
||||
if($_REQUEST['spay_amount']==1){
|
||||
$order='spay_amount';
|
||||
$order_type=SORT_ASC;
|
||||
}else if($_REQUEST['spay_amount']==0){
|
||||
$order='spay_amount';
|
||||
$order_type=SORT_DESC;
|
||||
}
|
||||
$model = array(
|
||||
'title' => '渠道结算',
|
||||
'template_list' =>'settlement',
|
||||
'order' => $order,
|
||||
'order_type'=>$order_type//0倒序 1 正序
|
||||
);
|
||||
$start=$_REQUEST['timestart'];
|
||||
$end=$_REQUEST['timeend'];
|
||||
if(I('group')!=''){
|
||||
if($start==''||$end==''&&$_REQUEST['promote_account']==''){
|
||||
$this->error('结算周期、所属渠道不能为空!','',1);
|
||||
}
|
||||
if($start==''||$end==''){
|
||||
$this->error('请选择结算周期!','',1);
|
||||
}
|
||||
if($_REQUEST['promote_account']==''){
|
||||
$this->error('请选择渠道!','',1);
|
||||
}
|
||||
}
|
||||
if($start && $end){
|
||||
if((strtotime($end)+24*60*60-1)<strtotime($start)){
|
||||
$this->error('时间选择不正确!',U('Query/settlement'),'');
|
||||
}
|
||||
$umap['register_time']=array('BETWEEN',array(strtotime($start),strtotime($end)+24*60*60-1));
|
||||
if(isset($_REQUEST['game_name'])&&$_REQUEST['game_name']!=''){
|
||||
$umap['fgame_name']=$_REQUEST['game_name'];
|
||||
$smap['tab_spend.game_name']=$_REQUEST['game_name'];
|
||||
}
|
||||
if(isset($_REQUEST['promote_account'])&&$_REQUEST['promote_account']!=''){
|
||||
$allid=get_subordinate_promote($_REQUEST['promote_account'],'parent_name');
|
||||
$allid[]=$_REQUEST['promote_account'];
|
||||
$umap['tab_user.promote_account']=array('in',implode(',',$allid));
|
||||
$smap['tab_spend.promote_account']=array('in',implode(',',$allid));
|
||||
}else{
|
||||
$this->error('未选择渠道!','',1);
|
||||
}
|
||||
$umap['is_check']=1;
|
||||
$smap['pay_time']=array('BETWEEN',array(strtotime($start),strtotime($end)+24*60*60-1));
|
||||
$smap['is_check']=1;
|
||||
$map['umap']=$umap;
|
||||
$map['smap']=$smap;
|
||||
$user = A('Settlement','Event');
|
||||
$user->settlement($model,$p,$map);
|
||||
}else{
|
||||
$this->assign('setdate',date("Y-m-d",strtotime("-1 day")));
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
if ($group == 2) {
|
||||
if(isset($_REQUEST['timestart'])&&isset($_REQUEST['timeend'])){
|
||||
$map['create_time']=array('BETWEEN',array(strtotime($_REQUEST['timestart']),strtotime($_REQUEST['timeend'])+24*60*60-1));
|
||||
}
|
||||
if(isset($_REQUEST['game_name'])){
|
||||
if($_REQUEST['game_name']=='全部'){
|
||||
unset($_REQUEST['game_name']);
|
||||
}else{
|
||||
$map['game_name'] = $_REQUEST['game_name'];
|
||||
}
|
||||
}
|
||||
if(isset($_REQUEST['promote_account'])){
|
||||
if($_REQUEST['promote_account']=='全部'){
|
||||
unset($_REQUEST['promote_account']);
|
||||
}else{
|
||||
$map['promote_account'] = $_REQUEST['promote_account'];
|
||||
}
|
||||
}
|
||||
if(!empty($_REQUEST['settlement_number'])){
|
||||
$map['settlement_number'] = $_REQUEST['settlement_number'];
|
||||
}
|
||||
$model = array(
|
||||
'm_name' => 'settlement',
|
||||
'order' => 'create_time desc ',
|
||||
'title' => '结算账单',
|
||||
'template_list' =>'settlement',
|
||||
);
|
||||
$user = A('Bill','Event');
|
||||
$user->money_list($model,$p,$map);
|
||||
}
|
||||
}
|
||||
public function cpsettlement($p=0) {
|
||||
$group = I('group',1);
|
||||
$this->assign('group',$group);
|
||||
if(isset($_REQUEST['timestart'])&&$_REQUEST['timestart']!=''&&$_REQUEST['group']==1){
|
||||
$starttime=strtotime($_REQUEST['timestart'].'-01');
|
||||
if($starttime>=strtotime(date('Y-m-01'))){
|
||||
$this->error('时间选择不正确','',1);exit;
|
||||
}
|
||||
$endtime=strtotime($_REQUEST['timestart']."+1 month -1 day")+24*3600-1;
|
||||
if(isset($_REQUEST['game_name'])&&$_REQUEST['game_name']!='全部'){
|
||||
$map['g.game_name']=$_REQUEST['game_name'];
|
||||
}
|
||||
if(isset($_REQUEST['selle_status'])){
|
||||
if($_REQUEST['selle_status']=="未结算"){
|
||||
$map['s.selle_status']=0;
|
||||
}else if($_REQUEST['selle_status']=="已结算"){
|
||||
$map['s.selle_status']=1;
|
||||
}
|
||||
}
|
||||
$map['s.pay_status']=1;
|
||||
$map['pay_time']=array('BETWEEN',array($starttime,$endtime));
|
||||
$model = array(
|
||||
'm_name' => 'Spend as s',
|
||||
'order' => 's.id',
|
||||
'title' => '渠道结算',
|
||||
'group' => 'g.developers,g.id',
|
||||
'fields' =>'sum(s.pay_amount) as total,s.selle_ratio,s.id,g.developers,s.selle_status,g.id as gid,g.game_name,s.pay_status,s.pay_amount',
|
||||
'template_list' =>'cpsettlement',
|
||||
);
|
||||
|
||||
$user = A('Spend','Event');
|
||||
$user->cpsettl_list($model,$p,$map);
|
||||
}else if($_REQUEST['group']==2){
|
||||
if(isset($_REQUEST['timestart'])&&$_REQUEST['timestart']!=''){
|
||||
$starttime=strtotime($_REQUEST['timestart'].'-01');
|
||||
if($starttime>=strtotime(date('Y-m-01'))){
|
||||
$this->error('时间选择不正确','',1);exit;
|
||||
}
|
||||
$starttime=strtotime($_REQUEST['timestart'].'-01');
|
||||
$endtime=strtotime($_REQUEST['timestart']."+1 month -1 day")+24*3600-1;
|
||||
$map['pay_time']=array('BETWEEN',array($starttime,$endtime));
|
||||
}
|
||||
$map['s.pay_status']=1;
|
||||
$map['s.selle_status']=1;//已结算
|
||||
$model = array(
|
||||
'm_name' => 'Spend as s',
|
||||
'order' => 's.id',
|
||||
'title' => '渠道结算',
|
||||
'group' => 'g.developers,g.id',
|
||||
'fields' =>'sum(s.pay_amount) as total, s.id,s.selle_ratio,g.developers,s.selle_status,s.selle_time,g.id as gid,g.game_name,s.pay_status,s.pay_amount',
|
||||
'template_list' =>'cpsettlement',
|
||||
);
|
||||
|
||||
$user = A('Spend','Event');
|
||||
$user->cpsettl_list($model,$p,$map);
|
||||
}else{
|
||||
$this->meta_title = '渠道结算列表';
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
public function generatesettlement(){
|
||||
//批量结算要加判断
|
||||
$data['game_id']=$_REQUEST['game_id'];
|
||||
$data['game_name']=get_game_name($_REQUEST['game_id']);
|
||||
$data['promote_id']=$_REQUEST['promote_id'];
|
||||
$data['promote_account']=get_promote_name($_REQUEST['promote_id']);
|
||||
$data['total_money']=$_REQUEST['spay_amount'];
|
||||
$data['total_number']=$_REQUEST['unum'];
|
||||
$data['starttime']=strtotime($_REQUEST['starttime']);
|
||||
$data['endtime']=strtotime($_REQUEST['endtime'])+24*60*60-1;
|
||||
$data['pattern']=$_REQUEST['cooperation']=='CPS'?0:1;
|
||||
$data['ratio']=$_REQUEST['cps_ratio'];
|
||||
$data['money']=$_REQUEST['cpa_price'];
|
||||
$data['create_time']=time();
|
||||
$data['settlement_number']='JS-'.date('Ymd').date('His').sp_random_string(4);
|
||||
if(get_settlement($data['starttime'],$data['promote_id'],$data['game_id'])){
|
||||
$this->error('该结算周期不可结算,请重新选择');
|
||||
}
|
||||
if($data['pattern']){
|
||||
$data['sum_money']=$data['total_number']*$data['money'];
|
||||
}else{
|
||||
$data['sum_money']=$data['total_money']*$data['ratio']/100;
|
||||
}
|
||||
if($data['game_id']==''||$data['promote_id']==''||$data['starttime']==''||$data['endtime']==''){
|
||||
$this->error('必要参数不存在');
|
||||
}
|
||||
$map['fgame_id']=$data['game_id'];
|
||||
// $map['is_check']=1;
|
||||
$map['register_time']=array('BETWEEN',array($data['starttime'],$data['endtime']));
|
||||
$allid=get_subordinate_promote($data['promote_account'],'parent_name');
|
||||
$allid[]=$data['promote_account'];
|
||||
$map['promote_id']=array('in',$data['promote_id']);
|
||||
$u=M('User','tab_');
|
||||
$user=$u->where($map)->setField('settle_check',1);
|
||||
unset($map['register_time']);
|
||||
$map['pay_time']=array('BETWEEN',array($data['starttime'],$data['endtime']));
|
||||
$s=M('spend','tab_');
|
||||
$spend=$s->where($map)->setField('settle_check',1);
|
||||
$result=M('settlement','tab_')->add($data);
|
||||
if($result){
|
||||
$this->success('结算成功');
|
||||
}else{
|
||||
$this->error('结算失败');
|
||||
}
|
||||
}
|
||||
public function generatecpsettlement() {//cp结算
|
||||
$game_id = I('request.ids');
|
||||
if(empty($game_id)){
|
||||
$this->error('请选择要操作的数据');
|
||||
}
|
||||
$starttime=strtotime($_REQUEST['timestart'].'-01');
|
||||
$endtime=strtotime($_REQUEST['timestart']."+1 month -1 day")+24*3600-1;
|
||||
$map['s.pay_status']=1;
|
||||
$map['s.selle_status']=0;
|
||||
if(is_array($game_id)){
|
||||
$map['s.game_id']=array('in',$game_id);
|
||||
}else{
|
||||
$map['s.game_id']=$game_id;
|
||||
}
|
||||
$map['pay_time']=array('BETWEEN',array($starttime,$endtime));
|
||||
$spe=M('spend as s','tab_');
|
||||
$smap= array('s.selle_time'=>$_REQUEST['timestart'],'s.selle_status'=>1);
|
||||
$data=$spe
|
||||
->field('s.id,s.selle_status,s.selle_time')
|
||||
->join('tab_game as g on g.id=s.game_id','LEFT')
|
||||
->where($map)
|
||||
->setField($smap);
|
||||
if($data){
|
||||
$this->success('结算成功');
|
||||
}else{
|
||||
$this->error('结算失败');
|
||||
}
|
||||
|
||||
}
|
||||
public function changeratio(){
|
||||
$gid = I('request.game_id');
|
||||
if(empty($gid)){
|
||||
$this->ajaxReturn(0,"请选择要操作的数据",0);exit;
|
||||
}
|
||||
$starttime=strtotime($_REQUEST['timestart'].'-01');
|
||||
$endtime=strtotime($_REQUEST['timestart']."+1 month -1 day")+24*3600-1;
|
||||
$map['s.pay_status']=1;
|
||||
$map['s.selle_status']=0;
|
||||
$map['s.game_id']=$_REQUEST['game_id'];
|
||||
$map['pay_time']=array('BETWEEN',array($starttime,$endtime));
|
||||
$spe=M('spend as s','tab_');
|
||||
$data=$spe
|
||||
->field('s.id,s.selle_status,s.selle_ratio')
|
||||
->join('tab_game as g on g.id=s.game_id','LEFT')
|
||||
->where($map)
|
||||
->setField('s.selle_ratio',$_POST['ratio']);
|
||||
if($data){
|
||||
$this->ajaxReturn($data);
|
||||
}else{
|
||||
$this->ajaxReturn(-1);
|
||||
}
|
||||
}
|
||||
public function withdraw() {
|
||||
|
||||
if(isset($_REQUEST['settlement_number'])){
|
||||
$map['settlement_number']=$_REQUEST['settlement_number'];
|
||||
}
|
||||
if(isset($_REQUEST['status'])){
|
||||
$map['status']=$_REQUEST['status'];
|
||||
}
|
||||
if(isset($_REQUEST['promote_account'])){
|
||||
if($_REQUEST['promote_account']=='全部'){
|
||||
unset($_REQUEST['promote_account']);
|
||||
}else{
|
||||
$map['promote_account'] = $_REQUEST['promote_account'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$model = array(
|
||||
'm_name' => 'withdraw',
|
||||
'order' => 'create_time desc ',
|
||||
'title' => '渠道提现',
|
||||
'template_list' =>'withdraw',
|
||||
);
|
||||
|
||||
$user = A('Bill','Event');
|
||||
$user->money_list($model,$p,$map);
|
||||
|
||||
}
|
||||
|
||||
public function set_withdraw_status($model='withdraw') {
|
||||
$withdraw=M('withdraw',"tab_");
|
||||
$seet=M('settlement',"tab_");
|
||||
$count=count($_REQUEST['ids']);
|
||||
if($count>1){
|
||||
for ($i=0; $i <$count; $i++) {
|
||||
$map['id']=$_REQUEST['ids'][$i];
|
||||
$dind=$withdraw->where($map)->find();
|
||||
$se_map['settlement_number']=$dind['settlement_number'];
|
||||
$seet->where($se_map)->save(array("ti_status"=>$_REQUEST['status']));
|
||||
$withdraw->where($map)->save(array("end_time"=>time()));
|
||||
}
|
||||
}else{
|
||||
$map['id']=$_REQUEST['ids'];
|
||||
$dind=$withdraw->where($map)->find();
|
||||
$se_map['settlement_number']=$dind['settlement_number'];
|
||||
$seet->where($se_map)->save(array("ti_status"=>$_REQUEST['status']));
|
||||
$withdraw->where($map)->save(array("end_time"=>time()));
|
||||
}
|
||||
|
||||
parent::set_status($model);
|
||||
}
|
||||
|
||||
|
||||
protected function upPromote($promote_id){
|
||||
$model = D('Promote');
|
||||
$data['id'] = $promote_id;
|
||||
$data['money'] = 0;
|
||||
return $model->save($data);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace Admin\Controller;
|
||||
//use Think\Controller;
|
||||
/**
|
||||
* 上下游结算单
|
||||
* @author cz
|
||||
*/
|
||||
class SubUserStatementController extends ThinkController
|
||||
{
|
||||
|
||||
public $DBModel;
|
||||
public function _initialize()
|
||||
{
|
||||
$this->DBModel = M("UserStatement","sub_",SUBSITE_DB);//指定子库
|
||||
parent::_initialize();
|
||||
}
|
||||
|
||||
public function lists() {
|
||||
$params = I('get.');
|
||||
$page = $params['p'] ? intval($params['p']) : 1;
|
||||
$row = $params['row'] ? intval($params['row']) : 10;
|
||||
|
||||
//权限分配
|
||||
$map = [
|
||||
"_string"=>"1=1"
|
||||
];
|
||||
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
|
||||
$time_start = strtotime($_REQUEST['time_start']);
|
||||
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
|
||||
$map["_string"] = "(statement_begin_time BETWEEN {$time_start} AND {$time_end}) OR (statement_end_time BETWEEN {$time_start} AND {$time_end}) OR (statement_begin_time <= {$time_end} AND statement_end_time >= {$time_end})";
|
||||
} elseif (isset($_REQUEST['time_start'])) {
|
||||
$time_start = strtotime($_REQUEST['time_start']);
|
||||
$map["_string"] = "(statement_begin_time >= {$time_start} ) OR (statement_end_time >= {$time_start})";
|
||||
} elseif (isset($_REQUEST['time_end'])) {
|
||||
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
|
||||
$map["_string"] = "(statement_begin_time <= {$time_end} ) OR (statement_end_time <= {$time_end})";
|
||||
}
|
||||
|
||||
$data = $this->DBModel->where($map)->page($page,$row)->field("statement_info",true)->order("statement_begin_time desc")->select();
|
||||
foreach ($data as $k => &$v) {
|
||||
$v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']);
|
||||
$v['statement_end_time'] = date('Y.m.d',$v['statement_end_time']);
|
||||
$v["valid"] = "{$v['statement_begin_time']}-{$v['statement_end_time']}";
|
||||
}
|
||||
|
||||
$count = $this->DBModel->where($map)->count();
|
||||
|
||||
$params['p'] = $page;
|
||||
$params['row'] = $row;
|
||||
$page = set_pagination($count, $row, $params);
|
||||
if ($page) {
|
||||
$this->assign('_page', $page);
|
||||
}
|
||||
$this->assign('data',$data);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function updateStatement()
|
||||
{
|
||||
if(!isset($_REQUEST['id'])){
|
||||
$this->error('参数错误');
|
||||
}
|
||||
$id = $_REQUEST['id'];
|
||||
$temp = $this->DBModel->where(['id'=>$id])->getField('statement_end_time');
|
||||
$temp = date('Y-m-d',$temp-0+1);
|
||||
|
||||
$params = "php ".SUBSITE_INDEX." SubCompanyStatementSet/setFreeDateCount/begin/{$temp}/end/{$temp}/company/pu";
|
||||
$r = D("CmdTasks")->addTask("SubCompanyStatementSet",$params,true);
|
||||
if($r){
|
||||
$this->DBModel->where(['id'=>$id])->delete();
|
||||
$this->ajaxReturn(["status"=>1,"info"=>"旧数据已删除且重算登记成功,请稍后刷新页面查看最新数据"]);
|
||||
}else{
|
||||
$this->ajaxReturn(["status"=>0,"info"=>"重算登记错误"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function viewStatement()
|
||||
{
|
||||
$is_export= false;
|
||||
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
|
||||
$is_export = true;
|
||||
}
|
||||
|
||||
if(!isset($_REQUEST['id'])){
|
||||
$this->error('参数错误');
|
||||
}
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
$data = $this->DBModel->where(['id'=>$id])->getField("statement_info");
|
||||
$data = json_decode($data,true);
|
||||
$line = 2;
|
||||
foreach ($data as $k => &$v) {
|
||||
$v['row'] = count($v['statement_info']);
|
||||
if ($is_export) {
|
||||
foreach ($v['statement_info'] as $key => &$val) {
|
||||
$val['sum_money'] = "=ROUND(F{$line}*G{$line},2)";
|
||||
$line++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($is_export) {
|
||||
$title = $data[0]['statement_info'][0]['statement_begin_time']."-".$data[0]['statement_info'][0]['statement_end_time']."个人汇总单";
|
||||
$this->assign("title",$title);
|
||||
}
|
||||
$this->assign("data",$data);
|
||||
$this->assign("is_export",$is_export);
|
||||
$this->display("viewPuPool");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,278 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
|
||||
<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 src="__STATIC__/juicer-min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<style>
|
||||
html {
|
||||
min-width:100%;
|
||||
}
|
||||
body {
|
||||
padding: 0px 0px 150px;
|
||||
width: 960px;
|
||||
margin: auto;
|
||||
}
|
||||
.tabcon1711 table{
|
||||
width: 480px;
|
||||
}
|
||||
table{
|
||||
|
||||
margin: auto;
|
||||
}
|
||||
.hidebox{
|
||||
display: none;
|
||||
}
|
||||
.r{
|
||||
width: 300px;
|
||||
}
|
||||
.l{
|
||||
width: 180px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.input-list, .i_list {
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
<body>
|
||||
<div style="height: 20px"></div>
|
||||
<div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
|
||||
<div class="tab-content tabcon1711" >
|
||||
<div class="input-list input-list-game search_label_rehab" style="margin-left: 375px;">
|
||||
<select name="promote_company" id="promote_company" class="select_gallery">
|
||||
<option>请选择下游公司</option>
|
||||
<foreach name="company_data" item="company_data">
|
||||
<option value="{$company_data['id']}" data-company_name="{$company_data['company_name']}">{$company_data['company_name']}</option>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div><span style="line-height: 20px; margin-left: 15px">结算单</span>
|
||||
<div style="margin-top: 20px;width: 100%;line-height: 20px;font-weight: 600;text-align: center;" class="time"
|
||||
data-begin="{$amount_data['statement_begin_time']}" data-end="{$amount_data['statement_end_time']}">({$amount_data['statement_begin_time']}-{$amount_data['statement_end_time']})</div>
|
||||
|
||||
<div class="data_list box_mt" style="margin-top: 10px;">
|
||||
<div >
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>结算月份</th>
|
||||
<th>合作产品名称</th>
|
||||
<th>月累计用户充值流水</th>
|
||||
<th>月新增用户数</th>
|
||||
<th>税费费率</th>
|
||||
<th>结算金额(元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody >
|
||||
<tr>
|
||||
<td>{$data[0]['statement_begin_time']}-{$data[0]['statement_end_time']}</td>
|
||||
<td>{$data[0]['game_name']}</td>
|
||||
<td rowspan="{$row}" class="pay_amount">{$amount_data['pay_amount']}</td>
|
||||
<td rowspan="{$row}" class="user_newcount">{$amount_data['user_newcount']}</td>
|
||||
<td rowspan="{$row}" class="parent_fax_ratio"><input class="fax_ratio" type="text" class="txt" name="fax_ratio" value="0" placeholder="" style="width: 25px">%</td>
|
||||
<td rowspan="{$row}" class="sum_money">{$amount_data['sum_money']}</td>
|
||||
</tr>
|
||||
<foreach name="data" item="it" key="key">
|
||||
|
||||
<if condition="$key neq 0">
|
||||
<tr>
|
||||
<td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>
|
||||
<td>{$it['game_name']}</td>
|
||||
</tr>
|
||||
</if>
|
||||
|
||||
</foreach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="tab-content tabcon1711">
|
||||
<div class="form-item cf">
|
||||
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.parent.reload();" style="float: right">
|
||||
返回
|
||||
</a>
|
||||
<button class="submit_btn" id="submit_btn" style="float: right">
|
||||
保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
|
||||
$(".select_gallery").select2();
|
||||
|
||||
$(function () {
|
||||
|
||||
var sum_amount = parseFloat($(".sum_money").text());
|
||||
var row = 0;
|
||||
var amount_datas;
|
||||
var other_list;
|
||||
var list = '{$js_data}';
|
||||
var company_id;
|
||||
var other_id;
|
||||
|
||||
$(".submit_btn").click(function () {
|
||||
|
||||
var id = "{$_GET['id']}";
|
||||
|
||||
if (!company_id) {
|
||||
layer.msg("请选择汇总公司");
|
||||
return;
|
||||
}
|
||||
|
||||
var fax_ratio = $(".fax_ratio").val();
|
||||
layer.load(2);
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "{:U('saveCompanyData')}",
|
||||
data:{list:list,other_list:other_list,company_id:company_id,amount_data:amount_datas,fax_ratio:fax_ratio,id:id,other_id:other_id},
|
||||
success: function(data) {
|
||||
layer.msg(data.msg);
|
||||
if(data.status == 1) {
|
||||
setTimeout(function(){
|
||||
layer.close(2);
|
||||
window.parent.reload();
|
||||
},3000);
|
||||
}
|
||||
layer.closeAll("loading");
|
||||
},
|
||||
error:function(){
|
||||
layer.closeAll("loading");
|
||||
layer.alert("网络错误或超时");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("#promote_company").change(function () {
|
||||
var begin = $(".time").data("begin");
|
||||
var end = $(".time").data("end");
|
||||
|
||||
company_id = $(this).val();
|
||||
|
||||
if (company_id == "请选择下游公司") {
|
||||
company_id = '';
|
||||
}
|
||||
|
||||
var id = "{$_GET['id']}";
|
||||
var amount_data = '{$js_amount_data}';
|
||||
|
||||
$(".other_append").remove();
|
||||
$(".pay_amount").attr("rowspan",parseInt($(".pay_amount").attr('rowspan'))-row);
|
||||
$(".user_newcount").attr("rowspan",parseInt($(".user_newcount").attr('rowspan'))-row);
|
||||
$(".parent_fax_ratio").attr("rowspan",parseInt($(".parent_fax_ratio").attr('rowspan'))-row);
|
||||
$(".sum_money").attr("rowspan",parseInt($(".sum_money").attr('rowspan'))-row);
|
||||
layer.load(2);
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "{:U('checkCompanyData')}",
|
||||
data:{begin_time:begin,end_time:end,company_id:company_id,statement_id:id,amount_data:amount_data,list:list},
|
||||
success: function(data) {
|
||||
if (data.status==1) {
|
||||
for (var key in data.list) {
|
||||
|
||||
var tr = "<tr class='other_append'>" +
|
||||
"<td>"+data.list[key]['statement_begin_time']+"-"+data.list[key]['statement_end_time']+"</td>" +
|
||||
"<td>"+data.list[key]['game_name']+"</td>" +
|
||||
"</tr>";
|
||||
|
||||
$("tbody").append(tr);
|
||||
|
||||
}
|
||||
|
||||
row = data.row;
|
||||
|
||||
$(".pay_amount").text(data.amount_data['pay_amount']);
|
||||
$(".user_newcount").text(data.amount_data['user_newcount']);
|
||||
// $(".fax_ratio").text(data.amount_data['pay_amount']);
|
||||
$(".sum_money").text(data.amount_data['sum_money']);
|
||||
|
||||
$(".pay_amount").attr("rowspan",parseInt($(".pay_amount").attr('rowspan'))+row);
|
||||
$(".user_newcount").attr("rowspan",parseInt($(".user_newcount").attr('rowspan'))+row);
|
||||
$(".parent_fax_ratio").attr("rowspan",parseInt($(".parent_fax_ratio").attr('rowspan'))+row);
|
||||
$(".sum_money").attr("rowspan",parseInt($(".sum_money").attr('rowspan'))+row);
|
||||
sum_amount = data.amount_data['sum_money'];
|
||||
amount_datas = JSON.stringify(data.amount_data);
|
||||
other_list = JSON.stringify(data.list);
|
||||
other_id = data.other_id;
|
||||
}
|
||||
layer.closeAll("loading");
|
||||
},
|
||||
error:function(){
|
||||
layer.alert("网络错误或超时");
|
||||
layer.closeAll("loading");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".fax_ratio").blur(function() {
|
||||
|
||||
var fax_ratio = parseFloat($(this).val());
|
||||
var pay_amount = parseFloat($(".pay_amount").text());
|
||||
var sum_money = 0;
|
||||
|
||||
var fax_amount = sum_amount * (fax_ratio/100);
|
||||
|
||||
sum_money = sum_amount-fax_amount;
|
||||
|
||||
$(".sum_money").text(sum_money.toFixed(2));
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</html>
|
@ -0,0 +1,280 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
|
||||
<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 src="__STATIC__/juicer-min.js" type="text/javascript"></script>
|
||||
<script src="__STATIC__/table2excel.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
html {
|
||||
min-width:100%;
|
||||
}
|
||||
body {
|
||||
padding: 0px 10px 150px 10px;
|
||||
/* width: 960px; */
|
||||
margin: auto;
|
||||
}
|
||||
/* .tabcon1711 table{
|
||||
width: 480px;
|
||||
} */
|
||||
table{
|
||||
|
||||
margin: auto;
|
||||
}
|
||||
tr{
|
||||
border-bottom: dotted 1px #c7c7c7;
|
||||
}
|
||||
.hidebox{
|
||||
display: none;
|
||||
}
|
||||
.r{
|
||||
width: 300px;
|
||||
}
|
||||
.l{
|
||||
width: 180px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.input-list, .i_list {
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
#statementShow td{
|
||||
line-height: 1.5;
|
||||
padding: 8px 0;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
|
||||
海南万盟天下科技有限公司
|
||||
</div> -->
|
||||
|
||||
<div class="data_list box_mt" style="margin-top: 10px;">
|
||||
<div class="">
|
||||
<table id="exporttable">
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>结算时间</th>
|
||||
<th>产品</th>
|
||||
<th>联运流水</th>
|
||||
|
||||
<th>聚合流水</th>
|
||||
<th>流水合计</th>
|
||||
|
||||
<th>结算比例</th>
|
||||
<th>渠道费率</th>
|
||||
<th>税费费率</th>
|
||||
<th>其他</th>
|
||||
<th>结算金额</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="statementShow">
|
||||
<if condition = "empty($data)">
|
||||
<tr>
|
||||
<td colspan="50" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
|
||||
<foreach name="data" item="first_data" key="index" >
|
||||
<foreach name="first_data" item="data">
|
||||
<tr>
|
||||
<td rowspan="{$data['row']}">{$time}年{$data["time"]}月</td>
|
||||
<if condition="$data['statement_info'][0]['statement_type'] gt 0">
|
||||
<td>{$data['statement_info'][0]['game_name']|default="--"}</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td><if condition="$data['statement_info'][0]['statement_type'] eq 2">-</if>{$data['statement_info'][0]['sum_money']|default="--"}</td>
|
||||
<else/>
|
||||
<td>{$data['statement_info'][0]['game_name']|default="--"}</td>
|
||||
<td>{$data['statement_info'][0]['platform_money']|default="--"}</td>
|
||||
<td>{$data['statement_info'][0]['aggregate_money']|default="--"}</td>
|
||||
<td>{$data['statement_info'][0]['sum_amount']|default="--"}</td>
|
||||
<td>{$data['statement_info'][0]['ratio']|default="--"}</td>
|
||||
<td>{$data['statement_info'][0]['promote_ratio']|default="--"}</td>
|
||||
<td>{$data['statement_info'][0]['fax_ratio']|default="--"}</td>
|
||||
<td>{$data['statement_info'][0]['other_amount']|default="--"}</td>
|
||||
<td>{$data['statement_info'][0]['sum_money']|default="--"}</td>
|
||||
|
||||
</if>
|
||||
|
||||
</tr>
|
||||
<foreach name="data['statement_info']" item="statement_info" key="skey">
|
||||
<if condition="$skey gt 0">
|
||||
<if condition="$statement_info['statement_type'] gt 0">
|
||||
<td>{$statement_info['game_name']|default="--"}</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td>--</td>
|
||||
<td><if condition="$statement_info['statement_type'] eq 2">-</if>{$statement_info['sum_money']|default="--"}</td>
|
||||
<else/>
|
||||
<tr>
|
||||
<td>{$statement_info['game_name']|default="--"}</td>
|
||||
<td>{$statement_info['platform_money']|default="--"}</td>
|
||||
<td>{$statement_info['aggregate_money']|default="--"}</td>
|
||||
<td>{$statement_info['sum_amount']|default="--"}</td>
|
||||
<td>{$statement_info['ratio']|default="--"}</td>
|
||||
<td>{$statement_info['promote_ratio']|default="--"}</td>
|
||||
<td>{$statement_info['fax_ratio']|default="--"}</td>
|
||||
<td>{$statement_info['other_amount']|default="--"}</td>
|
||||
<td>{$statement_info['sum_money']|default="--"}</td>
|
||||
</tr>
|
||||
</if>
|
||||
</if>
|
||||
</foreach>
|
||||
</foreach>
|
||||
<tr>
|
||||
<td>小计</td>
|
||||
<td>--</td>
|
||||
<td>{$sum[$index]['platform_money']}</td>
|
||||
<td>{$sum[$index]['aggregate_money']}</td>
|
||||
<td>{$sum[$index]['sum_amount']}</td>
|
||||
<td>{$sum[$index]['ratio']}</td>
|
||||
<td>{$sum[$index]['promote_ratio']}</td>
|
||||
<td>{$sum[$index]['fax_ratio']}</td>
|
||||
<td>{$sum[$index]['other_amount']}</td>
|
||||
<td>{$sum[$index]['sum_money']}</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
<if condition="$is_export">
|
||||
$(function(){
|
||||
$("#exporttable").table2excel({
|
||||
filename: "{$title}.xls", // do include extension
|
||||
preserveColors: false // set to true if you want background colors and font colors preserved
|
||||
});
|
||||
});
|
||||
</if>
|
||||
$(".no_statement").on("click",function(){
|
||||
var id = $(this).data('id');
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{:U('cancelStatement')}",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
data: {id:id},
|
||||
success:function(data){
|
||||
if(data.status==1){
|
||||
layer.msg("<font style='color:white'>" + data.info + "</font>");
|
||||
setTimeout(function(){
|
||||
window.location.reload();
|
||||
},1500);
|
||||
}else{
|
||||
layer.msg("<font style='color:white'>" + data.info + "</font>");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".refund").on("blur",function () {
|
||||
caculate_sum_money(this);
|
||||
});
|
||||
|
||||
$(".ratio").on("blur",function () {
|
||||
caculate_sum_money(this);
|
||||
});
|
||||
|
||||
$(".increment_ratio").on("blur",function () {
|
||||
caculate_sum_money(this);
|
||||
});
|
||||
|
||||
function caculate_sum_money(_this) {
|
||||
|
||||
var pay_money = $(_this).parent().parent().find(".pay_amount").text();
|
||||
|
||||
var ratio = $(_this).parent().parent().find(".ratio").val();
|
||||
|
||||
if (!ratio || ratio < 0) {
|
||||
ratio = 0;
|
||||
$(_this).parent().parent().find(".ratio").val(ratio);
|
||||
} else if (ratio > 100) {
|
||||
ratio = 100;
|
||||
$(_this).parent().parent().find(".ratio").val(ratio);
|
||||
}
|
||||
|
||||
var refund = $(_this).parent().parent().find(".refund").val();
|
||||
if (!refund || refund < 0) {
|
||||
refund = 0;
|
||||
$(_this).parent().parent().find(".refund").val(refund);
|
||||
}
|
||||
|
||||
var increment_ratio = $(_this).parent().parent().find(".increment_ratio").val();
|
||||
if (!increment_ratio || increment_ratio < 0) {
|
||||
increment_ratio = 0;
|
||||
$(_this).parent().parent().find(".increment_ratio").val(increment_ratio);
|
||||
} else if(increment_ratio > 100) {
|
||||
increment_ratio = 100;
|
||||
$(_this).parent().parent().find(".increment_ratio").val(increment_ratio);
|
||||
}
|
||||
|
||||
pay_money = parseFloat(pay_money) - parseFloat(refund);
|
||||
|
||||
var value = parseFloat(pay_money)*(parseFloat(ratio)/100) + parseFloat(pay_money)*(parseFloat(increment_ratio)/100);
|
||||
|
||||
$(_this).parent().parent().find(".sum_money_span").text(value.toFixed(2));
|
||||
$(_this).parent().parent().find(".sum_money").val(value.toFixed(2));
|
||||
|
||||
}
|
||||
</script>
|
||||
</html>
|
@ -0,0 +1,273 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
|
||||
<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 src="__STATIC__/juicer-min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<style>
|
||||
html {
|
||||
min-width:100%;
|
||||
}
|
||||
body {
|
||||
padding: 0px 0px 150px;
|
||||
width: 960px;
|
||||
margin: auto;
|
||||
}
|
||||
.tabcon1711 table{
|
||||
width: 480px;
|
||||
}
|
||||
table{
|
||||
|
||||
margin: auto;
|
||||
}
|
||||
.hidebox{
|
||||
display: none;
|
||||
}
|
||||
.r{
|
||||
width: 300px;
|
||||
}
|
||||
.l{
|
||||
width: 180px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.input-list, .i_list {
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
<body>
|
||||
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
|
||||
海南万盟天下科技有限公司
|
||||
</div> -->
|
||||
<div style="display: flex;margin: auto;">
|
||||
<if condition="$data['first_party_info']">
|
||||
<div class="tab-content tabcon1711" id="firstPartBaseInfo">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="l">甲方:</td>
|
||||
<td class="r">
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="first_partner_id" name="partner_id" class="select_gallery">
|
||||
<option value="{$data['first_party_info']['id']}" selected>{$data['first_part_company']}</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody id="first_part_bser_info_show">
|
||||
<tr>
|
||||
<td class="l">联系人:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="link_man" value="{$data['first_party_info']['link_man']}" disabled="disabled" placeholder="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">联系电话:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="link_phone" value="{$data['first_party_info']['link_phone']}" disabled="disabled" placeholder="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">邮寄地址:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="address" value="{$data['first_party_info']['address']}" disabled="disabled" placeholder="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">公司税号:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="company_tax_no" disabled="disabled" value="{$data['first_party_info']['company_tax_no']}" placeholder="">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</if>
|
||||
<if condition="$data['second_party_info']">
|
||||
<div class="tab-content tabcon1711" id="secondPartBaseInfo">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="l">乙方:</td>
|
||||
<td class="r">
|
||||
<div class="input-list input-list-game search_label_rehab">
|
||||
<select id="second_partner_id" name="partner_id" class="select_gallery">
|
||||
<option value="{$data['second_party_info']['id']}" selected>{$data['second_part_company']}</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody id="second_part_bser_info_show">
|
||||
<tr>
|
||||
<td class="l">联系人:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="link_man" value="{$data['second_party_info']['link_man']}" disabled="disabled" placeholder="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">联系电话:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="link_phone" value="{$data['second_party_info']['link_phone']}" disabled="disabled" placeholder="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">邮寄地址:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="address" value="{$data['second_party_info']['address']}" disabled="disabled" placeholder="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">公司税号:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="company_tax_no" value="{$data['second_party_info']['company_tax_no']}" disabled="disabled" placeholder="">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</if>
|
||||
</div>
|
||||
<if condition="$data['company']">
|
||||
<div style="padding: 30px 0px 10px;display: block;height:30px;">
|
||||
<div class="input-list input-list-server search_label_rehab">
|
||||
<p style="font-size: 20px;font-weight: 600;">支付给:<spen style="margin-left: 15px;font-size: 16px;">{$data.company}
|
||||
</spen>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</if>
|
||||
<div class="data_list box_mt" style="margin-top: 10px;">
|
||||
<div class="">
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="border-right: solid 1px #b6cad2;">结算时间</th>
|
||||
<th style="border-right: solid 1px #b6cad2;">合作产品</th>
|
||||
<th style="border-right: solid 1px #b6cad2;">渠道费率</th>
|
||||
<th style="border-right: solid 1px #b6cad2;">税费费率</th>
|
||||
<th>结算金额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="statementShow">
|
||||
<foreach name="data.statement_info" item="it" >
|
||||
<tr>
|
||||
<td>{$it.statement_begin_time}-{$it.statement_end_time}</td>
|
||||
<td>{$it.game_name}</td>
|
||||
<if condition="$key eq 0">
|
||||
<td rowspan="{$data['statement_count']['list_count']}">{$it.promote_ratio|showNumPercent}</td>
|
||||
<td rowspan="{$data['statement_count']['list_count']}">{$it.fax_ratio|showNumPercent}</td>
|
||||
<td rowspan="{$data['statement_count']['list_count']}">{$data['statement_count']['statement_money']}</td>
|
||||
</if>
|
||||
</tr>
|
||||
</foreach>
|
||||
<tr style="border-top: solid 1px #b6cad2;">
|
||||
<td colspan=4>本月分成总金额(人民币大写):</td>
|
||||
<td>{$data.statement_count.big_ratio_money}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<if condition="$data['payinfo']">
|
||||
<div id="partpatinfo" style="display: flex;margin: auto;">
|
||||
<div class="tab-content tabcon1711" id="skf_payinfo">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="l">收款方名称:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="" disabled="disabled" placeholder="" value="{$data.payinfo.payee_name}">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">银行账号:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="" value="{$data.payinfo.bank_account}" disabled="disabled" placeholder="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">开户行:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="password" value="{$data.payinfo.opening_bank}" disabled="disabled" placeholder="请先选择支付给谁">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-content tabcon1711" id="fkf_payinfo">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="l">付款方名称:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="" disabled="disabled" placeholder="" value="{$data.fkf_payinfo.payee_name}">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">银行账号:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="" value="{$data.fkf_payinfo.bank_account}" disabled="disabled" placeholder="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="l">开户行:</td>
|
||||
<td class="r">
|
||||
<input type="text" class="txt" name="password" value="{$data.fkf_payinfo.opening_bank}" disabled="disabled" placeholder="请先选择支付给谁">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</if>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,396 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
|
||||
<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 src="__STATIC__/juicer-min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<style>
|
||||
html {
|
||||
min-width:100%;
|
||||
}
|
||||
body {
|
||||
padding: 0px 0px 150px;
|
||||
width: 960px;
|
||||
margin: auto;
|
||||
}
|
||||
.tabcon1711 table{
|
||||
width: 480px;
|
||||
}
|
||||
table{
|
||||
|
||||
margin: auto;
|
||||
}
|
||||
.hidebox{
|
||||
display: none;
|
||||
}
|
||||
.r{
|
||||
width: 300px;
|
||||
}
|
||||
.l{
|
||||
width: 180px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.input-list, .i_list {
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
<body>
|
||||
<div style="height: 20px"></div>
|
||||
<div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
|
||||
<div class="tab-content tabcon1711" >
|
||||
<div class="input-list input-list-game search_label_rehab" style="margin-left: 375px;">
|
||||
《{$company_name}》结算单
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
|
||||
<div class="tab-content tabcon1711">
|
||||
<div class="input-list input-list-game search_label_rehab" style="margin-left: 375px;">
|
||||
<div style="margin-top: -20px;width: 100%;line-height: 20px;font-weight: 600;text-align: center;margin-bottom: 10px;margin-left: 30px;" class="time">({$statement_begin_time}-{$statement_end_time})</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="data_list box_mt" style="margin-top: 10px;">
|
||||
<div >
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>结算月份</th>
|
||||
<th>合作产品名称</th>
|
||||
<th>月累计用户充值流水</th>
|
||||
<th>月新增用户数</th>
|
||||
<th>税费费率</th>
|
||||
<th>结算金额(元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody >
|
||||
<tr>
|
||||
<td>{$list[0]['statement_begin_time']}-{$list[0]['statement_end_time']}</td>
|
||||
<td>{$list[0]['game_name']}</td>
|
||||
<td rowspan="{$row}" class="pay_amount">{$amount_data['pay_amount']}</td>
|
||||
<td rowspan="{$row}" class="user_newcount">{$amount_data['user_newcount']}</td>
|
||||
<td rowspan="{$row}" class="parent_fax_ratio">{$amount_data['fax_ratio']}%</td>
|
||||
<td rowspan="{$row}" class="sum_money">{$amount_data['sum_money']}</td>
|
||||
</tr>
|
||||
<foreach name="list" item="it" key="key">
|
||||
|
||||
<if condition="$key neq 0">
|
||||
<tr>
|
||||
<td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>
|
||||
<td>{$it['game_name']}</td>
|
||||
</tr>
|
||||
</if>
|
||||
|
||||
</foreach>
|
||||
<tr>
|
||||
<td>支付金额</td>
|
||||
<td colspan="5">{:convertAmountToCn($amount_data['sum_money'])}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td colspan="5">结算金额按每月双方实际核定结算指标为准</td>
|
||||
</tr>
|
||||
<if condition="$first_party_info['invoice_item']">
|
||||
<tr>
|
||||
<td>甲方</td>
|
||||
<td colspan="2">{$first_party_info['partner']}</td>
|
||||
<td>乙方</td>
|
||||
<td colspan="2">{$second_party_info['partner']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系人</td>
|
||||
<td colspan="2">{$first_party_info['link_man']}</td>
|
||||
<td>联系人</td>
|
||||
<td colspan="2">{$second_party_info['link_man']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td colspan="2">{$first_party_info['link_phone']}</td>
|
||||
<td>联系电话</td>
|
||||
<td colspan="2">{$second_party_info['phone']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开票内容</td>
|
||||
<td colspan="2">{$first_party_info['invoice_item']}</td>
|
||||
<td>邮寄地址</td>
|
||||
<td colspan="2">{$second_party_info['address']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>发票类型</td>
|
||||
<td colspan="2">{$first_party_info['invoice_type']}</td>
|
||||
<td>请汇入此账号</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>邮寄地址</td>
|
||||
<td colspan="2">{$first_party_info['address']}</td>
|
||||
<td>户名</td>
|
||||
<if condition="$second_party_info['is_payment'] eq 1">
|
||||
<td colspan="2">{$second_party_info['ali_user']}</td>
|
||||
<else/>
|
||||
<td colspan="2">{$second_party_info['bank_address']}</td>
|
||||
</if>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"></td>
|
||||
<td>账号</td>
|
||||
<if condition="$second_party_info['is_payment'] eq 1">
|
||||
<td colspan="2">{$second_party_info['ali_account']}</td>
|
||||
<else/>
|
||||
<td colspan="2">{$second_party_info['bank_card']}</td>
|
||||
</if>
|
||||
</tr>
|
||||
|
||||
<if condition="$second_party_info['is_payment'] neq 1">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"></td>
|
||||
<td>开户行</td>
|
||||
<td colspan="2">{$second_party_info['bank_name']}</td>
|
||||
</tr>
|
||||
</if>
|
||||
<else/>
|
||||
<tr>
|
||||
<td>甲方</td>
|
||||
<td colspan="2">{$first_party_info['partner']}</td>
|
||||
<td>乙方</td>
|
||||
<td colspan="2">{$second_party_info['partner']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系人</td>
|
||||
<td colspan="2">{$first_party_info['link_man']}</td>
|
||||
<td>联系人</td>
|
||||
<td colspan="2">{$second_party_info['link_man']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td colspan="2">{$first_party_info['link_phone']}</td>
|
||||
<td>联系电话</td>
|
||||
<td colspan="2">{$second_party_info['phone']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>邮寄地址</td>
|
||||
<td colspan="2">{$first_party_info['address']}</td>
|
||||
<td>开票内容</td>
|
||||
<td colspan="2">{$second_party_info['invoice_item']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>请汇入此账号</td>
|
||||
<td colspan="2"></td>
|
||||
<td>发票类型</td>
|
||||
<td colspan="2">{$second_party_info['invoice_type']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>户名</td>
|
||||
<if condition="$second_party_info['is_payment'] eq 1">
|
||||
<td colspan="2">{$first_party_info['ali_user']}</td>
|
||||
<else/>
|
||||
<td colspan="2">{$first_party_info['bank_address']}</td>
|
||||
</if>
|
||||
<td>邮寄地址</td>
|
||||
<td colspan="2">{$second_party_info['address']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>账号</td>
|
||||
<if condition="$second_party_info['is_payment'] eq 1">
|
||||
<td colspan="2">{$first_party_info['ali_account']}</td>
|
||||
<else/>
|
||||
<td colspan="2">{$first_party_info['bank_card']}</td>
|
||||
</if>
|
||||
<td></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<if condition="$second_party_info['is_payment'] neq 1">
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td colspan="2">{$first_party_info['bank_name']}</td>
|
||||
<td></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</if>
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
|
||||
$(".select_gallery").select2();
|
||||
|
||||
$(function () {
|
||||
|
||||
var sum_amount = parseFloat($(".sum_money").text());
|
||||
var row = 0;
|
||||
var amount_datas;
|
||||
var other_list;
|
||||
var list = '{$js_data}';
|
||||
var company_id;
|
||||
var other_id;
|
||||
|
||||
$(".submit_btn").click(function () {
|
||||
|
||||
var id = "{$_GET['id']}";
|
||||
|
||||
if (!company_id) {
|
||||
layer.msg("请选择汇总公司");
|
||||
return;
|
||||
}
|
||||
|
||||
var fax_ratio = $(".fax_ratio").val();
|
||||
layer.load(2);
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "{:U('saveCompanyData')}",
|
||||
data:{list:list,other_list:other_list,company_id:company_id,amount_data:amount_datas,fax_ratio:fax_ratio,id:id,other_id:other_id},
|
||||
success: function(data) {
|
||||
layer.msg(data.msg);
|
||||
if(data.status == 1) {
|
||||
setTimeout(function(){
|
||||
layer.close(2);
|
||||
window.parent.reload();
|
||||
},3000);
|
||||
}
|
||||
layer.closeAll("loading");
|
||||
},
|
||||
error:function(){
|
||||
layer.closeAll("loading");
|
||||
layer.alert("网络错误或超时");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("#promote_company").change(function () {
|
||||
var begin = $(".time").data("begin");
|
||||
var end = $(".time").data("end");
|
||||
|
||||
company_id = $(this).val();
|
||||
|
||||
if (company_id == "请选择下游公司") {
|
||||
company_id = '';
|
||||
}
|
||||
|
||||
var id = "{$_GET['id']}";
|
||||
var amount_data = '{$js_amount_data}';
|
||||
|
||||
$(".other_append").remove();
|
||||
$(".pay_amount").attr("rowspan",parseInt($(".pay_amount").attr('rowspan'))-row);
|
||||
$(".user_newcount").attr("rowspan",parseInt($(".user_newcount").attr('rowspan'))-row);
|
||||
$(".parent_fax_ratio").attr("rowspan",parseInt($(".parent_fax_ratio").attr('rowspan'))-row);
|
||||
$(".sum_money").attr("rowspan",parseInt($(".sum_money").attr('rowspan'))-row);
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "{:U('checkCompanyData')}",
|
||||
data:{begin_time:begin,end_time:end,company_id:company_id,statement_id:id,amount_data:amount_data},
|
||||
success: function(data) {
|
||||
if (data.status==1) {
|
||||
for (var key in data.list) {
|
||||
|
||||
var tr = "<tr class='other_append'>" +
|
||||
"<td>"+data.list[key]['statement_begin_time']+"-"+data.list[key]['statement_end_time']+"</td>" +
|
||||
"<td>"+data.list[key]['game_name']+"</td>" +
|
||||
"</tr>";
|
||||
|
||||
$("tbody").append(tr);
|
||||
|
||||
}
|
||||
|
||||
row = data.row;
|
||||
|
||||
$(".pay_amount").text(data.amount_data['pay_amount']);
|
||||
$(".user_newcount").text(data.amount_data['user_newcount']);
|
||||
// $(".fax_ratio").text(data.amount_data['pay_amount']);
|
||||
$(".sum_money").text(data.amount_data['sum_money']);
|
||||
|
||||
$(".pay_amount").attr("rowspan",parseInt($(".pay_amount").attr('rowspan'))+row);
|
||||
$(".user_newcount").attr("rowspan",parseInt($(".user_newcount").attr('rowspan'))+row);
|
||||
$(".parent_fax_ratio").attr("rowspan",parseInt($(".parent_fax_ratio").attr('rowspan'))+row);
|
||||
$(".sum_money").attr("rowspan",parseInt($(".sum_money").attr('rowspan'))+row);
|
||||
sum_amount = data.amount_data['sum_money'];
|
||||
amount_datas = JSON.stringify(data.amount_data);
|
||||
other_list = JSON.stringify(data.list);
|
||||
other_id = data.other_id;
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
layer.alert("网络错误或超时");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".fax_ratio").blur(function() {
|
||||
|
||||
var fax_ratio = parseFloat($(this).val());
|
||||
var pay_amount = parseFloat($(".pay_amount").text());
|
||||
var sum_money = 0;
|
||||
|
||||
var fax_amount = sum_amount * (fax_ratio/100);
|
||||
|
||||
sum_money = sum_amount-fax_amount;
|
||||
|
||||
$(".sum_money").text(sum_money.toFixed(2));
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</html>
|
@ -0,0 +1,396 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
|
||||
<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 src="__STATIC__/juicer-min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<style>
|
||||
html {
|
||||
min-width:100%;
|
||||
}
|
||||
body {
|
||||
padding: 0px 0px 150px;
|
||||
width: 960px;
|
||||
margin: auto;
|
||||
}
|
||||
.tabcon1711 table{
|
||||
width: 480px;
|
||||
}
|
||||
table{
|
||||
|
||||
margin: auto;
|
||||
}
|
||||
.hidebox{
|
||||
display: none;
|
||||
}
|
||||
.r{
|
||||
width: 300px;
|
||||
}
|
||||
.l{
|
||||
width: 180px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.input-list, .i_list {
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
<body>
|
||||
<div style="height: 20px"></div>
|
||||
<div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
|
||||
<div class="tab-content tabcon1711" >
|
||||
<div class="input-list input-list-game search_label_rehab" style="margin-left: 375px;">
|
||||
《{$company_name}》结算单
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
|
||||
<div class="tab-content tabcon1711">
|
||||
<div class="input-list input-list-game search_label_rehab" style="margin-left: 375px;">
|
||||
<div style="margin-top: -20px;width: 100%;line-height: 20px;font-weight: 600;text-align: center;margin-bottom: 10px;margin-left: 30px;" class="time">({$statement_begin_time}-{$statement_end_time})</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="data_list box_mt" style="margin-top: 10px;">
|
||||
<div >
|
||||
<table>
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>结算月份</th>
|
||||
<th>合作产品名称</th>
|
||||
<th>月累计用户充值流水</th>
|
||||
<th>月新增用户数</th>
|
||||
<th>税费费率</th>
|
||||
<th>结算金额(元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody >
|
||||
<tr>
|
||||
<td>{$list[0]['statement_begin_time']}-{$list[0]['statement_end_time']}</td>
|
||||
<td>{$list[0]['game_name']}</td>
|
||||
<td rowspan="{$row}" class="pay_amount">{$amount_data['pay_amount']}</td>
|
||||
<td rowspan="{$row}" class="user_newcount">{$amount_data['user_newcount']}</td>
|
||||
<td rowspan="{$row}" class="parent_fax_ratio">{$amount_data['fax_ratio']}%</td>
|
||||
<td rowspan="{$row}" class="sum_money">{$amount_data['sum_money']}</td>
|
||||
</tr>
|
||||
<foreach name="list" item="it" key="key">
|
||||
|
||||
<if condition="$key neq 0">
|
||||
<tr>
|
||||
<td>{$it['statement_begin_time']}-{$it['statement_end_time']}</td>
|
||||
<td>{$it['game_name']}</td>
|
||||
</tr>
|
||||
</if>
|
||||
|
||||
</foreach>
|
||||
<tr>
|
||||
<td>支付金额</td>
|
||||
<td colspan="5">{:convertAmountToCn($amount_data['sum_money'])}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>备注</td>
|
||||
<td colspan="5">结算金额按每月双方实际核定结算指标为准</td>
|
||||
</tr>
|
||||
<if condition="$first_party_info['invoice_item']">
|
||||
<tr>
|
||||
<td>甲方</td>
|
||||
<td colspan="2">{$first_party_info['partner']}</td>
|
||||
<td>乙方</td>
|
||||
<td colspan="2">{$second_party_info['partner']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系人</td>
|
||||
<td colspan="2">{$first_party_info['link_man']}</td>
|
||||
<td>联系人</td>
|
||||
<td colspan="2">{$second_party_info['link_man']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td colspan="2">{$first_party_info['link_phone']}</td>
|
||||
<td>联系电话</td>
|
||||
<td colspan="2">{$second_party_info['phone']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开票内容</td>
|
||||
<td colspan="2">{$first_party_info['invoice_item']}</td>
|
||||
<td>邮寄地址</td>
|
||||
<td colspan="2">{$second_party_info['address']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>发票类型</td>
|
||||
<td colspan="2">{$first_party_info['invoice_type']}</td>
|
||||
<td>请汇入此账号</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>邮寄地址</td>
|
||||
<td colspan="2">{$first_party_info['address']}</td>
|
||||
<td>户名</td>
|
||||
<if condition="$second_party_info['is_payment'] eq 1">
|
||||
<td colspan="2">{$second_party_info['ali_user']}</td>
|
||||
<else/>
|
||||
<td colspan="2">{$second_party_info['bank_address']}</td>
|
||||
</if>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"></td>
|
||||
<td>账号</td>
|
||||
<if condition="$second_party_info['is_payment'] eq 1">
|
||||
<td colspan="2">{$second_party_info['ali_account']}</td>
|
||||
<else/>
|
||||
<td colspan="2">{$second_party_info['bank_card']}</td>
|
||||
</if>
|
||||
</tr>
|
||||
|
||||
<if condition="$second_party_info['is_payment'] neq 1">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"></td>
|
||||
<td>开户行</td>
|
||||
<td colspan="2">{$second_party_info['bank_name']}</td>
|
||||
</tr>
|
||||
</if>
|
||||
<else/>
|
||||
<tr>
|
||||
<td>甲方</td>
|
||||
<td colspan="2">{$first_party_info['partner']}</td>
|
||||
<td>乙方</td>
|
||||
<td colspan="2">{$second_party_info['partner']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系人</td>
|
||||
<td colspan="2">{$first_party_info['link_man']}</td>
|
||||
<td>联系人</td>
|
||||
<td colspan="2">{$second_party_info['link_man']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>联系电话</td>
|
||||
<td colspan="2">{$first_party_info['link_phone']}</td>
|
||||
<td>联系电话</td>
|
||||
<td colspan="2">{$second_party_info['phone']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>邮寄地址</td>
|
||||
<td colspan="2">{$first_party_info['address']}</td>
|
||||
<td>开票内容</td>
|
||||
<td colspan="2">{$second_party_info['invoice_item']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>请汇入此账号</td>
|
||||
<td colspan="2"></td>
|
||||
<td>发票类型</td>
|
||||
<td colspan="2">{$second_party_info['invoice_type']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>户名</td>
|
||||
<if condition="$second_party_info['is_payment'] eq 1">
|
||||
<td colspan="2">{$first_party_info['ali_user']}</td>
|
||||
<else/>
|
||||
<td colspan="2">{$first_party_info['bank_address']}</td>
|
||||
</if>
|
||||
<td>邮寄地址</td>
|
||||
<td colspan="2">{$second_party_info['address']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>账号</td>
|
||||
<if condition="$second_party_info['is_payment'] eq 1">
|
||||
<td colspan="2">{$first_party_info['ali_account']}</td>
|
||||
<else/>
|
||||
<td colspan="2">{$first_party_info['bank_card']}</td>
|
||||
</if>
|
||||
<td></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<if condition="$second_party_info['is_payment'] neq 1">
|
||||
<tr>
|
||||
<td>开户行</td>
|
||||
<td colspan="2">{$first_party_info['bank_name']}</td>
|
||||
<td></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
</if>
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
|
||||
$(".select_gallery").select2();
|
||||
|
||||
$(function () {
|
||||
|
||||
var sum_amount = parseFloat($(".sum_money").text());
|
||||
var row = 0;
|
||||
var amount_datas;
|
||||
var other_list;
|
||||
var list = '{$js_data}';
|
||||
var company_id;
|
||||
var other_id;
|
||||
|
||||
$(".submit_btn").click(function () {
|
||||
|
||||
var id = "{$_GET['id']}";
|
||||
|
||||
if (!company_id) {
|
||||
layer.msg("请选择汇总公司");
|
||||
return;
|
||||
}
|
||||
|
||||
var fax_ratio = $(".fax_ratio").val();
|
||||
layer.load(2);
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "{:U('saveCompanyData')}",
|
||||
data:{list:list,other_list:other_list,company_id:company_id,amount_data:amount_datas,fax_ratio:fax_ratio,id:id,other_id:other_id},
|
||||
success: function(data) {
|
||||
layer.msg(data.msg);
|
||||
if(data.status == 1) {
|
||||
setTimeout(function(){
|
||||
layer.close(2);
|
||||
window.parent.reload();
|
||||
},3000);
|
||||
}
|
||||
layer.closeAll("loading");
|
||||
},
|
||||
error:function(){
|
||||
layer.closeAll("loading");
|
||||
layer.alert("网络错误或超时");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("#promote_company").change(function () {
|
||||
var begin = $(".time").data("begin");
|
||||
var end = $(".time").data("end");
|
||||
|
||||
company_id = $(this).val();
|
||||
|
||||
if (company_id == "请选择下游公司") {
|
||||
company_id = '';
|
||||
}
|
||||
|
||||
var id = "{$_GET['id']}";
|
||||
var amount_data = '{$js_amount_data}';
|
||||
|
||||
$(".other_append").remove();
|
||||
$(".pay_amount").attr("rowspan",parseInt($(".pay_amount").attr('rowspan'))-row);
|
||||
$(".user_newcount").attr("rowspan",parseInt($(".user_newcount").attr('rowspan'))-row);
|
||||
$(".parent_fax_ratio").attr("rowspan",parseInt($(".parent_fax_ratio").attr('rowspan'))-row);
|
||||
$(".sum_money").attr("rowspan",parseInt($(".sum_money").attr('rowspan'))-row);
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: "{:U('checkCompanyData')}",
|
||||
data:{begin_time:begin,end_time:end,company_id:company_id,statement_id:id,amount_data:amount_data},
|
||||
success: function(data) {
|
||||
if (data.status==1) {
|
||||
for (var key in data.list) {
|
||||
|
||||
var tr = "<tr class='other_append'>" +
|
||||
"<td>"+data.list[key]['statement_begin_time']+"-"+data.list[key]['statement_end_time']+"</td>" +
|
||||
"<td>"+data.list[key]['game_name']+"</td>" +
|
||||
"</tr>";
|
||||
|
||||
$("tbody").append(tr);
|
||||
|
||||
}
|
||||
|
||||
row = data.row;
|
||||
|
||||
$(".pay_amount").text(data.amount_data['pay_amount']);
|
||||
$(".user_newcount").text(data.amount_data['user_newcount']);
|
||||
// $(".fax_ratio").text(data.amount_data['pay_amount']);
|
||||
$(".sum_money").text(data.amount_data['sum_money']);
|
||||
|
||||
$(".pay_amount").attr("rowspan",parseInt($(".pay_amount").attr('rowspan'))+row);
|
||||
$(".user_newcount").attr("rowspan",parseInt($(".user_newcount").attr('rowspan'))+row);
|
||||
$(".parent_fax_ratio").attr("rowspan",parseInt($(".parent_fax_ratio").attr('rowspan'))+row);
|
||||
$(".sum_money").attr("rowspan",parseInt($(".sum_money").attr('rowspan'))+row);
|
||||
sum_amount = data.amount_data['sum_money'];
|
||||
amount_datas = JSON.stringify(data.amount_data);
|
||||
other_list = JSON.stringify(data.list);
|
||||
other_id = data.other_id;
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
layer.alert("网络错误或超时");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(".fax_ratio").blur(function() {
|
||||
|
||||
var fax_ratio = parseFloat($(this).val());
|
||||
var pay_amount = parseFloat($(".pay_amount").text());
|
||||
var sum_money = 0;
|
||||
|
||||
var fax_amount = sum_amount * (fax_ratio/100);
|
||||
|
||||
sum_money = sum_amount-fax_amount;
|
||||
|
||||
$(".sum_money").text(sum_money.toFixed(2));
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</html>
|
@ -0,0 +1,149 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
|
||||
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
|
||||
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
|
||||
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
|
||||
|
||||
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
|
||||
<script type="text/javascript" src="__JS__/select2.min.js"></script>
|
||||
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
|
||||
<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 src="__STATIC__/juicer-min.js" type="text/javascript"></script>
|
||||
<script src="__STATIC__/table2excel.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
html {
|
||||
min-width:100%;
|
||||
}
|
||||
body {
|
||||
padding: 0px 10px 150px 10px;
|
||||
/* width: 960px; */
|
||||
margin: auto;
|
||||
}
|
||||
/* .tabcon1711 table{
|
||||
width: 480px;
|
||||
} */
|
||||
table{
|
||||
|
||||
margin: auto;
|
||||
}
|
||||
tr{
|
||||
border-bottom: dotted 1px #c7c7c7;
|
||||
}
|
||||
.hidebox{
|
||||
display: none;
|
||||
}
|
||||
.r{
|
||||
width: 300px;
|
||||
}
|
||||
.l{
|
||||
width: 180px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.input-list, .i_list {
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
#statementShow td{
|
||||
line-height: 1.5;
|
||||
padding: 8px 0;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
|
||||
海南万盟天下科技有限公司
|
||||
</div> -->
|
||||
|
||||
<div class="data_list box_mt" style="margin-top: 10px;">
|
||||
<div class="">
|
||||
<table id="exporttable">
|
||||
<!-- 表头 -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>下游名称</th>
|
||||
<th>产品</th>
|
||||
<th>产品类型</th>
|
||||
<th>结算时间</th>
|
||||
<th>平台流水</th>
|
||||
<th>分成比例</th>
|
||||
<th>分成结算金额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="statementShow">
|
||||
<if condition = "empty($data)">
|
||||
<tr>
|
||||
<td colspan="50" class="text-center">aOh! 暂时还没有内容!</td>
|
||||
</tr>
|
||||
</if>
|
||||
<foreach name="data" item="com">
|
||||
<foreach name="com.statement_info" item="st" key="g">
|
||||
<tr>
|
||||
<if condition = "$g eq 0">
|
||||
<td rowspan="{$com.row}">{$key-0+1}</td>
|
||||
<td rowspan="{$com.row}">{$com.partner}</td>
|
||||
</if>
|
||||
<td>{$st.game_name}</td>
|
||||
<td>{$st.game_type_name}</td>
|
||||
<td>{$st.statement_begin_time}-{$st.statement_end_time}</td>
|
||||
<td>{$st.pay_amount}</td>
|
||||
<td>{$st.ratio}%</td>
|
||||
<td>{$st.sum_money}</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
</foreach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
<if condition="$is_export">
|
||||
$(function(){
|
||||
$("#exporttable").table2excel({
|
||||
filename: "{$title}.xls", // do include extension
|
||||
preserveColors: false // set to true if you want background colors and font colors preserved
|
||||
});
|
||||
});
|
||||
</if>
|
||||
</script>
|
||||
</html>
|
@ -0,0 +1,151 @@
|
||||
<?php
|
||||
namespace base\Factory;
|
||||
|
||||
class MarketPercentageFactory {
|
||||
|
||||
protected $coefficients = [];
|
||||
//实例化离职服务类
|
||||
public function __construct()
|
||||
{
|
||||
$this->coefficients = [];
|
||||
$coefficient_data = M("coefficient", "tab_")->where("1=1")->select();
|
||||
|
||||
foreach ($coefficient_data as $key => $value) {
|
||||
|
||||
$this->coefficients[$value['pay_time']][$value['admin_id']] = $value['coefficient'] / 100;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function returnMarketPercentageArray() {
|
||||
|
||||
$map['group_id'] = ['in', '11,12,21'];
|
||||
$marketPercentage = M("auth_group")->where($map)->getField("id,market_percentage");
|
||||
$all_data = SM("market_altogether", "tab_")
|
||||
->select();
|
||||
|
||||
$returnArr = [];
|
||||
|
||||
foreach ($all_data as $key => $value) {
|
||||
|
||||
$level = $value['level'];
|
||||
if (isset($marketPercentage[$level])) {
|
||||
$value['market_percentage'] = $marketPercentage[$level];
|
||||
}
|
||||
$market_percentage = json_decode($value['market_percentage'], true);
|
||||
$month = date("m", strtotime($value['pay_time']));
|
||||
$yes = date("Y", strtotime($value['pay_time']));
|
||||
|
||||
if ($market_percentage['time'] == 1) {
|
||||
|
||||
if ($month=="01" || $month=="02" || $month=="03") {
|
||||
$returnArr[$value['admin_id'].$yes."-04"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
} elseif ($month=="04" || $month=="05" || $month=="06") {
|
||||
$returnArr[$value['admin_id'].$yes."-07"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
} elseif($month=="10" || $month=="11" || $month=="12") {
|
||||
$returnArr[$value['admin_id'].($yes+1)."-01"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
} elseif($month=="07" || $month=="08" || $month=="09") {
|
||||
$returnArr[$value['admin_id'].($yes)."-10"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
}
|
||||
|
||||
} elseif($market_percentage['time'] == 2) {
|
||||
if ($month=="01" || $month=="02" || $month=="03"||$month=="04" || $month=="05" || $month=="06") {
|
||||
$returnArr[$value['admin_id'].$yes."-07"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
} elseif($month=="07" || $month=="08" || $month=="09"||$month=="10" || $month=="11" || $month=="12") {
|
||||
$returnArr[$value['admin_id'].($yes+1)."-01"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
}
|
||||
} elseif($market_percentage['time'] == 3) {
|
||||
$returnArr[$value['admin_id'].($yes+1)."-01"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
} else {
|
||||
$returnArr[$value['admin_id'].date("Y-m", strtotime("next month", strtotime($value['pay_time'])))]['performance_commission'] += $value['wait_performance_commission'];
|
||||
}
|
||||
|
||||
if ($market_percentage['remain_time'] == 1) {
|
||||
|
||||
if ($month=="01" || $month=="02" || $month=="03") {
|
||||
$returnArr[$value['admin_id'].$yes."-04"]['achievement_bonus'] += $value['wait_achievement_commission'] * ($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
} elseif ($month=="04" || $month=="05" || $month=="06") {
|
||||
$returnArr[$value['admin_id'].$yes."-07"]['achievement_bonus'] += $value['wait_achievement_commission'] * ($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
} elseif($month=="10" || $month=="11" || $month=="12") {
|
||||
$returnArr[$value['admin_id'].($yes+1)."-01"]['achievement_bonus'] += $value['wait_achievement_commission'] * ($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
} elseif($month=="07" || $month=="08" || $month=="09") {
|
||||
$returnArr[$value['admin_id'].($yes)."-10"]['achievement_bonus'] +=
|
||||
$value['wait_achievement_commission'] *
|
||||
($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
}
|
||||
|
||||
} elseif($market_percentage['remain_time'] == 2) {
|
||||
if ($month=="01" || $month=="02" || $month=="03"||$month=="04" || $month=="05" || $month=="06") {
|
||||
$returnArr[$value['admin_id'].$yes."-07"]['achievement_bonus'] += $value['wait_achievement_commission'] * ($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
} elseif($month=="07" || $month=="08" || $month=="09"||$month=="10" || $month=="11" || $month=="12") {
|
||||
$returnArr[$value['admin_id'].($yes+1)."-01"]['achievement_bonus'] += $value['wait_achievement_commission'] * ($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
}
|
||||
} elseif($market_percentage['remain_time'] == 3) {
|
||||
$returnArr[$value['admin_id'].($yes+1)."-01"]['achievement_bonus'] += $value['wait_achievement_commission'] * ($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
} else {
|
||||
$returnArr[$value['admin_id'].date("Y-m", strtotime("next month", strtotime($value['pay_time'])))]['achievement_bonus'] += $value['wait_achievement_commission'] * ($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $returnArr?$returnArr:[];
|
||||
|
||||
}
|
||||
|
||||
//返回待发放
|
||||
public function returnWaitMarketPercentageArray() {
|
||||
|
||||
$map['group_id'] = ['in', '11,12,21'];
|
||||
$marketPercentage = M("auth_group")->where($map)->getField("id,market_percentage");
|
||||
$all_data = SM("market_altogether", "tab_")
|
||||
->select();
|
||||
|
||||
$returnArr = [];
|
||||
|
||||
foreach ($all_data as $key => $value) {
|
||||
|
||||
$level = $value['level'];
|
||||
if (isset($marketPercentage[$level])) {
|
||||
$value['market_percentage'] = $marketPercentage[$level];
|
||||
}
|
||||
$market_percentage = json_decode($value['market_percentage'], true);
|
||||
$month = date("m", strtotime($value['pay_time']));
|
||||
$yes = date("Y", strtotime($value['pay_time']));
|
||||
|
||||
if ($market_percentage['time'] == 1) {
|
||||
|
||||
if ($month=="01" || $month=="02" || $month=="03") {
|
||||
$returnArr[$value['admin_id'].$yes."-04"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
} elseif ($month=="04" || $month=="05" || $month=="06") {
|
||||
$returnArr[$value['admin_id'].$yes."-07"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
} elseif($month=="10" || $month=="11" || $month=="12") {
|
||||
$returnArr[$value['admin_id'].($yes+1)."-01"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
} elseif($month=="07" || $month=="08" || $month=="09") {
|
||||
$returnArr[$value['admin_id'].$yes."-10"]['performance_commission'] += $value['wait_performance_commission'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($market_percentage['remain_time'] == 1) {
|
||||
|
||||
if ($month=="01" || $month=="02" || $month=="03") {
|
||||
$returnArr[$value['admin_id'].$yes."-04"]['achievement_bonus'] += $value['wait_achievement_commission'] * ($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
} elseif ($month=="04" || $month=="05" || $month=="06") {
|
||||
$returnArr[$value['admin_id'].$yes."-07"]['achievement_bonus'] += $value['wait_achievement_commission'] * ($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
} elseif($month=="10" || $month=="11" || $month=="12") {
|
||||
$returnArr[$value['admin_id'].($yes+1)."-01"]['achievement_bonus'] += $value['wait_achievement_commission'] * ($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
} elseif($month=="07" || $month=="08" || $month=="09") {
|
||||
$returnArr[$value['admin_id'].($yes)."-10"]['achievement_bonus'] +=
|
||||
$value['wait_achievement_commission'] *
|
||||
($this->coefficients[$value['pay_time']][$value['admin_id']] ? $this->coefficients[$value['pay_time']][$value['admin_id']] : 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $returnArr?$returnArr:[];
|
||||
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue