companyRepository = $companyRepository; $this->categoryRepository = $categoryRepository; } //获取指定条件的企业数量 public function getCompanyNums($where) { $time_condition = []; if (array_has($where, 'time_condition')) { $time_condition = $where['time_condition']; unset($where['time_condition']); } return $this->companyRepository->getCompanyNumByTime($where, $time_condition); } public function getCategories($filter_data = array()) { $list = array(); if ($filter_data) { $cates = $this->categoryRepository->getCategories(); if ($cates) { foreach ($cates as $key => $val) { if ($key == 'AIX_wage') { foreach ($val as $k => $v) { if (config('aix.system.site_other.site_other.site_salary') == 1) { $cates[$key][$k]['demand'] = $v['k_demand']; } else { $cates[$key][$k]['demand'] = $v['c_demand']; } } } } } foreach ($filter_data as $k => $v) { if (array_key_exists($k, $cates)) { $list[$k] = array_slice($cates[$k], 0, 3); if ($v) { $list[$k] = array_slice($cates[$k], 0, $v, true); } else { $list[$k] = $cates[$k]; } } else { $list[$k] = array(); } } } return $list; } public function getCompanyNumsGroup($where, $fields, $group_by) { $rst = $this->companyRepository->getCompanyNumsByGroup($where, $fields, $group_by); return $rst->toArray(); } }