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

优化个人结算
master
陈志 4 years ago committed by Gogs
commit 053d1de648

@ -114,12 +114,16 @@ class CompanyStatementOfflineController extends ThinkController
//获取所有的母单id
$companyStatementInfo = M("company_statement_info","tab_");
$statementPool = $companyStatementInfo->where("id in ($ids) and pay_status <> 1")->field("pool_id,count(id) count")->group("pool_id")->select();
$poolInfo = [];
$yPoolInfo = [];
foreach ($statementPool as $k => $v) {
$poolInfo[$v['pool_id']] = $v['count'];
$yPoolInfo[$v['pool_id']] = $v['count'];
}
unset($statementPool);
//获取母单未支付完成订单
$poolIds = implode(",",array_keys($yPoolInfo));
$poolInfo = $companyStatementInfo->where("pool_id in ($poolIds) and pay_status <> 1")->field("pool_id,count(id) count")->group("pool_id")->select();
//修改info
$saveData = [
"pay_type"=>3,
@ -128,14 +132,10 @@ class CompanyStatementOfflineController extends ThinkController
];
$ires = $companyStatementInfo->where("id in ($ids)")->save($saveData);
//获取母单未支付完成订单
$poolIds = implode(",",array_keys($poolInfo));
$poolInfo = $companyStatementInfo->where("pool_id in ($poolIds) and pay_status <> 1")->field("pool_id,count(id) count")->group("pool_id")->select();
//全部就打款成功,否则打款中
$companyStatementPool = M("company_statement_pool","tab_");
foreach ($poolInfo as $k => $v) {
if($v['count'] == $poolInfo[$v['pool_id']]){
if($v['count'] == $yPoolInfo[$v['pool_id']]){
//打款成功
$this->setOneVerifyStatus(4,"payment",$v['pool_id']);
}else{

@ -1196,6 +1196,7 @@ class CompanyStatementSetController extends Controller {
}
//聚合未结算数据
$lsres = $LackStatement->where("company_id='{$k}' and is_pool = 0")->select();
// dd($lsres);
$del_lack_ids = [];
if(count($lsres) > 0){
@ -1213,9 +1214,9 @@ class CompanyStatementSetController extends Controller {
foreach($t_statement_info as $p=>$info){
$statement_info[$info['account']] = $info['game_list'];
}
foreach($v['statement_info'] as $p=>&$info){
foreach($v['statement_info'] as $p=>$info){
if(isset($statement_info[$info['account']])){
$info['game_list'] = array_merge($statement_info[$info['account']],$info['game_list']);
$v['statement_info'][$p]['game_list'] = array_merge($statement_info[$info['account']],$v['statement_info'][$p]['game_list']);
unset($statement_info[$info['account']]);
}
}
@ -1226,7 +1227,6 @@ class CompanyStatementSetController extends Controller {
}
}
}
if($type == 2 && $v['statement_money'] == 0){
//补点不存
}else{

Loading…
Cancel
Save