diff --git a/Application/Payment/Controller/ExcelPaymentController.class.php b/Application/Payment/Controller/ExcelPaymentController.class.php index 8ce98c7c8..dab61f71e 100644 --- a/Application/Payment/Controller/ExcelPaymentController.class.php +++ b/Application/Payment/Controller/ExcelPaymentController.class.php @@ -75,7 +75,6 @@ class ExcelPaymentController extends BaseController $map['i.batch_num'] = $_REQUEST['batch_num']; } - $CompanyInfo = M("excel_statement_info","tab_") ->alias('i') ->field("i.*") @@ -105,10 +104,7 @@ class ExcelPaymentController extends BaseController $countmap['pay_status']=["neq",1]; $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; - $page = set_pagination($count['count'], $row, $parameter); + $page = set_pagination($count['count'], $row); if ($page) { $this->assign('_page', $page); } @@ -137,6 +133,7 @@ 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['batch_num'] = $batch; @@ -145,14 +142,14 @@ 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(); + if(!isset($company_info['ali_user']) || !isset($company_info['ali_account']) || $company_info['ali_user'] == '' || $company_info['ali_account'] == ''){ + M('ExcelStatementInfo',"tab_")->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(); + M('ExcelStatementInfo',"tab_")->where("statement_num = '{$v['statement_num']}'")->delete(); $this->ajaxReturn(["status"=>0,"msg"=>"添加失败"]); } } @@ -170,12 +167,34 @@ class ExcelPaymentController extends BaseController $is_export = true; } //获取基本信息 - $dbres = M("ExcelStatementInfo","tab_")->where("id='{$id}'")->select(); - $title = $dbres[0]['company_name']; + if($is_export && isset($_REQUEST['exporttype']) && $_REQUEST['exporttype']=='all'){ + $dbres = M("ExcelStatementInfo","tab_")->where("id in ({$id})")->select(); + $title = date("YmdHis"); + }else{ + $dbres = M("ExcelStatementInfo","tab_")->where("id ='{$id}'")->select(); + $title = $dbres[0]['company_name'].date("YmdHis"); + } + $this->assign("title",$title); - $this->viewPuPool($dbres,$is_export); + } + public function delItem() + { + if(!isset($_REQUEST['ids'])){ + $this->error('参数错误'); + } + $ids = $_REQUEST['ids']; + $map = [ + "pay_status"=>["NEQ",1], + "id"=>["IN",$ids] + ]; + $dbres = M("ExcelStatementInfo","tab_")->where($map)->delete(); + if($dbres === false){ + $this->ajaxReturn(["status"=>0,"info"=>"删除失败"]); + } + $this->ajaxReturn(["status"=>1,"info"=>"删除成功"]); + } //个人汇总结算查看 public function viewPuPool(&$infolist,$is_export){ @@ -203,8 +222,10 @@ class ExcelPaymentController extends BaseController $val['ratio'] = 0; } if($is_export){ + $val['ratio'] = $val['ratio']*100; + $val['increment_ratio'] = $val['increment_ratio']*100; //J3*(K3+L3)+M3-N3 - $va['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}"; + $val['sum_money'] = "=J{$line}*(K{$line}+L{$line})+M{$line}-N{$line}"; $count['sum_money_exp'] .= "O{$line}+"; $count['platform_amount_exp'] .= "J{$line}+"; @@ -220,7 +241,6 @@ class ExcelPaymentController extends BaseController $count["platform_amount"] = "=".trim($count["platform_amount_exp"],"+"); $count["sum_money"] = "=".trim($count["sum_money_exp"],"+"); } - // dd($infolist); $this->assign("data",$infolist); $this->assign("count",$count); $this->assign("is_export",$is_export); @@ -288,10 +308,11 @@ class ExcelPaymentController extends BaseController $dbres = M("ExcelStatementInfo","tab_")->where("id='{$id}'")->find(); $company_info = json_decode($dbres['company_info'],true); - if($dbres['pay_status'] != 1 && $dbres['verify_status'] == 1){ + if($dbres['pay_status'] != 1){ //执行打款 - $title = "信息服务费"; + $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; diff --git a/Application/Payment/View/ExcelPayment/add.html b/Application/Payment/View/ExcelPayment/add.html index b4c0010cf..01c8056ff 100644 --- a/Application/Payment/View/ExcelPayment/add.html +++ b/Application/Payment/View/ExcelPayment/add.html @@ -398,7 +398,7 @@ e[k] = Math.round(e[k]*100)/100; } gamet[titleKey[k]] = e[k]; - }else if(k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ + }else if(k=="下游类型" ||k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ temp.company_info[titleKey[k]] = e[k]; }else{ temp[titleKey[k]] = e[k]; @@ -436,7 +436,7 @@ e[k] = Math.round(e[k]*100)/100; } gamet[titleKey[k]] = e[k]; - }else if(k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ + }else if(k=="下游类型" || k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ temp.company_info[titleKey[k]] = e[k]; }else{ temp[titleKey[k]] = e[k]; @@ -469,7 +469,7 @@ e[k] = Math.round(e[k]*100)/100; } gamet[titleKey[k]] = e[k]; - }else if(k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ + }else if( k=="下游类型" || k=="市场员" || k=="下游性质" || k == "账户名" || k == "银行卡号" || k == "开户支行" || k == "账户类型" || k == "支付宝真实姓名" || k == "支付宝账号"){ temp.company_info[titleKey[k]] = e[k]; }else{ temp[titleKey[k]] = e[k]; diff --git a/Application/Payment/View/ExcelPayment/lists.html b/Application/Payment/View/ExcelPayment/lists.html index 5d7119848..3ccf47756 100644 --- a/Application/Payment/View/ExcelPayment/lists.html +++ b/Application/Payment/View/ExcelPayment/lists.html @@ -157,6 +157,8 @@
@@ -191,7 +193,7 @@