excel打款列表

master
chenzhi 4 years ago
parent 24f2b76bd6
commit 74e39c7b20

@ -7,7 +7,6 @@ namespace Payment\Controller;
class ExcelPaymentController extends BaseController
{
public $PayStatus=[
"-2"=>"信息配置不全",
"-1"=>"打款失败",
"0"=>"未打款",
"1"=>"打款成功"
@ -42,7 +41,7 @@ class ExcelPaymentController extends BaseController
$row = $params['row'] ? intval($params['row']) : 10;
$map=[
"i.verify_status"=>["in","-1,1"],
"_string"=>"1=1",
];
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
@ -65,48 +64,24 @@ class ExcelPaymentController extends BaseController
$map['i.pay_time'] = ['ELT', strtotime($_REQUEST['pay_time_end']) + 86399];
}
if(isset($_REQUEST['company_type'])){
$map['i.company_type'] = $_REQUEST['company_type'];
}
if(isset($_REQUEST['company_id'])){
$map['i.company_id'] = $_REQUEST['company_id'];
if(isset($_REQUEST['company_name'])){
$map['i.company_name'] = $_REQUEST['company_name'];
}
if(isset($_REQUEST['pay_status'])){
if($_REQUEST['pay_status'] == -2){
$map['i.verify_status'] = -1;
}else{
$map['i.pay_status'] = $_REQUEST['pay_status'];
}
}
if(isset($_REQUEST['pay_type'])){
$map['i.pay_type'] = $_REQUEST['pay_type'];
}
$CompanyInfo = M("company_statement_info","tab_")
$CompanyInfo = M("excel_statement_info","tab_")
->alias('i')
->field("i.*,p.statement_num statement_pool_num")
->join("tab_company_statement_pool p ON p.id = i.pool_id")
->field("i.*")
->where($map)
->order("FIELD(pay_status,0,-1,1),verify_status desc")
->page($page,$row)
->order("FIELD(pay_status,0,-1,1)")
->select();
foreach($CompanyInfo as $k=>&$v){
$v['can_pay'] = 1;
if($v['verify_status'] == -1){
$v['verify_status_str']="信息配置不全";
$v['can_pay'] = 0;
}else{
if($v['pay_status'] == 1){ $v['can_pay'] = 0; }
$v['verify_status_str'] = $this->PayStatus[$v['pay_status']];
if($v['pay_status'] == 1){
$v['pay_type'] = $v['pay_type'] == 1 ? "提现" :"线上打款";
$v['verify_status_str'] .= ("/". $v['pay_type']);
}
}
$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']);
if(empty($v['pay_time'])){
@ -116,13 +91,12 @@ class ExcelPaymentController extends BaseController
}
$v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}";
}
//统计待打款金额
$countmap = $map;
$countmap['pay_status']=["neq",1];
$money = M("company_statement_info","tab_")->alias('i')->field("sum(statement_money) statement_money")->where($countmap)->find();
$count = M("company_statement_info","tab_")->alias('i')->field("count(id) count")->where($map)->find();
$money = M("excel_statement_info","tab_")->alias('i')->field("sum(statement_money) statement_money")->where($countmap)->find();
$count = M("excel_statement_info","tab_")->alias('i')->field("count(id) count")->where($map)->find();
// dd($count);
$parameter['p'] = $page;
$parameter['row'] = $row;
@ -130,7 +104,7 @@ class ExcelPaymentController extends BaseController
if ($page) {
$this->assign('_page', $page);
}
$this->meta_title = '打款结算单';
$this->meta_title = 'EXCEL打款';
$this->assign("data",$CompanyInfo);
$this->assign("money",$money);
$this->assign("CompanyType", $this->CompanyType);
@ -163,6 +137,11 @@ class ExcelPaymentController extends BaseController
$v['company_type'] = 2;
$v['create_time'] = time();
$v['statement_num'] = "JS_".date('Ymd').date('His').$v['company_id'].sp_random_string(5);
if(!isset($v['company_info']['ali_user']) || !isset($v['company_info']['ali_account']) || $v['company_info']['ali_user'] == '' || $v['company_info']['ali_account'] == ''){
M('ExcelStatementInfo')->where("statement_num = '{$v['statement_num']}'")->delete();
$this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]);
}
$res = $ExcelStatementInfo->add($v);
if($res === false){
M('ExcelStatementInfo')->where("statement_num = '{$v['statement_num']}'")->delete();

@ -91,6 +91,7 @@ class PaymentController extends BaseController
->field("i.*,p.statement_num statement_pool_num")
->join("tab_company_statement_pool p ON p.id = i.pool_id")
->where($map)
->page($page,$row)
->order("FIELD(pay_status,0,-1,1),verify_status desc")
->select();
foreach($CompanyInfo as $k=>&$v){

@ -151,7 +151,7 @@
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('FinanceCompare/index')}");
highlight_subnav("{:U('lists')}");
var MSG={
showmsg:function(str){
$("#creat_msg").show();

@ -96,8 +96,8 @@
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">打款结算单</h3>
<p class="description_text">信息不全指:支付宝账号或真实姓名未填写</p>
<h3 class="page_title">EXCEL打款</h3>
<p class="description_text">批次号指同一表格上传的打款单</p>
</div>
@ -107,16 +107,7 @@
<div class="jssearch fl cf search_list" style="margin-bottom: 0">
<div class="input-list input-list-promote search_label_rehab">
<select id="company_type" name="company_type" class="select_gallery" >
<option value="">结算单类型</option>
<volist name="CompanyType" id="vo">
<option value="{$key}" <if condition="isset($_GET['company_type']) && $key eq I('company_type')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="company_id" name="company_id" class="select_gallery" style="width: 220px;">
<select id="company_name" name="company_name" class="select_gallery" style="width: 220px;">
<option value="">请先选择公司类型</option>
</select>
</div>
@ -140,15 +131,6 @@
</select>
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="pay_type" name="pay_type" class="select_gallery" >
<option value="">打款方式</option>
<option value="1" <if condition="isset($_GET['pay_type']) && I('pay_type') eq 1">selected</if> >提现</option>
<option value="2" <if condition="isset($_GET['pay_type']) && I('pay_type') eq 2">selected</if> >线上打款</option>
</select>
</div>
<div class="input-list">
<input type="text" readonly id="time_start2" name="pay_time_start" class="" value="{:I('pay_time_start')}" placeholder="支付开始时间" />
&nbsp;-&nbsp;
@ -185,7 +167,7 @@
<th>合作公司</th>
<th>公司类型</th>
<th>结算时间</th>
<th>关联汇总单</th>
<th>批次</th>
<th>结算金额</th>
<th>结算流水</th>
<th>打款状态</th>
@ -210,14 +192,14 @@
<td>{$data.company_type}</td>
<td>{$data.valid}</td>
<td>{$data.statement_pool_num}</td>
<td>{$data.batch_num}</td>
<td>{$data.statement_money}</td>
<td>{$data.platform_amount}</td>
<if condition="($data['verify_status'] eq -1) OR ($data['pay_status'] eq -1) ">
<td style="color: red;">{$data.verify_status_str}</td>
<if condition="($data['pay_status'] eq -1) ">
<td style="color: red;">{$data.pay_status_str}</td>
<else />
<td>{$data.verify_status_str}</td>
<td>{$data.pay_status_str}</td>
</if>
<td>{$data.pay_time}</td>
@ -273,31 +255,25 @@
$(function(){
var company_id = "{$_GET['company_id']??0}";
$("#company_type").on("change",function(){
var val = $(this).find("option:selected").val();
var type = 0;
if(val == 3){
type = 1
}else{
type = 2;
}
var url = "{:U('Ajax/getCompanyList')}"+"&company_type="+type;
var company_name = "{$_GET['company_name']??0}";
companySelect();
function companySelect(){
var url = "{:U('Ajax/getCompanyList')}"+"&company_type=2";
$.get(url,function(data){
var company = data;
var companystr = '<option value="">请选择合作公司</option>';
for (var i in company) {
if(company[i].id == company_id){
companystr += "<option value='" + company[i].id + "' selected='selected'>" + company[i].name + "</option>"
if(company[i].name == company_name){
companystr += "<option value='" + company[i].name + "' selected='selected'>" + company[i].name + "</option>"
}else{
companystr += "<option value='" + company[i].id + "'>" + company[i].name + "</option>"
companystr += "<option value='" + company[i].name + "'>" + company[i].name + "</option>"
}
}
$("#company_id").html(companystr);
$("#company_id").select2();
})
$("#company_name").html(companystr);
$("#company_name").select2();
})
$("#company_type").change();
}
$(".viewPool").click(function () {
var id = $(this).data("id");

@ -211,6 +211,10 @@ $(function(){
<li>
<a class="item" href="{:U('Payment/lists')}">打款结算单</a>
</li>
<li>
<a class="item" href="{:U('ExcelPayment/lists')}">EXCEL打款</a>
</li>
</ul>
</div>
</div>

Loading…
Cancel
Save