diff --git a/Application/Admin/Controller/AggregateFinanceSetController.class.php b/Application/Admin/Controller/AggregateFinanceSetController.class.php
index de8b7deb3..da422bfd9 100644
--- a/Application/Admin/Controller/AggregateFinanceSetController.class.php
+++ b/Application/Admin/Controller/AggregateFinanceSetController.class.php
@@ -101,46 +101,46 @@ class AggregateFinanceSetController extends Controller {
$this->getAndSaveData(2,$begintime,$endtime);
}
- protected function getAndSaveData($type,$begintime,$endtime)
- {
- $sign = md5($begintime.$endtime.$type.$this->token);
- $arr = [
- "begintime"=>$begintime,
- "endtime"=>$endtime,
- "type"=>$type,
- "sign"=>$sign
- ];
- $dataurl .= $this->apihost."&".http_build_query($arr);
- $html = file_get_contents($dataurl);
+ protected function getAndSaveData($type,$begintime,$endtime)
+ {
+ $sign = md5($begintime.$endtime.$type.$this->token);
+ $arr = [
+ "begintime"=>$begintime,
+ "endtime"=>$endtime,
+ "type"=>$type,
+ "sign"=>$sign
+ ];
+ $dataurl .= $this->apihost."&".http_build_query($arr);
+ $html = file_get_contents($dataurl);
// echo $dataurl;die();
- sleep(5);
- $rsp = json_decode($html,true);
- if($rsp['code'] != 1){
- echo $rsp['error'].PHP_EOL;die;
- }
- //成功插入
- $Aggregate = M("aggregate_statement","tab_");
- $begintimestr = date("Y-m-d",$begintime);
- $endtimestr = date("Y-m-d",$endtime);
- if($rsp['count'] > 0){
- //插入数据
- foreach ($rsp['data'] as $k => $v) {
- foreach ($v["game_list"] as $ke => &$va) {
- $va['begintime'] = $begintimestr;
- $va['endtime'] = $endtimestr;
- $va['fax_ratio'] = 0;
- }
- $v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE);
- unset($v["game_list"]);
- $v['begintime'] = $begintime;
- $v['endtime'] = $endtime;
- $v['create_time'] = time();
- $v['admin_name'] = "system";
- $v['admin_id'] = 0;
- $v['second_party_info'] =
+ sleep(5);
+ $rsp = json_decode($html,true);
+ if($rsp['code'] != 1){
+ echo $rsp['error'].PHP_EOL;die;
+ }
+ //成功插入
+ $Aggregate = M("aggregate_statement","tab_");
+ $begintimestr = date("Y-m-d",$begintime);
+ $endtimestr = date("Y-m-d",$endtime);
+ if($rsp['count'] > 0){
+ //插入数据
+ foreach ($rsp['data'] as $k => $v) {
+ foreach ($v["game_list"] as $ke => &$va) {
+ $va['begintime'] = $begintimestr;
+ $va['endtime'] = $endtimestr;
+ $va['fax_ratio'] = 0;
+ }
+ $v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE);
+ unset($v["game_list"]);
+ $v['begintime'] = $begintime;
+ $v['endtime'] = $endtime;
+ $v['create_time'] = time();
+ $v['admin_name'] = "system";
+ $v['admin_id'] = 0;
+ $v['second_party_info'] =
json_encode([
- "partner"=>$v['channel_name'],
- "invoice_type"=>$v['invoice_type'],
+ "partner"=>$v['channel_name'],
+ "invoice_type"=>$v['invoice_type'],
"invoice_item"=>$v['invoice_item'],
"company_tax_no"=>$v['tax_identification_number'],
"link_man"=>$v['connection_person'],
@@ -151,61 +151,61 @@ class AggregateFinanceSetController extends Controller {
"payee_name"=>$v['bank_user'],
"bank_account"=>$v['bank_card'],
"opening_bank"=>$v['bank_name'],
- ],JSON_UNESCAPED_UNICODE);
- $Aggregate->add($v);
- }
- }
-
- if($type == 0){
- echo "----周结统计ok".PHP_EOL;
- }elseif($type == 1){
- echo "----月结统计ok".PHP_EOL;
- }elseif($type == 2){
- echo "----补点统计ok".PHP_EOL;
- }
- }
+ ],JSON_UNESCAPED_UNICODE);
+ $Aggregate->add($v);
+ }
+ }
+
+ if($type == 0){
+ echo "----周结统计ok".PHP_EOL;
+ }elseif($type == 1){
+ echo "----月结统计ok".PHP_EOL;
+ }elseif($type == 2){
+ echo "----补点统计ok".PHP_EOL;
+ }
+ }
/**
* 重算聚合接口数据
* @param [type] $id
* @return void
*/
- public function updateAggregateFinanceData($id)
- {
- //获取基础信息
- $Aggregate = M("aggregate_statement","tab_");
- $info = $Aggregate->where("id='{$id}'")->find();
- $sign = md5($info['begintime'].$info['endtime'].$info['withdraw_type'].$this->token);
- $arr = [
- "begintime"=>$info['begintime'],
- "endtime"=>$info['endtime'],
- "type"=>$info['withdraw_type'],
- "sign"=>$sign,
- "channel_id"=>$info['channel_id']
- ];
- $dataurl .= $this->apihost."&".http_build_query($arr);
- $html = file_get_contents($dataurl);
- $rsp = json_decode($html,true);
- if($rsp['code'] != 1){
- echo $rsp['error'].PHP_EOL;die;
- }
- //更新信息
- $begintimestr = date("Y-m-d",$info['begintime']);
- $endtimestr = date("Y-m-d",$info['endtime']);
+ public function updateAggregateFinanceData($id)
+ {
+ //获取基础信息
+ $Aggregate = M("aggregate_statement","tab_");
+ $info = $Aggregate->where("id='{$id}'")->find();
+ $sign = md5($info['begintime'].$info['endtime'].$info['withdraw_type'].$this->token);
+ $arr = [
+ "begintime"=>$info['begintime'],
+ "endtime"=>$info['endtime'],
+ "type"=>$info['withdraw_type'],
+ "sign"=>$sign,
+ "channel_id"=>$info['channel_id']
+ ];
+ $dataurl .= $this->apihost."&".http_build_query($arr);
+ $html = file_get_contents($dataurl);
+ $rsp = json_decode($html,true);
+ if($rsp['code'] != 1){
+ echo $rsp['error'].PHP_EOL;die;
+ }
+ //更新信息
+ $begintimestr = date("Y-m-d",$info['begintime']);
+ $endtimestr = date("Y-m-d",$info['endtime']);
- if($rsp['count'] > 0){
- //插入数据
- foreach ($rsp['data'] as $k => $v) {
- foreach ($v["game_list"] as $ke => &$va) {
- $va['begintime'] = $begintimestr;
- $va['endtime'] = $endtimestr;
- $va['fax_ratio'] = 0;
- }
- $v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE);
- unset($v["game_list"]);
- $v['create_time'] = time();
- $v['admin_name'] = $_SESSION['onethink_admin']['user_auth']['username'];
- $v['admin_id'] = $_SESSION['onethink_admin']['user_auth']['uid'];
- $v['verify_status'] = 0;
+ if($rsp['count'] > 0){
+ //插入数据
+ foreach ($rsp['data'] as $k => $v) {
+ foreach ($v["game_list"] as $ke => &$va) {
+ $va['begintime'] = $begintimestr;
+ $va['endtime'] = $endtimestr;
+ $va['fax_ratio'] = 0;
+ }
+ $v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE);
+ unset($v["game_list"]);
+ $v['create_time'] = time();
+ $v['admin_name'] = $_SESSION['onethink_admin']['user_auth']['username'];
+ $v['admin_id'] = $_SESSION['onethink_admin']['user_auth']['uid'];
+ $v['verify_status'] = 0;
// $first_party_info = json_decode($info['first_party_info'], 1);
// if($first_party_info['partner'] == $info['channel_name']){
@@ -250,35 +250,35 @@ class AggregateFinanceSetController extends Controller {
// }
- $res = $Aggregate->where("id='{$id}'")->save($v);
- if(empty($res)){
- return false;
- }
- }
- }else{
- $savedata = [
- "create_time"=>time(),
- "admin_name"=>$_SESSION['onethink_admin']['user_auth']['username'],
- "admin_id"=>$_SESSION['onethink_admin']['user_auth']['uid'],
- "verify_status"=>0,
- "statement_info"=>json_encode([],JSON_UNESCAPED_UNICODE),
- "ratio_money"=>0,
- "pay_money"=>0
- ];
-
- $first_party_info = json_decode($info['first_party_info'], 1);
- if($first_party_info['partner'] == $info['channel_name']){
- $savedata['second_party_info'] = $info['first_party_info'];
- $savedata['first_party_info'] = $info['second_party_info'];
+ $res = $Aggregate->where("id='{$id}'")->save($v);
+ if(empty($res)){
+ return false;
+ }
+ }
+ }else{
+ $savedata = [
+ "create_time"=>time(),
+ "admin_name"=>$_SESSION['onethink_admin']['user_auth']['username'],
+ "admin_id"=>$_SESSION['onethink_admin']['user_auth']['uid'],
+ "verify_status"=>0,
+ "statement_info"=>json_encode([],JSON_UNESCAPED_UNICODE),
+ "ratio_money"=>0,
+ "pay_money"=>0
+ ];
- $savedata['pay_type'] =0;
- }
+ $first_party_info = json_decode($info['first_party_info'], 1);
+ if($first_party_info['partner'] == $info['channel_name']){
+ $savedata['second_party_info'] = $info['first_party_info'];
+ $savedata['first_party_info'] = $info['second_party_info'];
- $res = $Aggregate->where("id='{$id}'")->save($savedata);
- if(empty($res)){
- return false;
- }
- }
- return true;
- }
+ $savedata['pay_type'] =0;
+ }
+
+ $res = $Aggregate->where("id='{$id}'")->save($savedata);
+ if(empty($res)){
+ return false;
+ }
+ }
+ return true;
+ }
}
diff --git a/Application/Admin/Controller/AggregateFinanceStatementController.class.php b/Application/Admin/Controller/AggregateFinanceStatementController.class.php
index ae6a488f6..51e436624 100644
--- a/Application/Admin/Controller/AggregateFinanceStatementController.class.php
+++ b/Application/Admin/Controller/AggregateFinanceStatementController.class.php
@@ -541,9 +541,9 @@ class AggregateFinanceStatementController extends ThinkController
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
-
+
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '
');
-
+
date_default_timezone_set('Asia/Shanghai');
Vendor("PHPExcel.PHPExcel");
$objPHPExcel = new \PHPExcel();
@@ -552,7 +552,7 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_stream.xls");
$statement_begin_time = date('Y.m.d', $data['begintime']);//对账开始时间
$statement_end_time = date('Y.m.d',$data['endtime']);//对账截止时间
-
+
$objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setWrapText(true);
$objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['channel_name']} 》结算单\n({$statement_begin_time}-{$statement_end_time})");
if ($data['withdraw_type'] == '2') {
@@ -623,7 +623,7 @@ class AggregateFinanceStatementController extends ThinkController
header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $fileName .'".xls');
header("Content-Disposition:attachment;filename={$fileName}.xls");//attachment新窗口打印inline本窗口打印
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
- $objWriter->save('php://output');
+ $objWriter->save('php://output');
}
//获取权限
public function getAuth()
diff --git a/Application/Admin/Controller/CpJuheCompanyController.class.php b/Application/Admin/Controller/CpJuheCompanyController.class.php
index 9f46822df..e8163b535 100644
--- a/Application/Admin/Controller/CpJuheCompanyController.class.php
+++ b/Application/Admin/Controller/CpJuheCompanyController.class.php
@@ -44,14 +44,48 @@ class CpJuheCompanyController extends ThinkController {
if($_REQUEST['export']) {
$list_data = $data['data'];
foreach ($list_data as $key => $value) {
+
+ if ($list_data[$key]['bank_card']){
+ $list_data[$key]['bank_card'] = ' '.$list_data[$key]['bank_card'];
+ }
+
+ if ($list_data[$key]['alipay_user']) {
+ $list_data[$key]['alipay_user'] = ' '.$list_data[$key]['alipay_user'];
+ }
+
$list_data[$key]['agreement_time'] = json_decode($list_data[$key]['agreement_time'],true);
$list_data[$key]['balance_time'] = json_decode($list_data[$key]['balance_time'],true);
- $list_data[$key]['agreement_time']['start_time'] = date("Y-m-d H:i:s",$list_data[$key]['agreement_time']['start_time']);
- ($list_data[$key]['agreement_time']['end_time']!=1)?($list_data[$key]['agreement_time']['end_time'] = date("Y-m-d H:i:s",$list_data[$key]['agreement_time']['end_time'])):($list_data[$key]['agreement_time']['end_time'] = "");
+// $list_data[$key]['agreement_time']['start_time'] = date("Y-m-d",$list_data[$key]['agreement_time']['start_time']);
+// ($list_data[$key]['agreement_time']['end_time']!=1)?($list_data[$key]['agreement_time']['end_time'] = date("Y-m-d",$list_data[$key]['agreement_time']['end_time'])):($list_data[$key]['agreement_time']['end_time'] = "");
+//
+// $list_data[$key]['balance_time']['start_time'] = date("Y-m-d",$list_data[$key]['balance_time']['start_time']);
+// ($list_data[$key]['balance_time']['end_time']!=1)?($list_data[$key]['balance_time']['end_time'] = date("Y-m-d",$list_data[$key]['balance_time']['end_time'])):($list_data[$key]['balance_time']['end_time'] = "");
+
+ if ($list_data[$key]['agreement_time']['start_time']) {
+ $list_data[$key]['agreement_time']['start_time'] = date("Y-m-d", $list_data[$key]['agreement_time']['start_time']);
+ } else {
+ $list_data[$key]['agreement_time']['start_time'] = "未设置";
+ }
+
+ if($list_data[$key]['agreement_time']['end_time']) {
+ ($list_data[$key]['agreement_time']['end_time'] != 1) ? ($list_data[$key]['agreement_time']['end_time'] = date("Y-m-d", $list_data[$key]['agreement_time']['end_time'])) : ($list_data[$key]['agreement_time']['end_time'] = "");
+ } else {
+ $list_data[$key]['agreement_time']['end_time'] = "未设置";
+ }
+
+ if ($list_data[$key]['balance_time']['start_time']) {
+ $list_data[$key]['balance_time']['start_time'] = date("Y-m-d", $list_data[$key]['balance_time']['start_time']);
+ } else {
+ $list_data[$key]['balance_time']['start_time'] = "未设置";
+ }
+
+ if($list_data[$key]['balance_time']['end_time']) {
+ ($list_data[$key]['balance_time']['end_time'] != 1) ? ($list_data[$key]['balance_time']['end_time'] = date("Y-m-d", $list_data[$key]['balance_time']['end_time'])) : ($list_data[$key]['balance_time']['end_time'] = "");
+ } else {
+ $list_data[$key]['balance_time']['end_time'] = "未设置";
+ }
- $list_data[$key]['balance_time']['start_time'] = date("Y-m-d H:i:s",$list_data[$key]['balance_time']['start_time']);
- ($list_data[$key]['balance_time']['end_time']!=1)?($list_data[$key]['balance_time']['end_time'] = date("Y-m-d H:i:s",$list_data[$key]['balance_time']['end_time'])):($list_data[$key]['balance_time']['end_time'] = "");
}
$this->assign("listdata",$list_data);
@@ -74,8 +108,8 @@ class CpJuheCompanyController extends ThinkController {
public function detail() {
$_REQUEST['id']?($request['id'] = $_REQUEST['id']):'';
-
- $data = json_decode(curl_post("http://10.0.1.161:8095/index.php?g=Api&m=CpJuheCompany&a=detail",$request),true);
+ $url = M("kv")->field("value")->where(['key'=>"cp_company_detail_api"])->find();
+ $data = json_decode(curl_post($url['value'],$request),true);
$this->assign("data",$data);
$this->display();
diff --git a/Application/Admin/View/CpJuheCompany/detail.html b/Application/Admin/View/CpJuheCompany/detail.html
index 8e4e219fb..ed82a2316 100644
--- a/Application/Admin/View/CpJuheCompany/detail.html
+++ b/Application/Admin/View/CpJuheCompany/detail.html
@@ -132,7 +132,7 @@