[ 'today' => number_format($this->getBranchData(null, $today, 'branch_total')), 'yesterday' => number_format($this->getBranchData(null, $yesterday, 'branch_total')) ], // 新增分会数 'branch_add' => [ 'today' => number_format($this->getBranchData($today, null, 'branch_add')), 'yesterday' => number_format($this->getBranchData($yesterday, null, 'user_add')) ], // 新申请分会数 'branch_apply' => [ 'today' => number_format($this->getBranchApplyData($today, null, 'apply_total')), 'yesterday' => number_format($this->getBranchApplyData($yesterday, null, 'apply_total')) ], ]; return $data; } /** * 通过时间段查询用户数据 */ public function getDataByDate($days) { $data = []; foreach ($days as $day) { $data[] = [ 'day' => $day, 'new_num' => $this->getBranchData($day, null, 'branch_add'), ]; } return $data; } /** * 获取用户数据 */ private function getBranchData($startDate = null, $endDate = null, $type) { return (new BranchModel)->getBranchData($startDate, $endDate, $type); } private function getBranchApplyData($startDate = null, $endDate = null, $type){ return (new BranchApplyModel)->getApplyData($startDate, $endDate, $type); } /** * 获取订单数据 */ private function getDepositRefundData($startDate = null, $endDate = null, $type) { return (new DepositRefundModel())->getRefundData($startDate, $endDate, $type); } }