$datearr[0], 'end_time' => $datearr[1]]); $marketingContract = new MarketingContract(); $costProject = new CostProject(); $financialInvoice = new FinancialInvoice(); $financialRefund = new FinancialRefund(); $financialSettlement = new FinancialSettlement(); $financialBidMargin = new FinancialBidMargin(); $financialBidMarginRecovery = new FinancialBidMarginRecovery(); $financialPerformanceMoneyApply = new FinancialPerformanceMoneyApply(); $financialPerformanceMoneyRecovery = new FinancialPerformanceMoneyRecovery(); $financialUsingFunds = new FinancialUsingFunds(); $financialBorrowMoney = new FinancialBorrowMoney(); $financialRepayment = new FinancialRepayment(); $where_1 = [ ['review_status', '=', 1], ['contract_type', '=', 0], ['status', '=', 0] ]; $total_apply_amount = $marketingContract->statistics_count($where_1, $time, 'sum', ''); $apply_amount_value = $marketingContract->statistics_count($where_1, $time, 'group', 'create_time'); $data[] = [ 'title' => '待立项项目', 'desc' => '', 'total_money' => $total_apply_amount, 'value' => $apply_amount_value['y'] ?? 0, 'type' => 1, ]; $total_apply_amount = $marketingContract->statistics_count(['status' => 1], $time, 'sum', ''); $apply_amount_value = $marketingContract->statistics_count(['status' => 1], $time, 'group', 'create_time'); $data[] = [ 'title' => '已立项项目', 'desc' => '', 'total_money' => $total_apply_amount, 'value' => $apply_amount_value['y'] ?? 0, 'type' => 1, ]; //开票金额 $total_apply_amount = $financialInvoice->ContractFinancialMoney([], $time, 'sum', '', 'apply_amount'); $apply_amount_value = $financialInvoice->ContractFinancialMoney([], $time, 'group', 'create_time', 'apply_amount'); $data[] = [ 'title' => '开票金额', 'desc' => '', 'total_money' => $total_apply_amount, 'value' => $apply_amount_value['y'] ?? 0, 'type' => 1, ]; //回款金额 $total_amount = $financialRefund->statistics([], $time, 'sum', '', 'amount'); $amount_value = $financialRefund->statistics($where, $time, 'group', 'create_time', 'amount'); $data[] = [ 'title' => '回款金额', 'desc' => '', 'total_money' => $total_amount, 'value' => $amount_value['y'] ?? 0, 'type' => 1, ]; //结算金额 $total_amount = $financialSettlement->statistics([], $time, 'sum', '', 'amount'); $amount_value = $financialSettlement->statistics([], $time, 'group', 'create_time', 'amount'); $data[] = [ 'title' => '结算金额', 'desc' => '', 'total_money' => $total_amount, 'value' => $amount_value['y'] ?? 0, 'type' => 1, ]; //投资金额 $total_apply_amount = $costProject->statistics([], $time, 'sum', '', 'invest'); $apply_amount_value = $costProject->statistics([], $time, 'group', 'create_time', 'invest'); $data[] = [ 'title' => '投资金额', 'desc' => '', 'total_money' => $total_apply_amount, 'value' => $apply_amount_value['y'] ?? 0, 'type' => 1, ]; //签约金额 $total_apply_amount = $marketingContract->statistics([], $time, 'sum', '', 'signed_amount'); $apply_amount_value = $marketingContract->statistics([], $time, 'group', 'create_time', 'signed_amount'); $data[] = [ 'title' => '签约金额', 'desc' => '', 'total_money' => $total_apply_amount, 'value' => $apply_amount_value['y'] ?? 0, 'type' => 1, ]; //保证金申请 $total_bid_margin = $financialBidMargin->statistics([], $time, 'sum', '', 'bid_margin'); $bid_margin_value = $financialBidMargin->statistics([], $time, 'group', 'create_time', 'bid_margin'); $data[] = [ 'title' => '保证金申请', 'desc' => '', 'total_money' => $total_bid_margin, 'value' => $bid_margin_value['y']??[], 'type' => 1, ]; //保证金回收 $total_pay_amount = $financialBidMarginRecovery->statistics([], $time, 'sum', '', 'pay_amount'); $pay_amount_value = $financialBidMarginRecovery->statistics([], $time, 'group', 'create_time', 'pay_amount'); $data[] = [ 'title' => '保证金回收', 'desc' => '', 'total_money' => $total_pay_amount, 'value' => $pay_amount_value['y']??[], 'type' => 1, ]; //履约申请 $apply_amount = $financialPerformanceMoneyApply->statistics([], $time, 'sum', '', 'apply_amount'); $apply_amount_value = $financialPerformanceMoneyApply->statistics([], $time, 'group', 'create_time', 'apply_amount'); $data[] = [ 'title' => '履约申请', 'desc' => '', 'total_money' => $apply_amount, 'value' => $apply_amount_value['y']??[], 'type' => 1, ]; //履约回收 $recovery_amount = $financialPerformanceMoneyRecovery->statistics([], $time, 'sum', '', 'recovery_amount'); $recovery_amount_value = $financialPerformanceMoneyRecovery->statistics([], $time, 'group', 'create_time', 'recovery_amount'); $data[] = [ 'title' => '履约回收', 'desc' => '', 'total_money' => $recovery_amount, 'value' => $recovery_amount_value['y']??[], 'type' => 1, ]; //用款 $has_pay_amount = $financialUsingFunds->statistics([], $time, 'sum', '', 'has_pay_amount'); $has_pay_amount_value = $financialUsingFunds->statistics([], $time, 'group', 'create_time', 'has_pay_amount'); $data[] = [ 'title' => '用款', 'desc' => '', 'total_money' => $has_pay_amount, 'value' => $has_pay_amount_value['y']??[], 'type' => 1, ]; //借款 $amount = $financialBorrowMoney->statistics([], $time, 'sum', '', 'amount'); $amount_value = $financialBorrowMoney->statistics([], $time, 'group', 'create_time', 'amount'); $data[] = [ 'title' => '借款', 'desc' => '', 'total_money' => $amount, 'value' => $amount_value['y']??[], 'type' => 1, ]; //还款 $amount = $financialRepayment->statistics([], $time, 'sum', '', 'amount'); $amount_value = $financialRepayment->statistics([], $time, 'group', 'create_time', 'amount'); $data[] = [ 'title' => '还款', 'desc' => '', 'total_money' => $amount, 'value' => $amount_value['y']??[], 'type' => 1, ]; return $data; } }