Merge branch 'feature/finance_statement_three' of wmtx/platform into release

master
陈志 4 years ago committed by Gogs
commit 80ca4fb372

@ -54,13 +54,13 @@ class CompanyStatementController extends ThinkController
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$time_start = strtotime($_REQUEST['time_start']);
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
$map["_string"] = "(statement_begin_time BETWEEN {$time_start} AND {$time_end}) OR (statement_end_time BETWEEN {$time_start} AND {$time_end})";
$map["_string"] = "( (statement_begin_time BETWEEN {$time_start} AND {$time_end}) OR (statement_end_time BETWEEN {$time_start} AND {$time_end}) )";
} elseif (isset($_REQUEST['time_start'])) {
$time_start = strtotime($_REQUEST['time_start']);
$map["_string"] = "(statement_begin_time >= {$time_start} ) OR (statement_end_time >= {$time_start})";
$map["_string"] = "( (statement_begin_time >= {$time_start} ) OR (statement_end_time >= {$time_start}) )";
} elseif (isset($_REQUEST['time_end'])) {
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
$map["_string"] = "(statement_begin_time <= {$time_end} ) OR (statement_end_time <= {$time_end})";
$map["_string"] = "( (statement_begin_time <= {$time_end} ) OR (statement_end_time <= {$time_end}) )";
}
if (isset($_REQUEST['time_start2']) && isset($_REQUEST['time_end2'])) {
@ -144,7 +144,7 @@ class CompanyStatementController extends ThinkController
if(isset($_REQUEST['confirm_status'])){
$map['confirm_status'] = $_REQUEST['confirm_status'];
}
// dd($map);
// $this->checkListOrCountAuthRestMap($map);//导出权限
//条件end
$data = M("company_statement","tab_")
@ -710,7 +710,7 @@ class CompanyStatementController extends ThinkController
}
foreach ($dbres as $k=>$v) {
if($v['verify_status'] != 1) continue;
if($v['verify_status'] == 1 || $v['verify_status'] == -2){
if($v['company_belong'] == 9){
//上游
$this->setDf($datas['up'],$v);
@ -722,6 +722,7 @@ class CompanyStatementController extends ThinkController
$this->setDf($datas['down'],$v);
}
}
}
$Pool = M("company_statement_pool","tab_");
$Statemen = M("company_statement","tab_");
@ -770,7 +771,7 @@ class CompanyStatementController extends ThinkController
M("company_lack_statement_info","tab_")->where("id in ({$v['del_lack_ids']})")->save(["is_pool"=>1]);
}
//修改结算单规则
$this->updatePoolVerifyStatus($v['statement_ids'],1,2,"pool",$v['statement_num']);
$this->updatePoolVerifyStatus($v['statement_ids'],2,"pool",$v['statement_num']);
}
$this->ajaxReturn(array(
'status' => 1,
@ -778,10 +779,10 @@ class CompanyStatementController extends ThinkController
));
}
//结算单规则
protected function updatePoolVerifyStatus($ids,$old_status,$change_status,$op_pre,$num){
protected function updatePoolVerifyStatus($ids,$change_status,$op_pre,$num){
$dbres = $this->DBModel->field("id,verify_status,verify_log")->where("id in ({$ids})")->select();
foreach($dbres as $k=>&$v){
if($v['verify_status'] != $old_status) continue;
// if($v['verify_status'] != $old_status) continue;
$v['verify_log'] = json_decode($v['verify_log'],true);
$v['verify_log'][$op_pre.'_user']=$this->admininfo["username"];
$v['verify_log'][$op_pre.'_time']=date("Y.m.d H:i:s");

@ -299,7 +299,7 @@ class CompanyStatementSetController extends Controller {
$promote_ratio = $cp[$add_data['company_id']]['channel_rate'] ?? 0;
$fax_ratio = $cp[$add_data['company_id']]['taxation_rate'] ?? 0;
//游戏统计
if(!isset($v['list'])){continue;}
if (isset($v['list'])) {
foreach ($v['list'] as $ke=>$va) {
$game =[];
$game['pay_amount'] =$va['pay_money'];
@ -325,7 +325,9 @@ class CompanyStatementSetController extends Controller {
$tratio1 = getGameCpRadio($game_id['id'], $va['pay_money'], true);
$tratio2 = getGameCpRadio($game_id['id'], $va['pay_money'], false);
$tratio = $tratio1-$tratio2;
if($tratio <= 0){continue;}
if ($tratio <= 0) {
continue;
}
}
}
if ($v['first_company_type'] == 1) {
@ -348,6 +350,9 @@ class CompanyStatementSetController extends Controller {
$game['statement_end_time']=$statement_end_time;
$game['statement_type']=0;
$add_data['statement_info'][] = $game;
}
}else{
$add_data['statement_info'] = [];
}
$add_data['platform_amount'] = $add_data['pay_amount'];
if($type < 2){
@ -411,9 +416,9 @@ class CompanyStatementSetController extends Controller {
//金额为0不补点
continue;
}
if($add_data['platform_amount'] == 0){
if($add_data['platform_amount'] == 0 && $add_data['statement_money'] == 0){
//全等于0表示没有流水小于0依旧要结算
return;
continue;
}
//添加
if($recount && $company_id !== false){
@ -494,10 +499,13 @@ class CompanyStatementSetController extends Controller {
];
//获取pc公司
$company = M("CompanyInfo","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("partner = '海南万盟天下科技有限公司'")->find();
$first_party_info = json_encode($company,JSON_UNESCAPED_UNICODE);
$company['partner'] = C("OFFICIEL_CHANNEL");
$second_party_info = json_encode($company,JSON_UNESCAPED_UNICODE);
$add_data=[
"first_party_info"=>json_encode($company,JSON_UNESCAPED_UNICODE),
"second_party_info"=>json_encode($company,JSON_UNESCAPED_UNICODE),
"pay_type"=>1,
"first_party_info"=>$first_party_info,
"second_party_info"=>$second_party_info,
"pay_type"=>2,
"withdraw_type"=>1,
"statement_begin_time"=>$begintime,
"statement_end_time"=>$endtime,
@ -509,7 +517,7 @@ class CompanyStatementSetController extends Controller {
"is_payment"=>2,
"statement_info"=>[],
"company_belong"=>0,
"company_name"=>'海南万盟天下科技有限公司',
"company_name"=>C("OFFICIEL_CHANNEL"),
"company_id"=>0,
"company_type"=>1
];

@ -475,8 +475,8 @@
}else if(id=="pool"){
var opname = "发起汇总";
var opurl = "{:U('pool')}";
var opst ="[审批通过]";
var status = [1];
var opst ="[审批通过,汇总撤销]";
var status = [1,-2];
}else if(id=="updateStatement"){
var opname = "重算金额";
var opurl = "{:U('updateStatement')}";
@ -510,7 +510,7 @@
return;
}
text = text.join(",");
console.log(text);
if(flag){
layer.confirm(opname+"仅会对"+opst+"的申请进行处理,选择中包含其他的状态的申请将被忽略,点击取消停止操作",{title:false}, function(index){
layer.close(index);

Binary file not shown.
Loading…
Cancel
Save