Merge pull request 'feature/finance_payment_20210115' (#174) from feature/finance_payment_20210115 into release

子站结算
master
陈志 4 years ago
commit 234ce8817d

@ -2001,6 +2001,83 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_
}
//子站上游cp对账单导出
function excelSubUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money) {
header("Content-type: text/html; charset=utf-8");
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
Vendor("PHPExcel.PHPExcel");
$objReader = \PHPExcel_IOFactory::createReader('Excel5');
//设置模板文件
$objPHPExcel = $objReader->load("Public/Admin/excel/sub_up_stream.xls");
//增加甲方信息
$objPHPExcel->getActiveSheet()->setCellValue('D2', $data['first_party_info']['partner']);
$objPHPExcel->getActiveSheet()->setCellValue('D3', $data['first_party_info']['link_man']);
$objPHPExcel->getActiveSheet()->setCellValue('D4', $data['first_party_info']['link_phone']."\t");
$objPHPExcel->getActiveSheet()->setCellValue('D5', $data['first_party_info']['address']);
$objPHPExcel->getActiveSheet()->setCellValue('D6', $data['first_party_info']['company_tax_no']);
//增加乙方信息
$objPHPExcel->getActiveSheet()->setCellValue('J2', $data['second_party_info']['partner']);
$objPHPExcel->getActiveSheet()->setCellValue('J3', $data['second_party_info']['link_man']);
$objPHPExcel->getActiveSheet()->setCellValue('J4', $data['second_party_info']['link_phone']."\t");
$objPHPExcel->getActiveSheet()->setCellValue('J5', $data['second_party_info']['address']);
$objPHPExcel->getActiveSheet()->setCellValue('J6', $data['second_party_info']['company_tax_no']." ");
$objPHPExcel->getActiveSheet()->setCellValue('C7', "支付给:".$data['receive_company']['partner']); //增加支付给对应公司
$line = 9;
//记录统计项目
$pay_amount_str = "=SUM(J9:";
$plat_amount_str = "=SUM(E9:";
$listCount = count($data['statement_info']);
$listLineMax = $line+$listCount-1;
$objPHPExcel->getActiveSheet()->insertNewRowBefore($line,$listCount)->mergeCells("F$line:G{$listLineMax}")->mergeCells("H$line:I{$listLineMax}")->mergeCells("J$line:K{$listLineMax}");
//增加结算记录
foreach ($data['statement_info'] as $key => $value) {
if($line == 9){
//初始行
$objPHPExcel->getActiveSheet()->setCellValue('F'.$line, $value['promote_ratio'] . '%')->setCellValue('H'.$line, $value['fax_ratio'] . '%')->setCellValue('J'.$line, $all_pay_amount);
}
$objPHPExcel->getActiveSheet()->mergeCells("D$line:E{$line}");
$objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['statement_begin_time'].'-'.$value['statement_end_time']);
if ($value['statement_type'] > 0) {
} else {
$product_name = $value['game_name'];
$objPHPExcel->getActiveSheet()->setCellValue('D'.$line, $product_name);
}
$line++;
}
$objPHPExcel->getActiveSheet()->setCellValue("J" . ($line), "=J9"); //本月分成总金额(人民币大写)
//收款方
$objPHPExcel->getActiveSheet()->setCellValue("D" . ($line+1), $data['receive_company']['payee_name']);
$objPHPExcel->getActiveSheet()->setCellValue("D" . ($line+2), $data['receive_company']['bank_account']."\t");
$objPHPExcel->getActiveSheet()->setCellValue("D" . ($line+3), $data['receive_company']['opening_bank']);
//付款方
$objPHPExcel->getActiveSheet()->setCellValue("J" . ($line+1), $data['pay_company']['payee_name']);
$objPHPExcel->getActiveSheet()->setCellValue("J" . ($line+2), $data['pay_company']['bank_account']."\t");
$objPHPExcel->getActiveSheet()->setCellValue("J" . ($line+3), $data['pay_company']['opening_bank']);
$statement_begin_time = date('Y.m.d', $data['statement_begin_time']);//对账开始时间
$statement_end_time = date('Y.m.d',$data['statement_end_time']);//对账截止时间
$fileName = "{$data['company_name']}&{$data['my_company']}-对账单{$statement_begin_time}-{$statement_end_time}";
ob_end_clean();//清除缓冲区,避免乱码
header('pragma:public');
header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $fileName .'".xls');
header("Content-Disposition:attachment;filename={$fileName}.xls");//attachment新窗口打印inline本窗口打印
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
}
//下游工会对账单导出
function excelSpecialComplementEmplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money) {

@ -117,10 +117,9 @@ return array(
/*分库的表格*/
'SUBSITE_TABLE'=>[
"sys_auth_group",
"sub_user_statement",
"tab_index_chart",
"tab_company_statement",
"tab_company_lack_statement_info",
"tab_company_statement_info",
"tab_company_statement_pool",
"tab_financial_summary",
"tab_pay_statement_info",

@ -48,7 +48,7 @@ class AdminController extends Controller {
if ( false === $access ) {
$this->error('403:禁止访问');
}elseif(null === $access ){
$access_controller = ['Ajax', 'Finance', 'FinancePromote', 'PayChannel','FinanceCompare',"AggregateFinanceStatement"];
$access_controller = ['Ajax', 'Finance', 'FinancePromote', 'PayChannel','FinanceCompare',"AggregateFinanceStatement","SubUserStatement"];
if(!in_array(CONTROLLER_NAME, $access_controller)){//ajax放行
//检测访问权限
$rule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME);

@ -286,14 +286,20 @@ class CompanyStatementController extends ThinkController
"first_party_info"=>$first_party_info,
"second_party_info"=>$second_party_info,
"statement_info"=>$statement_info,
"statement_count"=>array("pay_amount"=>$dbres['pay_amount'],"statement_money"=>$dbres['statement_money'],"big_ratio_money"=>convertAmountToCn($dbres['statement_money']))
"statement_count"=>array("pay_amount"=>$dbres['pay_amount'],"list_count"=>count($statement_info),"statement_money"=>$dbres['statement_money'],"big_ratio_money"=>convertAmountToCn($dbres['statement_money']))
);
$this->assign("data",$senddata);
// dd($senddata);
if($dbres["company_belong"] == 9){
//上游
$this->display("viewCpStatement");
if(!IS_SUBSITE){
$this->display("viewCpStatement");
}else{
$this->display("subViewCpStatement");
}
}else{
if ($dbres["withdraw_type"] == 3) {
if($dbres["company_type"] == 1){
@ -1061,7 +1067,12 @@ class CompanyStatementController extends ThinkController
}
if ($data['company_belong'] == 9) {//上游
excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money);
if(!IS_SUBSITE){
excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money);
}else{
excelSubUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_sum_money);
}
} else {
//下游
// if($dbres["company_type"] == 1){

@ -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);
}
}

@ -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");
}
}

