Merge branch 'feature/cp_juhe_company' into hotfix/market_percentage

# Conflicts:
#	Application/Admin/Common/extend.php
#	Application/Admin/Controller/AggregateFinanceSetController.class.php
#	Application/Admin/Controller/CpJuheCompanyController.class.php
#	Application/Admin/View/CpJuheCompany/detail.html
#	Application/Admin/View/CpJuheCompany/export.html
#	Data/update.sql
master
zhengyongxing 5 years ago
commit 11ff884e6a

@ -101,46 +101,46 @@ class AggregateFinanceSetController extends Controller {
$this->getAndSaveData(2,$begintime,$endtime); $this->getAndSaveData(2,$begintime,$endtime);
} }
protected function getAndSaveData($type,$begintime,$endtime) protected function getAndSaveData($type,$begintime,$endtime)
{ {
$sign = md5($begintime.$endtime.$type.$this->token); $sign = md5($begintime.$endtime.$type.$this->token);
$arr = [ $arr = [
"begintime"=>$begintime, "begintime"=>$begintime,
"endtime"=>$endtime, "endtime"=>$endtime,
"type"=>$type, "type"=>$type,
"sign"=>$sign "sign"=>$sign
]; ];
$dataurl .= $this->apihost."&".http_build_query($arr); $dataurl .= $this->apihost."&".http_build_query($arr);
$html = file_get_contents($dataurl); $html = file_get_contents($dataurl);
// echo $dataurl;die(); // echo $dataurl;die();
sleep(5); sleep(5);
$rsp = json_decode($html,true); $rsp = json_decode($html,true);
if($rsp['code'] != 1){ if($rsp['code'] != 1){
echo $rsp['error'].PHP_EOL;die; echo $rsp['error'].PHP_EOL;die;
} }
//成功插入 //成功插入
$Aggregate = M("aggregate_statement","tab_"); $Aggregate = M("aggregate_statement","tab_");
$begintimestr = date("Y-m-d",$begintime); $begintimestr = date("Y-m-d",$begintime);
$endtimestr = date("Y-m-d",$endtime); $endtimestr = date("Y-m-d",$endtime);
if($rsp['count'] > 0){ if($rsp['count'] > 0){
//插入数据 //插入数据
foreach ($rsp['data'] as $k => $v) { foreach ($rsp['data'] as $k => $v) {
foreach ($v["game_list"] as $ke => &$va) { foreach ($v["game_list"] as $ke => &$va) {
$va['begintime'] = $begintimestr; $va['begintime'] = $begintimestr;
$va['endtime'] = $endtimestr; $va['endtime'] = $endtimestr;
$va['fax_ratio'] = 0; $va['fax_ratio'] = 0;
} }
$v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE); $v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE);
unset($v["game_list"]); unset($v["game_list"]);
$v['begintime'] = $begintime; $v['begintime'] = $begintime;
$v['endtime'] = $endtime; $v['endtime'] = $endtime;
$v['create_time'] = time(); $v['create_time'] = time();
$v['admin_name'] = "system"; $v['admin_name'] = "system";
$v['admin_id'] = 0; $v['admin_id'] = 0;
$v['second_party_info'] = $v['second_party_info'] =
json_encode([ json_encode([
"partner"=>$v['channel_name'], "partner"=>$v['channel_name'],
"invoice_type"=>$v['invoice_type'], "invoice_type"=>$v['invoice_type'],
"invoice_item"=>$v['invoice_item'], "invoice_item"=>$v['invoice_item'],
"company_tax_no"=>$v['tax_identification_number'], "company_tax_no"=>$v['tax_identification_number'],
"link_man"=>$v['connection_person'], "link_man"=>$v['connection_person'],
@ -151,61 +151,61 @@ class AggregateFinanceSetController extends Controller {
"payee_name"=>$v['bank_user'], "payee_name"=>$v['bank_user'],
"bank_account"=>$v['bank_card'], "bank_account"=>$v['bank_card'],
"opening_bank"=>$v['bank_name'], "opening_bank"=>$v['bank_name'],
],JSON_UNESCAPED_UNICODE); ],JSON_UNESCAPED_UNICODE);
$Aggregate->add($v); $Aggregate->add($v);
} }
} }
if($type == 0){ if($type == 0){
echo "----周结统计ok".PHP_EOL; echo "----周结统计ok".PHP_EOL;
}elseif($type == 1){ }elseif($type == 1){
echo "----月结统计ok".PHP_EOL; echo "----月结统计ok".PHP_EOL;
}elseif($type == 2){ }elseif($type == 2){
echo "----补点统计ok".PHP_EOL; echo "----补点统计ok".PHP_EOL;
} }
} }
/** /**
* 重算聚合接口数据 * 重算聚合接口数据
* @param [type] $id * @param [type] $id
* @return void * @return void
*/ */
public function updateAggregateFinanceData($id) public function updateAggregateFinanceData($id)
{ {
//获取基础信息 //获取基础信息
$Aggregate = M("aggregate_statement","tab_"); $Aggregate = M("aggregate_statement","tab_");
$info = $Aggregate->where("id='{$id}'")->find(); $info = $Aggregate->where("id='{$id}'")->find();
$sign = md5($info['begintime'].$info['endtime'].$info['withdraw_type'].$this->token); $sign = md5($info['begintime'].$info['endtime'].$info['withdraw_type'].$this->token);
$arr = [ $arr = [
"begintime"=>$info['begintime'], "begintime"=>$info['begintime'],
"endtime"=>$info['endtime'], "endtime"=>$info['endtime'],
"type"=>$info['withdraw_type'], "type"=>$info['withdraw_type'],
"sign"=>$sign, "sign"=>$sign,
"channel_id"=>$info['channel_id'] "channel_id"=>$info['channel_id']
]; ];
$dataurl .= $this->apihost."&".http_build_query($arr); $dataurl .= $this->apihost."&".http_build_query($arr);
$html = file_get_contents($dataurl); $html = file_get_contents($dataurl);
$rsp = json_decode($html,true); $rsp = json_decode($html,true);
if($rsp['code'] != 1){ if($rsp['code'] != 1){
echo $rsp['error'].PHP_EOL;die; echo $rsp['error'].PHP_EOL;die;
} }
//更新信息 //更新信息
$begintimestr = date("Y-m-d",$info['begintime']); $begintimestr = date("Y-m-d",$info['begintime']);
$endtimestr = date("Y-m-d",$info['endtime']); $endtimestr = date("Y-m-d",$info['endtime']);
if($rsp['count'] > 0){ if($rsp['count'] > 0){
//插入数据 //插入数据
foreach ($rsp['data'] as $k => $v) { foreach ($rsp['data'] as $k => $v) {
foreach ($v["game_list"] as $ke => &$va) { foreach ($v["game_list"] as $ke => &$va) {
$va['begintime'] = $begintimestr; $va['begintime'] = $begintimestr;
$va['endtime'] = $endtimestr; $va['endtime'] = $endtimestr;
$va['fax_ratio'] = 0; $va['fax_ratio'] = 0;
} }
$v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE); $v["statement_info"] = json_encode($v["game_list"],JSON_UNESCAPED_UNICODE);
unset($v["game_list"]); unset($v["game_list"]);
$v['create_time'] = time(); $v['create_time'] = time();
$v['admin_name'] = $_SESSION['onethink_admin']['user_auth']['username']; $v['admin_name'] = $_SESSION['onethink_admin']['user_auth']['username'];
$v['admin_id'] = $_SESSION['onethink_admin']['user_auth']['uid']; $v['admin_id'] = $_SESSION['onethink_admin']['user_auth']['uid'];
$v['verify_status'] = 0; $v['verify_status'] = 0;
// $first_party_info = json_decode($info['first_party_info'], 1); // $first_party_info = json_decode($info['first_party_info'], 1);
// if($first_party_info['partner'] == $info['channel_name']){ // if($first_party_info['partner'] == $info['channel_name']){
@ -250,35 +250,35 @@ class AggregateFinanceSetController extends Controller {
// } // }
$res = $Aggregate->where("id='{$id}'")->save($v); $res = $Aggregate->where("id='{$id}'")->save($v);
if(empty($res)){ if(empty($res)){
return false; return false;
} }
} }
}else{ }else{
$savedata = [ $savedata = [
"create_time"=>time(), "create_time"=>time(),
"admin_name"=>$_SESSION['onethink_admin']['user_auth']['username'], "admin_name"=>$_SESSION['onethink_admin']['user_auth']['username'],
"admin_id"=>$_SESSION['onethink_admin']['user_auth']['uid'], "admin_id"=>$_SESSION['onethink_admin']['user_auth']['uid'],
"verify_status"=>0, "verify_status"=>0,
"statement_info"=>json_encode([],JSON_UNESCAPED_UNICODE), "statement_info"=>json_encode([],JSON_UNESCAPED_UNICODE),
"ratio_money"=>0, "ratio_money"=>0,
"pay_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'];
$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); $savedata['pay_type'] =0;
if(empty($res)){ }
return false;
} $res = $Aggregate->where("id='{$id}'")->save($savedata);
} if(empty($res)){
return true; return false;
} }
}
return true;
}
} }

