5.26功能上线

master
zhengyongxing 4 years ago
parent e7c83a2811
commit 4f0bad5c45

@ -149,10 +149,37 @@ class CompanyStatementOfflineController extends ThinkController
$v['oplist'] = $this->OpAuth($v);
}
//pay_status
$field = "count(c.id) count,IFNULL(SUM(CASE WHEN pay_status = 1 THEN c.statement_money ELSE 0 END),0) as success_money,
IFNULL(SUM(CASE WHEN pay_status = 0 THEN c.statement_money ELSE 0 END),0) as statement_money,
$field = "count(c.id) count,IFNULL(SUM(CASE WHEN pay_status = 1 and pay_check=1 THEN c.statement_money ELSE 0 END),0) as success_money,
IFNULL(SUM(CASE WHEN pay_status = 0 or pay_status=2 THEN c.statement_money ELSE 0 END),0) as statement_money,
IFNULL(SUM(CASE WHEN pay_status = -1 THEN c.statement_money ELSE 0 END),0) as error_money";
$count = SM("company_statement_info","tab_")->alias("c")->field($field)->join("tab_company_statement_pool as p ON c.pool_id = p.id")->where($map)->find();
$count = SM("company_statement_info","tab_")
->alias("c")
->field($field)
->join("tab_company_statement_pool as p ON c.pool_id = p.id")
->where($map)
->find();
$countPart = SM("company_statement_info_part","tab_")->alias("c")
->field("IFNULL(SUM(CASE WHEN pay_status = 0 THEN c.statement_money ELSE 0 END),0) as statement_money,
IFNULL(SUM(CASE WHEN pay_status = -1 THEN c.statement_money ELSE 0 END),0) as error_money")
->join("tab_company_statement_pool as p ON c.pool_id = p.id")
->where($map)
->find();
$countSuccess = SM("company_statement_info_part","tab_")->alias("c")
->field("IFNULL(SUM(CASE WHEN c.pay_status = 0 THEN c.statement_money ELSE 0 END),0) as statement_money,
IFNULL(SUM(CASE WHEN c.pay_status = 1 THEN c.statement_money ELSE 0 END),0) as success_money")
->join("tab_company_statement_pool as p ON c.pool_id = p.id")
->join("left join tab_company_statement_info i on c.info_id=i.id")
->where($map)
->where(['i.pay_status'=>['neq',1]])
->find();
// dump($countPart);
// dump($countSuccess);die();
$count['success_money'] += $countSuccess['success_money'];
$count['statement_money'] -= $countSuccess['success_money'];
$count['error_money'] += $countPart['error_money'];
$params['p'] = $page;
$params['row'] = $row;
@ -554,18 +581,30 @@ class CompanyStatementOfflineController extends ThinkController
$handleData[$value['info_id']] = $value['statement_money'];
}
$payData = SM("company_statement_info_part","tab_")
->field("sum(statement_money) statement_money,info_id")
->group("info_id")
->select();
$handlePayData = [];
foreach ($payData as $key => $value) {
$handlePayData[$value['info_id']] = $value['statement_money'];
}
if ($unPayInfoId) {
$unPayData = $companyStatementInfo->where(['id'=>['in',$unPayInfoId]])->select();
foreach ($unPayData as $key => $value) {
$time = date("Y-m-d H:i:s",time());
$unPayAmount = $value['statement_money']-$handleData[$value['id']];
$saveData['remark'] = "{$value['remark']} {$_SESSION['onethink_admin']['user_auth']['username']}于{$time}已打款{$handleData[$value['id']]},剩余{$unPayAmount}";
$unPayAmount = $value['statement_money']-$handlePayData[$value['id']];
if($handleData[$value['id']]) {
$saveData['remark'] = "{$value['remark']} {$_SESSION['onethink_admin']['user_auth']['username']}于{$time}已打款{$handleData[$value['id']]},剩余{$unPayAmount}";
}
SM("company_statement_info_part","tab_")
->where(['info_id'=>$value['id']])
->save(["pay_status"=>1]);
if($value['statement_money'] - $handleData[$value['id']] <=0) {
if($value['statement_money'] - $handlePayData[$value['id']] <=0) {
//打款成功
$companyStatementInfo->where(['id'=>$value['id']])->save([
"pay_check"=>1,
@ -583,19 +622,47 @@ class CompanyStatementOfflineController extends ThinkController
$poolInfo = $companyStatementInfo->where("pool_id in ($poolIds) and pay_status <> 1")->field("pool_id,count(id) count")->group("pool_id")->select();
$handlePoolInfo = [];
foreach ($poolInfo as $key => $value) {
$handlePoolInfo[$value['pool_id']] = $value['count'];
}
// dump($yPoolInfo);
// dump($poolInfo);die();
//全部就打款成功,否则打款中
$companyStatementPool = SM("company_statement_pool","tab_");
foreach ($poolInfo as $k => $v) {
if($v['count'] == $yPoolInfo[$v['pool_id']]){
// dump($yPoolInfo);die();
foreach ($yPoolInfo as $k => $v) {
if (!$handlePoolInfo[$k]) {
//打款成功
$this->setOneVerifyStatus(4,"payment",$v['pool_id']);
}else{
$this->setOneVerifyStatus(4,"payment",$k);
} else {
//打款中
$this->setOneVerifyStatus(3,"payment",$v['pool_id']);
$this->setOneVerifyStatus(3,"payment",$k);
}
}
// if($v['count'] == $yPoolInfo[$v['pool_id']]){
// //打款成功
// $this->setOneVerifyStatus(4,"payment",$v['pool_id']);
// }else{
// //打款中
// $this->setOneVerifyStatus(3,"payment",$v['pool_id']);
// }
}
// foreach ($poolInfo as $k => $v) {
// if($v['count'] == $yPoolInfo[$v['pool_id']]){
// //打款成功
// $this->setOneVerifyStatus(4,"payment",$v['pool_id']);
// }else{
// //打款中
// $this->setOneVerifyStatus(3,"payment",$v['pool_id']);
// }
// }
$this->ajaxReturn(array(
'status' =>1,
@ -604,28 +671,75 @@ class CompanyStatementOfflineController extends ThinkController
}
public function viewStatement()
{
if(!isset($_REQUEST['id'])){
$this->error('参数错误');
}
// if(!isset($_REQUEST['id'])){
// $this->error('参数错误');
// }
// $id = $_REQUEST['id'];
// $is_export= false;
// if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
// $is_export = true;
// }
// //获取基本信息
// $dbres = SM("company_statement_info","tab_")->where("id='{$id}'")->select();
// $title = $dbres[0]['company_name'];
// $this->assign("title",$title);
//
// if($dbres[0]['company_type'] == 3){
// //上游
// A("CompanyStatementPool")->viewCpPool($dbres,$is_export);
// }elseif($dbres[0]['company_type'] == 1){
// //下游公司
// A("CompanyStatementPool")->viewPcPool($dbres,$is_export);
// }else{
// A("CompanyStatementPool")->viewPuPool($dbres,$is_export,["withdraw_type"=>3]);
// }
if(!isset($_REQUEST['id'])) $this->error("参数错误");
$id = $_REQUEST['id'];
$is_export= false;
if (isset($_REQUEST['export']) && $_REQUEST['export']==1){
$is_export = true;
$CompanyInfo = M("company_statement_info","tab_")
->alias('i')
->field("i.id,i.pool_id,i.company_name,i.company_info,i.statement_money,i.remark,i.pay_status,i.verify_status,p.statement_num,i.statement_money,i.pay_check")
->join("tab_company_statement_pool p ON p.id = i.pool_id")
->where("i.id in({$id}) and (pay_check=1 or pay_check=2)")
->select();
// $temp = $this->addPaymentPartInfo($CompanyInfo);
// $temp?$CompanyInfo=$temp:"";
if ($CompanyInfo[0]['id']) {
$CompanyInfoSecord = M("company_statement_info_part","tab_")
->alias('i')
->field("i.id,i.pool_id,i.company_name,i.company_info,i.statement_money,i.remark,i.pay_status,i.verify_status,p.statement_num,i.statement_money,i.pay_check")
->join("tab_company_statement_pool p ON p.id = i.pool_id")
->where("i.info_id ={$CompanyInfo[0]['id']}")
->select();
}
if($CompanyInfoSecord) {
$CompanyInfo = $CompanyInfoSecord;
}
//获取基本信息
$dbres = SM("company_statement_info","tab_")->where("id='{$id}'")->select();
$title = $dbres[0]['company_name'];
$this->assign("title",$title);
if($dbres[0]['company_type'] == 3){
//上游
A("CompanyStatementPool")->viewCpPool($dbres,$is_export);
}elseif($dbres[0]['company_type'] == 1){
//下游公司
A("CompanyStatementPool")->viewPcPool($dbres,$is_export);
}else{
A("CompanyStatementPool")->viewPuPool($dbres,$is_export,["withdraw_type"=>3]);
$all_money = 0;
foreach($CompanyInfo as $k=>&$v){
if($v['verify_status'] == 2){
$v['is_payment'] = 2;
}else{
$v['is_payment'] = 1;
}
$v['company_info'] = json_decode($v['company_info'],true);
$v['company_info']['ali_user'] ?? '';
$v['company_info']['ali_account'] ?? '';
$all_money += $v['statement_money'];
}
$this->assign('all_money',$all_money);
$this->assign("CompanyInfo",$CompanyInfo);
$this->assign("id",$id);
$this->display();
}
public function export($ids=''){

@ -1719,10 +1719,13 @@ class CompanyStatementPoolController extends ThinkController
$id = $_REQUEST['id'];
$CompanyInfo = SM("company_statement_info","tab_")
->alias('i')
->field("i.id,i.pool_id,i.company_name,i.company_info,i.statement_money,p.statement_num,i.remark,i.pay_status,i.verify_status,p.statement_money all_money")
->field("i.id,i.pool_id,i.company_name,i.company_info,i.statement_money,p.statement_num,i.remark,i.pay_status,i.verify_status,p.statement_money all_money,i.pay_status")
->join("tab_company_statement_pool p ON p.id = i.pool_id")
->where("pool_id='{$id}'")
->select();
$allPay = true;
foreach($CompanyInfo as $k=>&$v){
$v['company_info'] = json_decode($v['company_info'],true);
$v['company_info']['ali_user'] ?? '';
@ -1733,6 +1736,10 @@ class CompanyStatementPoolController extends ThinkController
}else{
$v['is_payment'] = 1;
}
//有一单未成功,就没有打款成功
if ($v['pay_status']!=1) {
$allPay = false;
}
$v['verify_status_str'] = $this->PayStatus[$v['pay_status']];
@ -1743,6 +1750,10 @@ class CompanyStatementPoolController extends ThinkController
}
}
}
//修改总单状态
if ($allPay) {
M("company_statement_pool","tab_")->where(['id'=>$id])->save(['verify_status'=>4]);
}
$this->assign("CompanyInfo",$CompanyInfo);
$this->display();
@ -2373,6 +2384,18 @@ class CompanyStatementPoolController extends ThinkController
}
//die();
$dbres = $this->DBModel->field("id,verify_status,verify_log")->where(['id'=>$id])->find();
$dbres['verify_log'] = json_decode($dbres['verify_log'],true);
// dump($dbres);die();
if ($dbres['verify_log']['firstverify_user']) {
// $dbres['verify_log'] = json_decode($dbres['verify_log'],true);
$dbres['verify_log']['firstverify_user']=$this->admininfo["username"];
$dbres['verify_log']['firstverify_time']=date("Y.m.d H:i:s");
$dbres['verify_log'] = json_encode($dbres['verify_log']);
SM("company_statement_pool","tab_")->where(['id'=>$id])->save(["verify_log"=>$dbres['verify_log']]);
}
SM("company_statement_pool","tab_")->where(['id'=>$id])->save(['pay_amount'=>$statement_amount,'statement_money'=>$statement_amount+$reward-$fine,'lack_statement_money'=>$statement_lack_amount+$lreward-$lfine]);
$this->ajaxReturn(['status'=>1,'info'=>'保存成功']);
@ -2497,6 +2520,17 @@ class CompanyStatementPoolController extends ThinkController
}
//die();
$dbres = $this->DBModel->field("id,verify_status,verify_log")->where(['id'=>$id])->find();
$dbres['verify_log'] = json_decode($dbres['verify_log'],true);
// dump($dbres);die();
if ($dbres['verify_log']['firstverify_user']) {
// $dbres['verify_log'] = json_decode($dbres['verify_log'],true);
$dbres['verify_log']['firstverify_user']=$this->admininfo["username"];
$dbres['verify_log']['firstverify_time']=date("Y.m.d H:i:s");
$dbres['verify_log'] = json_encode($dbres['verify_log']);
SM("company_statement_pool","tab_")->where(['id'=>$id])->save(["verify_log"=>$dbres['verify_log']]);
}
SM("company_statement_pool","tab_")->where(['id'=>$id])->save(['pay_amount'=>$statement_amount,'statement_money'=>$statement_amount+$reward-$fine,'lack_statement_money'=>$statement_lack_amount+$lreward-$lfine]);
$this->ajaxReturn(['status'=>1,'info'=>'保存成功']);

@ -9,38 +9,104 @@ use User\Api\UserApi as UserApi;
*/
class RefundController extends ThinkController {
public function userCount(){
if(!array_key_exists("count_date",$_REQUEST) && !array_key_exists("user_account",$_REQUEST)){
$this->redirect(ACTION_NAME, array('count_date' => date('Y-m')));
}
// if(!array_key_exists("count_date",$_REQUEST) && !array_key_exists("user_account",$_REQUEST)){
// $this->redirect(ACTION_NAME, array('count_date' => date('Y-m')));
// }
$page = I('p', 1);
$row = I('row', 10);
if(isset($_REQUEST['user_account'])){
$map['user_account']=array('like','%'.trim($_REQUEST['user_account']).'%');
$map['tab_spend_refund.user_account']=array('like','%'.trim($_REQUEST['user_account']).'%');
}
if(isset($_REQUEST['count_date'])){
$map['pay_time'] = ["BETWEEN",$this->getMonthTimeRange($_REQUEST['count_date'])];
if(isset($_REQUEST['partner'])){
$map['partner']=array('like','%'.trim($_REQUEST['partner']).'%');
}
if(isset($_REQUEST['company_name'])){
$map['company_name']=array('like','%'.trim($_REQUEST['company_name']).'%');
}
if(isset($_REQUEST['status'])){
$map['tab_spend_refund.status']= $_REQUEST['status'];
}
// if(isset($_REQUEST['count_date'])){
// $map['pay_time'] = ["BETWEEN",$this->getMonthTimeRange($_REQUEST['count_date'])];
// }
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$time_start = strtotime($_REQUEST['time_start']);
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
$map["_string"] = "(tab_spend_refund.pay_time BETWEEN {$time_start} AND {$time_end})";
} elseif (isset($_REQUEST['time_start'])) {
$time_start = strtotime($_REQUEST['time_start']);
$map["_string"] = "(tab_spend_refund.pay_time >= {$time_start} )";
} elseif (isset($_REQUEST['time_end'])) {
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
$map["_string"] = "(tab_spend_refund.pay_time <= {$time_end} )";
}
if (isset($_REQUEST['usetime_start']) && isset($_REQUEST['usetime_end'])) {
$time_start = strtotime($_REQUEST['usetime_start']);
$time_end = strtotime($_REQUEST['usetime_end'])+ 86399;
$map["_string"] = "( (check_time BETWEEN {$time_start} AND {$time_end}))";
} elseif (isset($_REQUEST['usetime_start'])) {
$time_start = strtotime($_REQUEST['usetime_start']);
$map["_string"] = "( (check_time >= {$time_start} ) )";
} elseif (isset($_REQUEST['usetime_end'])) {
$time_end = strtotime($_REQUEST['usetime_end'])+ 86399;
$map["_string"] = "( (check_time <= {$time_end} ) )";
}
// dump($map);die();
$gameSql = M("game","tab_")
->field("tab_game.id game_id,partner")
->join("left join tab_partner on tab_game.partner_id=tab_partner.id")
->where("1=1")
->select(false);
//
$model = SM("spend_refund",'tab_');
$data = $model
->where($map)
->group("month,user_id")
->order("month desc,refund_amount desc");
->field("tab_spend_refund.id,IFNULL(if(substring_index(substring_index(`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(`chain`,'/',2),'/',-1)),0) p_id,
s.`pay_time` pay_time,tab_spend_refund.user_id,tab_spend_refund.user_account,refund_amount,partner,game_name,company_name,promote.account,tab_spend_refund.status,admin,check_time")
->join("left join tab_spend s on tab_spend_refund.s_id=s.id")
->join("left join ({$gameSql}) g on s.game_id=g.game_id")
->join("tab_promote promote ON s.promote_id = promote.id","left")
->join("tab_promote_company company ON promote.company_id = company.id","left")
->where($map)
->select(false);
$data = M()->table("(".$data.") a")
->join("left join tab_promote pr on a.p_id = pr.id")
->group("a.id")
->order("month desc,refund_amount desc");
if(isset($_REQUEST['export'])){
$data = $data->field("CONCAT(' ',FROM_UNIXTIME(`pay_time`,'%Y-%m')) as month,user_id,user_account,sum(refund_amount) refund_amount")->select();
$data = $data->field("a.id,CONCAT(' ',FROM_UNIXTIME(`pay_time`,'%Y-%m')) as month,user_id,user_account,sum(refund_amount) refund_amount,partner,game_name,company_name,pr.account top_account,a.status,admin,check_time")->select();
data2csv($data,'退款统计',array(
"month"=>"月份",
"user_account"=>"玩家账号",
"refund_amount"=>"退款金额"
));
}
$data = $data->field("FROM_UNIXTIME(`pay_time`,'%Y-%m') as month,user_id,user_account,sum(refund_amount) refund_amount")->page($page, $row)->select();
$data = $data->field("a.id,FROM_UNIXTIME(`pay_time`,'%Y-%m') as month,user_id,user_account,sum(refund_amount) refund_amount,partner,game_name,company_name,pr.account top_account,a.status,admin,check_time")->page($page, $row)->select();
// var_dump($data);die();
foreach ($data as $k => &$v) {
$status = $v['status']?'已退款':"未退款";
$time = date("Y-m-d H:i:s");
if ($v['status']) {
$v['check_detail'] = "{$status}({$v['admin']}){$time}";
} else {
$v['check_detail'] = "-----";
}
$between = $this->getMonthTimeRange($v['month'],true);
$v['jump_url'] = U("Spend/lists",['timestart'=>$between[0],'timeend'=>$between[1],'user_account'=>$v['user_account'],'is_refund'=>1]);
}
// dump($data);die();
$allcount = $model->where($map)->getField("sum(refund_amount) refund_amount");
$count_sql = $model->field("FROM_UNIXTIME(`pay_time`,'%Y-%m') as month,user_id")->group("month,user_id")->where($map)->select(false);
@ -50,6 +116,14 @@ class RefundController extends ThinkController {
if ($page) {
$this->assign('_page', $page);
}
// dump($_SESSION['onethink_admin']['user_auth']['username']);die();
$Rule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME . "_check");
if ($this->checkRule($Rule, array('in', '1,2')) || IS_ROOT) {
$this->assign("check",true);
}
$this->assign("allcount",$allcount);
$this->assign("data",$data);
$this->assign("date_count",showMonthRange('2019-09-01',date('Y-m-d',time())));
@ -67,6 +141,26 @@ class RefundController extends ThinkController {
return [$start,$end];
}
public function refund() {
$status = $_REQUEST['status'];
$id = $_REQUEST['ids'];
// dump($_REQUEST);die();
if (!$id) {
$this->ajaxReturn(['status'=>0,'msg'=>'数据错误']);
}
$is_save = M("spend_refund","tab_")
->where(['id'=>['in',$id]])
->save(['status'=>$status,'check_time'=>time(),'admin'=>$_SESSION['onethink_admin']['user_auth']['username']]);
if ($is_save) {
$this->ajaxReturn(['status'=>1,'msg'=>'操作成功']);
} else {
$this->ajaxReturn(['status'=>0,'msg'=>'操作失败']);
}
}
// public function lists(){
// if(isset($_REQUEST['user_account'])){

@ -199,7 +199,7 @@
<td>{$data.platform_amount}</td>
<td>{$data.pay_check_str}</td>
<td>{$data.payment}</td>
<td>{$data.statement_num}</td>
<td><a class="viewPool" data-id="{$data['pool_id']}" >{$data.statement_num}</a></td>
<td>
<foreach name="data.oplist" item="vo" >
{$vo}
@ -251,6 +251,18 @@
}
$(function(){
$(".viewPool").click(function () {
var id = $(this).data("id");
var url = "{:U('CompanyStatementPool/viewPool')}"+"&id="+id
layer.open({
type: 2,
title: "海南万盟天下科技有限公司",
shadeClose: true,
shade: 0.8,
area: ['100%', '100%'],
content: url
});
});
var company_id = "{$_GET['company_id']??0}";
$("#company_type").on("change",function(){

@ -120,7 +120,7 @@
<tbody id="statementShow">
<foreach name="CompanyInfo" item="vo" >
<if condition="$vo['pay_status'] neq 1">
<tr>
<tr style="display: none">
<td>{$key-0+1}</td>
<td>{$vo.company_name}</td>
<if condition="$vo['is_payment'] eq 1">
@ -138,6 +138,43 @@
<td>{$vo.statement_num}</td>
<td>{$vo.statement_money}</td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="remark" value="{$vo.remark}" placeholder="备注"></td>
</tr>
<tr>
<td>{$key-0+1}</td>
<!-- <td>{$vo.company_name}</td>-->
<!-- <if condition="$vo['is_payment'] eq 1">-->
<!-- <td>是</td>-->
<!-- <td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_user" value="{$vo.company_info.ali_user}" placeholder="支付宝真实名称"></td>-->
<!-- <td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_account" value="{$vo.company_info.ali_account}" placeholder="支付宝账号"></td>-->
<!-- <td></td>-->
<!-- <else />-->
<!-- <td>否</td>-->
<!-- <td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="payee_name" value="{$vo.company_info.payee_name}" placeholder="银行帐户名"></td>-->
<!-- <td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="bank_account" value="{$vo.company_info.bank_account}" placeholder="银行帐号"></td>-->
<!-- <td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="opening_bank" value="{$vo.company_info.opening_bank}" placeholder="开户行"></td>-->
<!-- </if>-->
<!-- <td>{$vo.statement_num}</td>-->
<!-- <td>{$vo.statement_money}</td>-->
<!-- <td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="remark" value="{$vo.remark}" placeholder="备注"></td>-->
<td>{$vo.company_name}</td>
<if condition="$vo['is_payment'] eq 1">
<td></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_user" value="{$vo.company_info.ali_user}" placeholder="支付宝真实名称"></td>
<td><input type="text" class="txt paymentset" data-id="{$vo.id}" name="ali_account" value="{$vo.company_info.ali_account}" placeholder="支付宝账号"></td>
<td></td>
<else />
<td></td>
<td><input data-index_num="2" type="text" class="txt paymentset" data-id="{$vo.id}" name="payee_name" value="{$vo.company_info.payee_name}" placeholder="银行帐户名"></td>
<td><input data-index_num="2" type="text" class="txt paymentset" data-id="{$vo.id}" name="bank_account" value="{$vo.company_info.bank_account}" placeholder="银行帐号"></td>
<td><input data-index_num="2" type="text" class="txt paymentset" data-id="{$vo.id}" name="opening_bank" value="{$vo.company_info.opening_bank}" placeholder="开户行"></td>
</if>
<td>{$vo.statement_num}</td>
<td><input data-index_num="2" value="0" style="width: 80px;" type="number" onblur="if(value<0) value=0" data-id="{$vo.id}" name="unpay_amount" class="unpay_amount"></td>
<td><input data-index_num="2" type="text" class="txt paymentset unPayRemark" data-id="{$vo.id}" name="remark" value="" placeholder="备注"></td>
<td><a class="add_one" href="#">新增</a></td>
</tr>
<else />

@ -0,0 +1,223 @@
<!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 10px 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 class="data_list box_mt" style="margin-top: 20px;">
<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 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 style="border-right: solid 1px #b6cad2;">备注</th>
</tr>
</thead>
<tbody id="statementShow">
<foreach name="CompanyInfo" item="vo" >
<tr>
<td>{$key-0+1}</td>
<td>{$vo.company_name}</td>
<if condition="$vo['is_payment'] eq 1">
<td></td>
<td>{$vo.company_info.ali_user}</td>
<td>{$vo.company_info.ali_account}</td>
<td></td>
<else />
<td></td>
<td>{$vo.company_info.payee_name}</td>
<td>{$vo.company_info.bank_account}</td>
<td>{$vo.company_info.opening_bank}</td>
</if>
<td>{$vo.statement_num}</td>
<td>{$vo.statement_money}</td>
<td>{$vo.remark}</td>
</tr>
</foreach>
<tr>
<td colspan="2">合计:</td>
<td colspan="7">结算总金额:{$all_money}</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- <div class="search_list" style="display:flex;justify-content:flex-end;width:100%;margin-top: 30px;">-->
<!-- <div class="input-list" style="margin-left: 30px;float: right;">-->
<!-- <a class="sch-btn" href="javascript:;" id="setPayment" style="width: 150px;">确认提交</a>-->
<!-- </div>-->
<!-- </div>-->
<script>
$("#setPayment").on("click",function(){
var sendObj = {};
var url = "{:U('editPayment')}";
$("input[name='ali_user'],input[name='ali_account'],input[name='remark'],input[name='payee_name'],input[name='bank_account'],input[name='opening_bank']").map(function(index,elem) {
var id = $(elem).data("id");
var e = $(elem).attr("name");
var v = $(elem).val();
if(id in sendObj){
sendObj[id][e] = v;
}else{
sendObj[id] = {};
sendObj[id][e] = v;
}
});
layer.confirm("若支付宝账号及真实姓名不全的公司,将无法进行打款。请认真核对,点击取消返回",{title:false}, function(index){
$.ajax({
type: "POST",
url: url,
dataType: 'json',
async: false,
data: {info:sendObj},
success:function(data){
layer.close(index);
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.parent.reload();
},1000);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
}
}
});
});
})
function cancelPoolAjax(opurl,senddata){
//执行
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
async: false,
data: senddata,
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;
}
}
});
}
</script>
</body>
</html>

@ -48,7 +48,9 @@
.data_list table td{
line-height: 2;
}
tr{
border-bottom: 1px solid #e6e6e6;
}
.layui-layer-title {
text-align: center;
height: 42px;

@ -65,6 +65,12 @@
visibility: visible;
line-height: 20px;
}
.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;}
</style>
@ -79,26 +85,67 @@
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<!--游戏类型搜索END-->
<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 input-list-promote search_label_rehab">
<select id="count_date" name="count_date" class="select_gallery" style="width:150px;">
<option value="">请选择月份</option>
<volist name="date_count" id="vo">
<option value="{$vo}" <if condition="$vo eq $_GET['count_date']">selected=selected</if>>{$vo}</option>
</volist>
<!-- <div class="input-list input-list-promote search_label_rehab">-->
<!-- <select id="count_date" name="count_date" class="select_gallery" style="width:150px;">-->
<!-- <option value="">请选择月份</option>-->
<!-- <volist name="date_count" id="vo">-->
<!-- <option value="{$vo}" <if condition="$vo eq $_GET['count_date']">selected=selected</if>>{$vo}</option>-->
<!-- </volist>-->
<!-- </select>-->
<!-- </div>-->
<div class="input-list">
<input style="width: 200px;" type="text" name="user_account" class="search-input" value="{:I('user_account')}" placeholder="请输入玩家账号">&nbsp;
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="partner" class="search-input" value="{:I('partner')}" placeholder="请输入上游cp名称">&nbsp;
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="company_name" class="search-input" value="{:I('company_name')}" placeholder="请输入工会名称">&nbsp;
</div>
<div class="input-list">
<select name="status" style="color:#444" class="select_gallery" id="status">
<option value="">请选择退款状态</option>
<option value="1" >已退款</option>
<option value="0" >未退款</option>
</select>
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="user_account" class="search-input" value="{:I('user_account')}" placeholder="请输入玩家账号">&nbsp;
<input type="text" readonly id="usetime_start" name="usetime_start" class="" value="{:I('usetime_start')}"
placeholder="操作开始时间" />
&nbsp;-&nbsp;
<div class="input-append date" style="display:inline-block">
<input type="text" readonly id="usetime_end" name="usetime_end" class="" value="{:I('usetime_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('userCount','model='.$model['name'].'&row='.I('row'),false)}"
style="width: 100px;border: #3C95C8 solid 1px;">搜索</a>
</div>
</div>
</div>
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<if condition="$check eq true">
<a class='butn check' style='background-color: #3C95C8;' data-status="1">已退款</a>
<a class='butn check' style='background-color: #3C95C8;' data-status="0">取消退款</a>
</if>
</div>
</div>
<!-- 数据列表 -->
@ -109,8 +156,14 @@
<!-- 表头 -->
<thead>
<tr>
<th><input class="check-all" type="checkbox"></th>
<th >月份</th>
<th >上游cp</th>
<th >游戏</th>
<th >玩家账号</th>
<th >工会名称</th>
<th >会长名称</th>
<th >退款状态</th>
<th >退款金额</th>
<th >操作</th>
</tr>
@ -130,8 +183,14 @@
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td><input class="ids" type="checkbox" value="{$data['id']} "data-status="{$data['status']}" name="ids[]"></td>
<td >{$data.month}</td>
<td >{$data.partner}</td>
<td >{$data.game_name}</td>
<td >{$data.user_account}</td>
<td >{$data.company_name}</td>
<td >{$data.top_account}</td>
<td >{$data.check_detail}</td>
<td >{$data.refund_amount}</td>
<td >
<a href="{$data['jump_url']}" >查看</a>
@ -174,6 +233,87 @@
highlight_subnav("{:U('userCount')}");
$(function(){
$(".select_gallery").select2();
$('#time_start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#usetime_start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#usetime_end').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'
});
$(".check").on("click",function(){
var tip = '';
var status = $(this).attr("data-status");
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
if($(elem).data("status") == 0 && status == 1){
tip = "是否确认所选记录,已经退款完成?";
return $(elem).val();
}
if ($(elem).data("status") == 1 && status == 0) {
tip = "是否确认将所选记录变更为未退款?";
return $(elem).val();
}
}).get();
if(text.length < 1){
layer.msg("<font style='color:white'>" + '无需要进行操作</font>');
return;
}
text = text.join(",");
layer.confirm(tip, {
btn: ['确认','取消'],
title:false
}, function(index){
layer.close(index);
_doAgreeApply();
});
function _doAgreeApply(){
//执行
layer.load(2);
$.ajax({
type: "POST",
url: "{:U('refund')}",
dataType: 'json',
async: true,
data: {ids:text,status:status},
success:function(data){
layer.closeAll('loading');
if(data.status==1){
layer.msg("<font style='color:white'>" + data.msg + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.msg + "</font>");
return false;
}
}
});
}
});
//搜索功能
$("#search").click(function(){

@ -2827,3 +2827,10 @@ CREATE TABLE `tab_business_affairs_award_pool` (
ALTER TABLE `tab_company_statement_info`
MODIFY COLUMN `remark` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '备注' AFTER `pay_info`;
ALTER TABLE `tab_spend_refund`
ADD COLUMN `status` tinyint(1) NULL DEFAULT 0 COMMENT '退款状态' AFTER `create_time`,
ADD COLUMN `check_time` int(11) NULL DEFAULT 0 COMMENT '确认时间' AFTER `status`;
ALTER TABLE `tab_spend_refund`
ADD COLUMN `admin` varchar(50) NULL DEFAULT '' COMMENT '操作人' AFTER `check_time`;
Loading…
Cancel
Save