diff --git a/Application/Admin/Controller/SubCompanyStatementSetController.class.php b/Application/Admin/Controller/SubCompanyStatementSetController.class.php index 9fbce7e8c..d528b68a5 100644 --- a/Application/Admin/Controller/SubCompanyStatementSetController.class.php +++ b/Application/Admin/Controller/SubCompanyStatementSetController.class.php @@ -264,7 +264,30 @@ class SubCompanyStatementSetController extends Controller { $StatementDb = SM("CompanyStatement","tab_"); $statement_begin_time = date("Y.m.d",$begintime); $statement_end_time = date("Y.m.d",$endtime); + $MainStatementDb = M("CompanyStatement","tab_"); //主站结算单 + // dd($cpList); foreach($cpList as $k=>$v){ + // + $company_id = ($v['first_company_type'] == 1 ? $v['first_company_id'] : $v['second_company_id']); + $mainWhere = [ + "company_id" => $company_id, + "statement_begin_time"=>$begintime, + "statement_end_time"=>$endtime + ]; + $add_data = $MainStatementDb->where($mainWhere)->find(); + if(empty($add_data)) return false; //主站必须有数据 + $add_data['statement_info'] = json_decode($add_data['statement_info'],true); + if (isset($v['list'])) { + dd($v['list']); + dd($add_data); + }else{ + continue; + } + + + + + //条件ok $add_data=[]; $handleed_data = []; //1.获取甲乙方信息