@ -541,9 +541,9 @@ class AggregateFinanceStatementController extends ThinkController
error_reporting(E_ALL); error_reporting(E_ALL);
ini_set('display_errors', TRUE); ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE); ini_set('display_startup_errors', TRUE);
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Asia/Shanghai'); date_default_timezone_set('Asia/Shanghai');
Vendor("PHPExcel.PHPExcel"); Vendor("PHPExcel.PHPExcel");
$objPHPExcel = new \PHPExcel(); $objPHPExcel = new \PHPExcel();
@ -552,7 +552,7 @@ class AggregateFinanceStatementController extends ThinkController
$objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_stream.xls"); $objPHPExcel = $objReader->load("Public/Admin/excel/aggregate_stream.xls");
$statement_begin_time = date('Y.m.d', $data['begintime']);//对账开始时间 $statement_begin_time = date('Y.m.d', $data['begintime']);//对账开始时间
$statement_end_time = date('Y.m.d',$data['endtime']);//对账截止时间 $statement_end_time = date('Y.m.d',$data['endtime']);//对账截止时间
$objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setWrapText(true); $objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setWrapText(true);
$objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['channel_name']} 》结算单\n{$statement_begin_time}-{$statement_end_time}"); $objPHPExcel->getActiveSheet()->setCellValue('A1', "《 {$data['channel_name']} 》结算单\n{$statement_begin_time}-{$statement_end_time}");
if ($data['withdraw_type'] == '2') { 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-type:application/vnd.ms-excel;charset=utf-8;name="' . $fileName .'".xls');
header("Content-Disposition:attachment;filename={$fileName}.xls");//attachment新窗口打印inline本窗口打印 header("Content-Disposition:attachment;filename={$fileName}.xls");//attachment新窗口打印inline本窗口打印
$objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output'); $objWriter->save('php://output');
} }
//获取权限 //获取权限
public function getAuth() public function getAuth()

