Merge branch 'feature/excel_payment' of wmtx/platform into release

优化打款
master
万盟天下 4 years ago committed by Gogs
commit 093d73e883

@ -411,6 +411,44 @@ function set_pagination($count, $row,$request='') {
}
}
function set_pagination_all($count, $row,$request='') {
$aside = '<script>function pagechange(that){url = location.href.replace(".html","").replace(/(&|\/)row(=|\/)\d*/gi,"").replace(/\/p\/\d*/gi,"");if(url.indexOf("?")>0){url += "&row="+that.value;}else{url += "?row="+that.value;} window.location.href = url;}</script><select id="pagechange" name="row" onchange="pagechange(this)">';
if($row == 10){
$aside .= '<option value="10" selected>每页10条</option>';
}else{
$aside .= '<option value="10">每页10条</option>';
}
if($row == 50){
$aside .= '<option value="50" selected>每页50条</option>';
}else{
$aside .= '<option value="50">每页50条</option>';
}
if($row == 100){
$aside .= '<option value="100" selected>每页100条</option>';
}else{
$aside .= '<option value="100">每页100条</option>';
}
if($row == 999999){
$aside .= '<option value="999999" selected>全部显示</option></select>';
}else{
$aside .= '<option value="999999">全部显示</option></select>';
}
$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('<div>','<div>' .$aside,$html);
} else {
return '<div>' .$aside. '<span class="rows">共 '.$count.' 条记录</span></div>';
}
}
function get_source_from_game($id=0) {
if (!is_numeric($id) || $id<1) {return '';}

@ -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 = "<br>";
}
$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"=>[]]);

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

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

@ -36,22 +36,6 @@
<span class="notice-text" style="margin-left: 20px;">用于检索使用</span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>结算时间:</td>
<td class="r">
<div class="input-list" style="margin-left: 0;">
<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>
<span class="notice-text" style="margin-left: 0;">用于检索及唯一值检验</span>
</td>
</tr>
<tr>
<td class="l"><i class="mustmark" style="margin-left:-7px">*</i>文件上传:</td>
<td class="r">
@ -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);
})
});

@ -93,10 +93,14 @@
display: block;
}
.page .sch-btn:before{
content: '';
padding: 0;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">EXCEL打款</h3>
<h3 class="page_title">线下打款</h3>
<p class="description_text">批次号指同一表格上传的打款单</p>
</div>
@ -110,18 +114,18 @@
<input type="text" name="company_name" placeholder="请输入公司名称模糊搜索" value="{:I('company_name')}" style="width: 180px;">
</div>
<div class="input-list">
<!-- <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" style="display:inline-block">
<input type="text" readonly id="datetimepicker" name="time_end" class="" value="{:I('time_end')}" placeholder="结算结束时间" />
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
</div> -->
<div class="input-list input-list-promote search_label_rehab">
<select id="pay_status" name="pay_status" class="select_gallery" >
<option value="">结算单类型</option>
<option value="">支付状态</option>
<volist name="PayStatus" id="vo">
<option value="{$key}" <if condition="isset($_GET['pay_status']) && $key eq I('pay_status')">selected</if> >{$vo}</option>
</volist>
@ -169,7 +173,7 @@
<th><input class="check-all" type="checkbox"></th>
<th>合作公司</th>
<th>公司类型</th>
<th>结算时间</th>
<th>创建时间</th>
<th>批次号</th>
<th>结算金额</th>
<th>结算流水</th>
@ -193,7 +197,7 @@
<td ><input class="ids" type="checkbox" value="{$data['id']}" data-pay="{$data['can_pay']}" data-paystatus="{$data.pay_status}" name="ids[]"></td>
<td>{$data.company_name}</td>
<td>{$data.company_type}</td>
<td>{$data.valid}</td>
<td>{$data.create_time}</td>
<td>{$data.batch_num}</td>
@ -216,7 +220,9 @@
</td>
</tr>
</volist>
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">待打款金额:&nbsp;{$money.statement_money}</td></tr>
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">
打款成功金额:&nbsp;{$money.success_money}&nbsp;&nbsp;/&nbsp;&nbsp;待打款金额:&nbsp;{$money.statement_money}&nbsp;&nbsp;/&nbsp;&nbsp;打款成功金额:&nbsp;{$money.error_money}
</td></tr>
</notemtpy>
</tbody>
</table>
@ -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("<font style='color:white'>支付时间开始时间必须小于等于结束时间</font>");
return false;
}
}
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();

