diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index d2f03c8d2..0c70a79d8 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -411,6 +411,44 @@ function set_pagination($count, $row,$request='') { } } +function set_pagination_all($count, $row,$request='') { + + $aside = ''; + }else{ + $aside .= ''; + } + $count=$count?$count:0; + $row=$row?$row:10; + if ($count > $row) { + $page = new \Think\Page($count, $row,$request); + $page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%'); + + $html = $page->show(); + + return str_replace('
','
' .$aside,$html); + } else { + return '
' .$aside. '共 '.$count.' 条记录
'; + } +} + + function get_source_from_game($id=0) { if (!is_numeric($id) || $id<1) {return '全部';} diff --git a/Application/Payment/Controller/ExcelPaymentController.class.php b/Application/Payment/Controller/ExcelPaymentController.class.php index 42461ce48..e90894118 100644 --- a/Application/Payment/Controller/ExcelPaymentController.class.php +++ b/Application/Payment/Controller/ExcelPaymentController.class.php @@ -72,7 +72,7 @@ class ExcelPaymentController extends BaseController $map['i.pay_status'] = $_REQUEST['pay_status']; } if(isset($_REQUEST['batch_num'])){ - $map['i.batch_num'] = $_REQUEST['batch_num']; + $map['i.batch_num'] = ["LIKE","%{$_REQUEST['batch_num']}%"]; } $CompanyInfo = M("excel_statement_info","tab_") @@ -89,26 +89,30 @@ class ExcelPaymentController extends BaseController $v['company_type'] = $this->CompanyType[$v['company_type']]; $v["pay_status_str"] = $this->PayStatus[$v['pay_status']]; - $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['create_time'] = date('Y-m-d H:i:s',$v['create_time']); + // $v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']); + // $v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']); if(empty($v['pay_time'])){ $v['pay_time'] = "--"; }else{ $v['pay_time'] = date('Y-m-d H:i:s',$v['pay_time']); } - $v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}"; + // $v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}"; } //统计待打款金额 - $countmap = $map; - $countmap['pay_status']=["neq",1]; - $money = M("excel_statement_info","tab_")->alias('i')->field("sum(statement_money) statement_money")->where($countmap)->find(); + $field = "IFNULL(SUM(CASE WHEN pay_status = 1 THEN statement_money ELSE 0 END),0) as success_money, + IFNULL(SUM(CASE WHEN pay_status = 0 THEN statement_money ELSE 0 END),0) as statement_money, + IFNULL(SUM(CASE WHEN pay_status = -1 THEN statement_money ELSE 0 END),0) as error_money"; + $money = M("excel_statement_info","tab_")->alias('i')->field( $field)->where($map)->find(); + $count = M("excel_statement_info","tab_")->alias('i')->field("count(id) count")->where($map)->find(); - $page = set_pagination($count['count'], $row); + $page = set_pagination_all($count['count'], $row); if ($page) { $this->assign('_page', $page); } - $this->meta_title = 'EXCEL打款'; + // echo($page);die(); + $this->meta_title = '线下打款'; $this->assign("data",$CompanyInfo); $this->assign("money",$money); $this->assign("CompanyType", $this->CompanyType); @@ -126,8 +130,8 @@ class ExcelPaymentController extends BaseController public function loopAdd() { $p = $_REQUEST; - $statement_begin_time = strtotime($p['statement_begin_time']); - $statement_end_time = strtotime($p['statement_end_time'])+86399; + // $statement_begin_time = strtotime($p['statement_begin_time']); + // $statement_end_time = strtotime($p['statement_end_time'])+86399; $batch = $p['batch']; $checkarr = $p['checkarr']; //循环获取添加 @@ -137,14 +141,21 @@ class ExcelPaymentController extends BaseController $ExcelStatementInfo = M('ExcelStatementInfo',"tab_"); foreach ($checkarr as $k => &$v) { $company_info = $v['company_info']; - $v['statement_begin_time'] = $statement_begin_time; - $v['statement_end_time'] = $statement_end_time; + // $v['statement_begin_time'] = $statement_begin_time; + // $v['statement_end_time'] = $statement_end_time; $v['batch_num'] = $batch; $v['statement_info'] = json_encode($v['statement_info'],JSON_UNESCAPED_UNICODE); $v['company_info'] = json_encode($v['company_info'],JSON_UNESCAPED_UNICODE); $v['company_type'] = 2; $v['create_time'] = time(); $v['statement_num'] = "JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5); + $dm = [ + "mobile"=>$this->admininfo['mobile'], + "real_name"=>$this->admininfo['real_name'], + "time"=>date("Y-m-d H:i:s") + ]; + $v['document_maker'] = json_encode($dm,JSON_UNESCAPED_UNICODE); + if(!isset($company_info['ali_user']) || !isset($company_info['ali_account']) || $company_info['ali_user'] == '' || $company_info['ali_account'] == ''){ M('ExcelStatementInfo',"tab_")->where("batch_num = '{$v['batch_num']}'")->delete(); $this->ajaxReturn(["status"=>0,"msg"=>"支付宝真实姓名及登陆账号不允许为空"]); @@ -207,12 +218,32 @@ class ExcelPaymentController extends BaseController foreach($infolist as $k=>&$v){ $v['statement_info'] = json_decode($v['statement_info'],true); $v['company_info'] = json_decode($v['company_info'],true); - $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['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']); + // $v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']); + $cline = $line+1; if($is_export){ $v['sum_money_exp'] = "="; + $hh = "\n"; + }else{ + $hh = "
"; + } + + $dm = json_decode($v['document_maker'],true); + $v['document_maker'] = $dm['mobile'].$hh."({$dm['real_name']})"; + if(!empty($v['payment_user'])){ + $pu = json_decode($v['payment_user'],true); + $v['payment_user'] = $pu['mobile'].$hh."({$pu['real_name']})"; + }else{ + $v['payment_user'] = "--"; + } + $v["pay_status_str"] = $this->PayStatus[$v['pay_status']]; + if(!empty($v['pay_time'])){ + $v['pay_time'] = date('Y-m-d H:i:s',$v['pay_time']); + }else{ + $v['pay_time'] = '--'; } + $row = 0; foreach($v['statement_info'] as $ke=>&$va){ $va['row'] = count($va['game_list']); @@ -312,10 +343,8 @@ class ExcelPaymentController extends BaseController //执行打款 $title = $remark; $amount = $dbres['statement_money']; - $amount = 0.1; $payres = $fund->transfer($company_info['ali_account'],$company_info['ali_user'],$dbres['statement_num'],$amount, $title); $resultCode = $payres->code; - $savedata = ["id"=>$dbres['id']]; if(!empty($resultCode)&&$resultCode == 10000){ @@ -329,6 +358,12 @@ class ExcelPaymentController extends BaseController $savedata["pay_info"] = json_encode($payres,JSON_UNESCAPED_UNICODE); $savedata["pay_time"]=time(); + $pu = [ + "mobile"=>$this->admininfo['mobile'], + "real_name"=>$this->admininfo['real_name'], + "time"=>date("Y-m-d H:i:s") + ]; + $savedata['payment_user'] = json_encode($pu,JSON_UNESCAPED_UNICODE); } M("ExcelStatementInfo","tab_")->save($savedata); $this->ajaxReturn(["success"=>"打款成功","data"=>[]]); diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php index 07bc8bf53..dc2f46ffa 100644 --- a/Application/Payment/Controller/PaymentController.class.php +++ b/Application/Payment/Controller/PaymentController.class.php @@ -356,7 +356,7 @@ class PaymentController extends BaseController public function transfer_set() { $this->getAccountMoney(); - $this->meta_title = '打款设置'; + $this->meta_title = '复核账号设置'; $this->assign("mobile",$this->admininfo['mobile']); $this->display(); } diff --git a/Application/Payment/Controller/PublicController.class.php b/Application/Payment/Controller/PublicController.class.php index 29d676b93..287f3da88 100644 --- a/Application/Payment/Controller/PublicController.class.php +++ b/Application/Payment/Controller/PublicController.class.php @@ -19,27 +19,26 @@ class PublicController extends \Think\Controller public function login($mobile = null, $verify = null) { if (IS_POST) { + $logininfo = ["mobile"=>$mobile]; //1.验证手机 - $this->check_moblie($mobile); + $this->check_moblie($logininfo); + /* 检测验证码 TODO: */ if (!$this->checksafecode($mobile, $verify)) { $this->error('验证码错误'); } /* 记录登录SESSION和COOKIES */ - $cp_auth = array( - 'mobile' => $mobile - ); $session_name = 'payment_user'; if (I('auto_login')) { $expireTime = 60*60*24*30;//自动登录一个月 ini_set('session.gc_maxlifetime', $expireTime); ini_set('session.cookie_lifetime', $expireTime); - session($session_name, $cp_auth); - session($session_name.'_sign', data_auth_sign($cp_auth)); + session($session_name, $logininfo); + session($session_name.'_sign', data_auth_sign($logininfo)); session($session_name.'_expire', time()); } else { - session($session_name, $cp_auth); - session($session_name.'_sign', data_auth_sign($cp_auth)); + session($session_name, $logininfo); + session($session_name.'_sign', data_auth_sign($logininfo)); } $this->success('登录成功!', U('Payment/lists')); @@ -131,9 +130,9 @@ class PublicController extends \Think\Controller public function checksafecode($phone, $code) { //测试验证码 - if($code == "txsb0601"){ - return true; - } + // if($code == "txsb0601"){ + // return true; + // } $taskClient = new TaskClient(); $result = $taskClient->checkSms($phone, $code); $data = []; @@ -143,14 +142,28 @@ class PublicController extends \Think\Controller return false; } } - public function check_moblie($mobile){ - $check_mobile = M("Kv")->field("value")->where("`key`='payment_check_mobile'")->find(); + public function check_moblie(&$logininfo){ + $mobile = $logininfo['mobile']; + + $check_mobile = M("Kv")->field("value")->where("`key`='payment_check_mobile' AND `value`= '{$mobile}'")->find(); if(empty($check_mobile)){ - $this->error('请先配置登陆验证手机'); - } - $check_mobile = $check_mobile['value']; - if($check_mobile !== $mobile){ - $this->error('该账号没有权限登录打款系统'); + //获取普通登陆 + $plogin = M("payment_member","tab_")->where("`mobile`= '{$mobile}'")->find(); + if(empty($plogin)){ + $this->error('无此登陆账号'); + }else{ + $logininfo["real_name"] = $plogin['real_name']; + $logininfo["is_payment"] = 0; + } + }else{ + + $rname = M("Kv")->field("value")->where("`key`='payment_check_name'")->find(); + if(empty( $rname)){ + $logininfo['real_name'] = "admin"; + }else{ + $logininfo['real_name'] = $rname['value']; + } + $logininfo['is_payment'] = 1; } } diff --git a/Application/Payment/View/ExcelPayment/add.html b/Application/Payment/View/ExcelPayment/add.html index b3f83ef70..bbda65fb3 100644 --- a/Application/Payment/View/ExcelPayment/add.html +++ b/Application/Payment/View/ExcelPayment/add.html @@ -36,22 +36,6 @@ 用于检索使用 - - *结算时间: - -
- -  -  -
- - -
-
- 用于检索及唯一值检验 - - *文件上传: @@ -230,8 +214,6 @@ "check_page":0, "filedata":[], "pay_way":-1, - "begin_time":0, - "end_time":0, "batch":batch } $("#batch").html(batch); @@ -241,26 +223,11 @@ $("#submit_btn").on("click", function () { - var start = $("#time_start").val(); - var end = $("#time_end").val(); - var sdate = Date.parse(start) / 1000; - var edate = Date.parse(end) / 1000; - if (start == '' || end == '') { - layer.msg('开始时间与结束时间都不允许为空'); - return false; - } - if (sdate > edate) { - layer.msg('开始时间必须小于等于结束时间'); - return false; - } - //获取文件 if (!isfile) { layer.msg('excel文件不能为空'); return false; } - sendDefaultData.begin_time = start; - sendDefaultData.end_time = end; //执行 readFileInput(function () { if(sendDefaultData.filedata_count == 0){ @@ -270,12 +237,10 @@ } //获取需要循环的次数 sendDefaultData.check_page = Math.ceil(sendDefaultData.filedata_count/check_size); - sendDefaultData.begin_time = start; - sendDefaultData.end_time = end; COMPARE.checkData(function(){ COMPARE.loopCheck(1,function(){ setTimeout(function(){ - window.location.href="{:U('lists',['row'=>100,'page'=>1,'batch_num'=>$batch])}"; + window.location.href="{:U('lists',['row'=>999999,'page'=>1,'batch_num'=>$batch])}"; },1500); }) }); diff --git a/Application/Payment/View/ExcelPayment/lists.html b/Application/Payment/View/ExcelPayment/lists.html index e15ece7a4..19f84250e 100644 --- a/Application/Payment/View/ExcelPayment/lists.html +++ b/Application/Payment/View/ExcelPayment/lists.html @@ -93,10 +93,14 @@ display: block; } + .page .sch-btn:before{ + content: ''; + padding: 0; + } @@ -110,18 +114,18 @@
-
+
合作公司 公司类型 - 结算时间 + 创建时间 批次号 结算金额 结算流水 @@ -193,7 +197,7 @@ {$data.company_name} {$data.company_type} - {$data.valid} + {$data.create_time} {$data.batch_num} @@ -216,7 +220,9 @@ - 合计待打款金额: {$money.statement_money} + 合计 + 打款成功金额: {$money.success_money}  /  待打款金额: {$money.statement_money}  /  打款成功金额: {$money.error_money} + @@ -270,6 +276,7 @@ content: url }); }); + $("#export").click(function () { var flag = false; @@ -374,7 +381,7 @@ $("#search").click(function(){ var start = $("#time_start").val(); - var end = $("#time_end").val(); + var end = $("#datetimepicker").val(); if(start !='' && end != ''){ if (Date.parse(start) > Date.parse(end)){ layer.msg('开始时间必须小于等于结束时间'); @@ -382,6 +389,15 @@ } } + var start2 = $("#time_start2").val(); + var end2 = $("#datetimepicker2").val(); + if(start2 !='' && end2 != ''){ + if (Date.parse(start2) > Date.parse(end2)){ + layer.msg("支付时间开始时间必须小于等于结束时间"); + return false; + } + } + var url = $(this).attr('url'); var query = $('.jssearch').find('input').serialize(); query += "&"+$('.jssearch').find('select').serialize(); diff --git a/Application/Payment/View/ExcelPayment/showPayment.html b/Application/Payment/View/ExcelPayment/showPayment.html index 24f3bcb7a..752a89314 100644 --- a/Application/Payment/View/ExcelPayment/showPayment.html +++ b/Application/Payment/View/ExcelPayment/showPayment.html @@ -121,7 +121,7 @@ {$vo.batch_num} {$vo.statement_money} {$vo.remark} - + diff --git a/Application/Payment/View/ExcelPayment/viewPuPool.html b/Application/Payment/View/ExcelPayment/viewPuPool.html index cec7b80eb..044807b9b 100644 --- a/Application/Payment/View/ExcelPayment/viewPuPool.html +++ b/Application/Payment/View/ExcelPayment/viewPuPool.html @@ -83,7 +83,10 @@ float: left; margin: 0; } - + #statementShow td{ + line-height: 1.5; + padding: 8px 0; + }
@@ -283,7 +288,7 @@ $(function(){ location.reload(); }, error:function(){ - updateAlert("服务器故障!",'tip_error'); + updateAlert('退出成功','tip_right'); setTimeout(function(){ $('#tip').find('.tipclose').click(); },1500); diff --git a/Data/update.sql b/Data/update.sql index b635d2f92..aa6d436fe 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -2092,11 +2092,12 @@ CREATE TABLE `tab_excel_statement_info` ( `statement_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '对账截止时间', `statement_num` varchar(500) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '结算单号', `statement_info` text NOT NULL COMMENT '订单相关信息json', - `pay_status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '打款状态 -1:打款失败 0:未打款 1:打款成功', `pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付完成时间', `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '生成时间', `pay_info` text COMMENT '打款信息', + `document_maker` varchar(255) DEFAULT '' COMMENT '制单信息', + `payment_user` varchar(255) DEFAULT '' COMMENT '打款基础信息', `remark` varchar(255) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '备注', PRIMARY KEY (`id`), KEY `batch_num` (`batch_num`) USING BTREE, @@ -2147,3 +2148,21 @@ CREATE TABLE `tab_market_altogether` ( ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_unicode_ci ROW_FORMAT = Dynamic; INSERT INTO `tab_tool`(`id`, `name`, `title`, `config`, `type`, `status`) VALUES (59, 'tax_radio', '公司税费', '{"tax_radio":1.5,"time":1589361782}', 1, 1) + + + + +--20200709 chenzhi +CREATE TABLE `tab_payment_member` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID', + `real_name` varchar(255) DEFAULT '' COMMENT '真实姓名', + `mobile` char(11) NOT NULL COMMENT '手机号码', + `last_login_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时间', + PRIMARY KEY (`id`), + KEY `mobile` (`mobile`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='打款登陆账号'; + + +INSERT INTO `tab_payment_member` (`id`, `real_name`, `mobile`, `last_login_time`) VALUES ('1', '胡歌', '18959188422', '0') + +