@ -44,14 +44,48 @@ class CpJuheCompanyController extends ThinkController {
if($_REQUEST['export']) { if($_REQUEST['export']) {
$list_data = $data['data']; $list_data = $data['data'];
foreach ($list_data as $key => $value) { foreach ($list_data as $key => $value) {
if ($list_data[$key]['bank_card']){
$list_data[$key]['bank_card'] = '&nbsp;'.$list_data[$key]['bank_card'];
}
if ($list_data[$key]['alipay_user']) {
$list_data[$key]['alipay_user'] = '&nbsp;'.$list_data[$key]['alipay_user'];
}
$list_data[$key]['agreement_time'] = json_decode($list_data[$key]['agreement_time'],true); $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]['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']['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 H:i:s",$list_data[$key]['agreement_time']['end_time'])):($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'] = "");
//
// $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); $this->assign("listdata",$list_data);
@ -74,8 +108,8 @@ class CpJuheCompanyController extends ThinkController {
public function detail() { public function detail() {
$_REQUEST['id']?($request['id'] = $_REQUEST['id']):''; $_REQUEST['id']?($request['id'] = $_REQUEST['id']):'';
$url = M("kv")->field("value")->where(['key'=>"cp_company_detail_api"])->find();
$data = json_decode(curl_post("http://10.0.1.161:8095/index.php?g=Api&m=CpJuheCompany&a=detail",$request),true); $data = json_decode(curl_post($url['value'],$request),true);
$this->assign("data",$data); $this->assign("data",$data);
$this->display(); $this->display();

@ -132,7 +132,7 @@
<tr> <tr>
<td class="l noticeinfo">注册地址</td> <td class="l noticeinfo">注册地址</td>
<td class="r"> <td class="r">
<span class="form-required" style="line-height: 30px;">{$data['register_address']}%</span> <span class="form-required" style="line-height: 30px;">{$data['register_address']}</span>
</td> </td>
</tr> </tr>
@ -180,7 +180,7 @@
<span class="form-required" style="line-height: 30px;"><if condition="$data['is_service'] eq 0"><else/></if></span> <span class="form-required" style="line-height: 30px;"><if condition="$data['is_service'] eq 0"><else/></if></span>
<!-- <input readonly type="radio" name="is_service" style="margin-top: -2px;" autocomplete="off" placeholder="开始时间" value="1" <if condition="$data['is_service'] eq 1">checked</if>><span style="margin-top: 7px;display: inline-block;">是</span>--> <!-- <input readonly type="radio" name="is_service" style="margin-top: -2px;" autocomplete="off" placeholder="开始时间" value="1" <if condition="$data['is_service'] eq 1">checked</if>><span style="margin-top: 7px;display: inline-block;">是</span>-->
<!-- <input readonly type="radio" name="is_service" style="margin-top: -2px;margin-left: 30px" autocomplete="off" placeholder="结束时间" value="0" <if condition="$data['is_service'] eq 0">checked</if>><span>否</span>--> <!-- <input readonly type="radio" name="is_service" style="margin-top: -2px;margin-left: 30px" autocomplete="off" placeholder="结束时间" value="0" <if condition="$data['is_service'] eq 0">checked</if>><span>否</span>-->
<span class="form-required" style="line-height: 30px;">{$data['service_cost']}</span> <span class="form-required" style="line-height: 30px;">服务费:{$data['service_cost']}</span>
<!-- <input readonly type="text" name="service_cost" value="{$data['service_cost']}" onkeyup ="value=value.replace(/[^\d]/g,'')" style="margin-left: 30px">--> <!-- <input readonly type="text" name="service_cost" value="{$data['service_cost']}" onkeyup ="value=value.replace(/[^\d]/g,'')" style="margin-left: 30px">-->
&nbsp;&nbsp; &nbsp;&nbsp;
</td> </td>

@ -112,6 +112,9 @@
<th >是否有预付款</th> <th >是否有预付款</th>
<th >预付款金额</th> <th >预付款金额</th>
<th >是否签署合同</th> <th >是否签署合同</th>
<th >是否具有游戏资质</th>
<th >合同期限</th> <th >合同期限</th>
<th >生效时间</th> <th >生效时间</th>
<th >开票税点</th> <th >开票税点</th>
@ -157,11 +160,14 @@
<td rowspan="{$vo.rowspan}">{$vo.is_surplus|default="否"}</td> <td rowspan="{$vo.rowspan}">{$vo.is_surplus|default="否"}</td>
<td rowspan="{$vo.rowspan}">{$vo.before_amount|default="0"}</td> <td rowspan="{$vo.rowspan}">{$vo.before_amount|default="0"}</td>
<td rowspan="{$vo.rowspan}">{$vo.is_contract|default="------"}</td> <td rowspan="{$vo.rowspan}">{$vo.is_contract|default="------"}</td>
<td rowspan="{$vo.rowspan}">{$vo.is_qualifity|default="否"}</td>
<td rowspan="{$vo.rowspan}"> <td rowspan="{$vo.rowspan}">
<span class="form-required" style="line-height: 30px;">{$vo['agreement_time']['start_time']}</span>&nbsp;&nbsp;&nbsp;&nbsp; <span class="form-required" style="line-height: 30px;">{$vo['agreement_time']['start_time']}</span>
<span class="form-required" style="line-height: 30px;">{$vo['agreement_time']['end_time']|default="永久"}</span></td> <span class="form-required" style="line-height: 30px;">{$vo['agreement_time']['end_time']|default="永久"}</span></td>
<td rowspan="{$vo.rowspan}"> <td rowspan="{$vo.rowspan}">
<span class="form-required" style="line-height: 30px;">{$vo['balance_time']['start_time']}</span>&nbsp;&nbsp;&nbsp;&nbsp; <span class="form-required" style="line-height: 30px;">{$vo['balance_time']['start_time']}</span>
<span class="form-required" style="line-height: 30px;">{$vo['balance_time']['end_time']|default="永久"}</span> <span class="form-required" style="line-height: 30px;">{$vo['balance_time']['end_time']|default="永久"}</span>
</td> </td>
<td rowspan="{$vo.rowspan}">{$vo['tax_point']}%</td> <td rowspan="{$vo.rowspan}">{$vo['tax_point']}%</td>

@ -2157,7 +2157,7 @@ CREATE TABLE `tab_payment_member` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID', `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`real_name` varchar(255) DEFAULT '' COMMENT '真实姓名', `real_name` varchar(255) DEFAULT '' COMMENT '真实姓名',
`mobile` char(11) NOT NULL COMMENT '手机号码', `mobile` char(11) NOT NULL COMMENT '手机号码',
`last_login_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时间', `last_login_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时间',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `mobile` (`mobile`) KEY `mobile` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='打款登陆账号'; ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='打款登陆账号';
@ -2184,4 +2184,7 @@ ADD COLUMN `connection_address` longtext NULL COMMENT '联系地址' AFTER `chan
ALTER TABLE `sj_game_channel`.`sj_cptogether_company` ALTER TABLE `sj_game_channel`.`sj_cptogether_company`
ADD COLUMN `is_received` tinyint(2) NULL DEFAULT 0 COMMENT '是否为收款方' AFTER `connection_address`; ADD COLUMN `is_received` tinyint(2) NULL DEFAULT 0 COMMENT '是否为收款方' AFTER `connection_address`;
INSERT INTO `sys_kv`(`id`, `key`, `value`, `type`, `remark`) VALUES (4, 'cp_company_api', 'http://10.0.1.161:8095/index.php?g=Api&m=CpJuheCompany&a=index', 'string', '聚合公司网址') INSERT INTO `sys_kv`(`id`, `key`, `value`, `type`, `remark`) VALUES (4, 'cp_company_api', 'http://10.0.1.161:8095/index.php?g=Api&m=CpJuheCompany&a=index', 'string', '聚合公司网址')
ALTER TABLE `sj_game_channel`.`sj_cptogether_company`
ADD COLUMN `is_qualifity` tinyint(2) NULL COMMENT '是否具有游戏资质 0 否 1 是' AFTER `is_received`;
Loading…
Cancel
Save