@ -121,7 +121,7 @@
<td>{$vo.batch_num}</td>
<td>{$vo.statement_money}</td>
<td>{$vo.remark}</td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" data-pool="{$vo.pool_id}" name="remark" value="信息服务费" placeholder="打款备注"></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" data-pool="{$vo.pool_id}" name="remark" value="" placeholder="打款备注"></td>
</tr>
</foreach>

@ -83,7 +83,10 @@
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;">
@ -113,6 +116,10 @@
<th>结算金额</th>
<th>支付宝真实姓名</th>
<th>支付宝账号</th>
<th>制单人</th>
<th>复核人员</th>
<th>打款状态</th>
<th>打款时间</th>
<th>备注</th>
</tr>
</thead>
@ -158,6 +165,10 @@
<td rowspan="{$com.row}">{$com.company_info.ali_user}</td>
<td rowspan="{$com.row}">{$com.company_info.ali_account}</td>
<td rowspan="{$com.row}">{$com.document_maker}</td>
<td rowspan="{$com.row}">{$com.payment_user}</td>
<td rowspan="{$com.row}">{$com.pay_status_str}</td>
<td rowspan="{$com.row}">{$com.pay_time}</td>
<td rowspan="{$com.row}">{$com.remark}</td>
</tr>
@ -244,6 +255,10 @@
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>

@ -96,7 +96,7 @@
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">打款结算单</h3>
<h3 class="page_title">线上打款</h3>
<p class="description_text">信息不全指:支付宝账号或真实姓名未填写</p>
</div>

@ -16,7 +16,7 @@
<tbody>
<tr>
<td class="l noticeinfo">打款验证手机</td>
<td class="l noticeinfo">复核账</td>
<td class="r table_radio">
<input name="mobile" type="text" data-mobile="{$mobile}" value="{$mobile}" class="">
<span class="notice-text"></span>

@ -71,7 +71,7 @@
<li><a class="tuichujs" href="">退出</a></li>
</ul>
<div class="user">
<span>{:session('payment_user.mobile')}</span>
<span>{:session('payment_user.real_name')}</span>
</div>
</div>
</div>
@ -203,18 +203,23 @@ $(function(){
</div>
<div class="fgx">功能菜单</div> -->
<div id="subnav" class="subnav">
<h3 class=""><i class="icon icon-unfold"></i>万盟打款</h3>
<ul class="side-sub-menu">
<li>
<a class="item" href="{:U('Payment/transfer_set')}">打款设置</a>
</li>
<if condition="session('payment_user.is_payment') eq 1">
<h3 class='no'><i class="icon icon-unfold"></i>账号管理</h3>
<ul class="side-sub-menu" style="display: none;">
<li>
<a class="item" href="{:U('Payment/transfer_set')}">复核账号</a>
</li>
</ul>
</if>
<h3 class='no'><i class="icon icon-unfold"></i>打款方式</h3>
<ul class="side-sub-menu" style="display: none;">
<li>
<a class="item" href="{:U('Payment/lists')}">打款结算单</a>
<a class="item" href="{:U('Payment/lists')}">线上付款</a>
</li>
<li>
<a class="item" href="{:U('ExcelPayment/lists')}">EXCEL打款</a>
<a class="item" href="{:U('ExcelPayment/lists')}">线下付</a>
</li>
</ul>
</div>
</div>
@ -283,7 +288,7 @@ $(function(){
location.reload();
},
error:function(){
updateAlert("服务器故障!",'tip_error');
updateAlert('退出成功','tip_right');
setTimeout(function(){
$('#tip').find('.tipclose').click();
},1500);

@ -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')

Loading…
Cancel
Save