@ -49,10 +49,12 @@ class CmdTasksModel extends Model{
}
}
//插入任务
public function addTask($type,$params,$need_path=true)
public function addTask($type,$params,$repeat=false,$need_path=true)
{
if(!$this->isCanAddTask($type)) return false;
if(!$repeat){
if(!$this->isCanAddTask($type)) return false;
}
if($need_path){
if(IS_WIN){
$p = explode(':',ROOTTTTT);

@ -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,264 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<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;}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">联运平台-个人汇总管理</h3>
<p class="description_text"></p>
</div>
<div class="cf top_nav_list" style="height: 38px;">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list" style="margin-bottom: 15px;">
<div class="input-list">
<input type="text" readonly id="time_start" name="time_start" class="" value="{:I('time_start')}" placeholder="结算开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" readonly id="time_end" name="time_end" class="" value="{:I('time_end')}" placeholder="结算结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('lists','model='.$model['name'] .'&row='.I('row'),false)}">搜索</a>
</div>
</div>
</div>
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class='butn' id='export'>导出</a>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th><input class="check-all" type="checkbox"></th>
<th>结算时间</th>
<th>结算金额</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<if condition = "empty($data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td ><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td>{$data.valid}</td>
<td>{$data.statement_money}</td>
<td>
<a class='confirm viewStatement' data-id='{$data.id}'>查看</a>
<a class='confirm updateStatement' data-id='{$data.id}'>重算</a>
</td>
</tr>
</volist>
</notemtpy>
</tbody>
</table>
</div>
</div>
<div class="page">
<if condition="$role_export_check eq true ">
<!-- <a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a> -->
</if>
{$_page|default=''}
</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 src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript">
</script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('lists')}");
function reload() {
window.location.reload();
}
$(function(){
$(".viewStatement").click(function () {
var id = $(this).data("id");
var url = "{:U('viewStatement')}"+"&id="+id
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['100%', '100%'],
content: url
});
});
$("#export").click(function () {
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get();
if(text.length > 20){
layer.msg("<font style='color:white'>" + '暂不支持超过20条的批量导出' + "</font>");
return;
}
if(text.length < 1){
layer.msg("<font style='color:white'>" + '请先选择要导出的结算单' + "</font>");
return;
}
_export();
function _export(){
for (var index = 0; index < text.length; index++) {
var id = text[index];
var url ="{:U('viewStatement')}"+"&id="+id+"&export=1";
var iframeExcel = "<iframe src='"+url+"' width='0px' height='0px' style='z-index:-1;position: absolute;top: -999999px;'></iframe>"//添加下载的地址到iframe这里是公司信息我用**表示了。
$("body").append(iframeExcel)
}
}
})
//撤销汇总
$(".updateStatement").on("click",function(){
var id = $(this).data('id');
var url = "{:U('updateStatement')}";
layer.confirm("重算需要等待系统重新生成数据,大概三分钟左右...",{title:false}, function(index){
layer.close(index);
updateStatement(url,{id:id});
});
})
function updateStatement(opurl,senddata){
//执行
layer.load(2);
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
async: true,
data: senddata,
success:function(data){
layer.closeAll('loading');
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;
}
}
});
}
$("#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;
}
window.location.href = url;
});
$('#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'
})
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
})
</script>
</block>

@ -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>
Loading…
Cancel
Save