优化线下打款确认

master
chenzhi 4 years ago
parent 9234919180
commit 31af865a9f

@ -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{

Loading…
Cancel
Save