|
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Web;
|
|
|
use App\Models\Recruit;
|
|
|
use App\Models\Recuperate;
|
|
|
use App\Models\RecuperateCategory;
|
|
|
+use App\Models\ShortUrl;
|
|
|
use App\Services\Content\LinkService;
|
|
|
use App\Services\HomeService;
|
|
|
use App\Services\Company\JobsService;
|
|
@@ -77,32 +78,32 @@ class HomeController extends WebBaseController
|
|
|
* @param $articleService
|
|
|
* @param $subsiteService
|
|
|
*/
|
|
|
- public function __construct(LinkService $LinkService, HomeService $homeService, JobsService $jobsService, CategoryService $categoryService, CompanyDownResumeService $companyDownResumeService, SearchService $searchService, ResumeService $resumeService, CompanyService $companyService, JobfairService $jobfairService, NoticeServer $noticeServer, ArticleService $articleService, SubsiteService $subsiteService, PersonalJobsApplyRepository $personalJobsApplyRepository, ViewJobRepository $viewJobRepository, PmsRepository $pmsRepository, ResumeRepository $resumeRepository, CompanyInterviewRepository $companyInterviewRepository, companyFavoriteRepository $companyFavoriteRepository, ViewResumeRepository $viewResumeRepository, TaskLogRepository $taskLogRepository, PersonFocusComRepository $personFocusComRepository, MemberSetmealRepository $memberSetmealRepository, JobsRepository $jobsRepository,PolicyService $policyService)
|
|
|
+ public function __construct(LinkService $LinkService, HomeService $homeService, JobsService $jobsService, CategoryService $categoryService, CompanyDownResumeService $companyDownResumeService, SearchService $searchService, ResumeService $resumeService, CompanyService $companyService, JobfairService $jobfairService, NoticeServer $noticeServer, ArticleService $articleService, SubsiteService $subsiteService, PersonalJobsApplyRepository $personalJobsApplyRepository, ViewJobRepository $viewJobRepository, PmsRepository $pmsRepository, ResumeRepository $resumeRepository, CompanyInterviewRepository $companyInterviewRepository, companyFavoriteRepository $companyFavoriteRepository, ViewResumeRepository $viewResumeRepository, TaskLogRepository $taskLogRepository, PersonFocusComRepository $personFocusComRepository, MemberSetmealRepository $memberSetmealRepository, JobsRepository $jobsRepository, PolicyService $policyService)
|
|
|
{
|
|
|
- $this->LinkService = $LinkService;
|
|
|
- $this->homeService = $homeService;
|
|
|
- $this->jobsService = $jobsService;
|
|
|
- $this->categoryService = $categoryService;
|
|
|
- $this->companyDownResumeService = $companyDownResumeService;
|
|
|
- $this->searchService = $searchService;
|
|
|
- $this->resumeService = $resumeService;
|
|
|
- $this->companyService = $companyService;
|
|
|
- $this->jobfairService = $jobfairService;
|
|
|
- $this->noticeServer = $noticeServer;
|
|
|
- $this->articleService = $articleService;
|
|
|
- $this->subsiteService = $subsiteService;
|
|
|
+ $this->LinkService = $LinkService;
|
|
|
+ $this->homeService = $homeService;
|
|
|
+ $this->jobsService = $jobsService;
|
|
|
+ $this->categoryService = $categoryService;
|
|
|
+ $this->companyDownResumeService = $companyDownResumeService;
|
|
|
+ $this->searchService = $searchService;
|
|
|
+ $this->resumeService = $resumeService;
|
|
|
+ $this->companyService = $companyService;
|
|
|
+ $this->jobfairService = $jobfairService;
|
|
|
+ $this->noticeServer = $noticeServer;
|
|
|
+ $this->articleService = $articleService;
|
|
|
+ $this->subsiteService = $subsiteService;
|
|
|
$this->personalJobsApplyRepository = $personalJobsApplyRepository;
|
|
|
- $this->viewJobRepository = $viewJobRepository;
|
|
|
- $this->pmsRepository = $pmsRepository;
|
|
|
- $this->resumeRepository = $resumeRepository;
|
|
|
- $this->companyInterviewRepository = $companyInterviewRepository;
|
|
|
- $this->companyFavoriteRepository = $companyFavoriteRepository;
|
|
|
- $this->viewResumeRepository = $viewResumeRepository;
|
|
|
- $this->taskLogRepository = $taskLogRepository;
|
|
|
- $this->personFocusComRepository = $personFocusComRepository;
|
|
|
- $this->memberSetmealRepository = $memberSetmealRepository;
|
|
|
- $this->jobsRepository = $jobsRepository;
|
|
|
- $this->policyService = $policyService;
|
|
|
+ $this->viewJobRepository = $viewJobRepository;
|
|
|
+ $this->pmsRepository = $pmsRepository;
|
|
|
+ $this->resumeRepository = $resumeRepository;
|
|
|
+ $this->companyInterviewRepository = $companyInterviewRepository;
|
|
|
+ $this->companyFavoriteRepository = $companyFavoriteRepository;
|
|
|
+ $this->viewResumeRepository = $viewResumeRepository;
|
|
|
+ $this->taskLogRepository = $taskLogRepository;
|
|
|
+ $this->personFocusComRepository = $personFocusComRepository;
|
|
|
+ $this->memberSetmealRepository = $memberSetmealRepository;
|
|
|
+ $this->jobsRepository = $jobsRepository;
|
|
|
+ $this->policyService = $policyService;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -113,12 +114,12 @@ class HomeController extends WebBaseController
|
|
|
*/
|
|
|
public function index()
|
|
|
{
|
|
|
- $filter_data = array(
|
|
|
- 'AIX_indexfocus' => 6, //首页轮播广告
|
|
|
- 'AIX_indextopimg' => 6, //首页上方横幅
|
|
|
+ $filter_data = [
|
|
|
+ 'AIX_indexfocus' => 6, //首页轮播广告
|
|
|
+ 'AIX_indextopimg' => 6, //首页上方横幅
|
|
|
'AIX_index_center' => 8, //首页中部横幅
|
|
|
|
|
|
- 'index_famous' => 8, //首页中部名企推荐广告 - 六栏格子广告
|
|
|
+ 'index_famous' => 8, //首页中部名企推荐广告 - 六栏格子广告
|
|
|
'index_famous1' => 8, //首页中部横幅
|
|
|
'index_famous2' => 8, //首页两栏广告
|
|
|
'index_famous3' => 8, //首页三栏广告
|
|
@@ -126,8 +127,8 @@ class HomeController extends WebBaseController
|
|
|
'index_famous5' => 8, //首页浮窗广告
|
|
|
'index_famous6' => 8, //首页浮窗广告
|
|
|
'index_famous7' => 8, //首页浮窗广告
|
|
|
- );
|
|
|
- $ads = $this->homeService->getAds($filter_data);
|
|
|
+ ];
|
|
|
+ $ads = $this->homeService->getAds($filter_data);
|
|
|
|
|
|
// $seatmeal_companies = [];
|
|
|
// $seatmeal_arr = array(
|
|
@@ -145,7 +146,7 @@ class HomeController extends WebBaseController
|
|
|
|
|
|
|
|
|
$links_logo = $this->getLinks('AIX_index', '2', '18');
|
|
|
- $links_url = $this->getLinks('AIX_index', '1', '50');
|
|
|
+ $links_url = $this->getLinks('AIX_index', '1', '50');
|
|
|
if ($user = auth('web-member')->user()) {
|
|
|
$userInfo = $this->homeService->getUserInfo($user);
|
|
|
} elseif ($user = auth('web-company')->user()) {
|
|
@@ -155,21 +156,21 @@ class HomeController extends WebBaseController
|
|
|
}
|
|
|
$time = $this->homeService->getTime();
|
|
|
//公告公示
|
|
|
- $notice_filter = array(
|
|
|
+ $notice_filter = [
|
|
|
'titlelen' => 14,
|
|
|
- 'dot' => '...',
|
|
|
- 'size' => 9
|
|
|
- );
|
|
|
- $notices = $this->noticeServer->getNotices($notice_filter);
|
|
|
+ 'dot' => '...',
|
|
|
+ 'size' => 9,
|
|
|
+ ];
|
|
|
+ $notices = $this->noticeServer->getNotices($notice_filter);
|
|
|
|
|
|
//获取工作动态、校园招聘、重要通知的数据
|
|
|
- $article_map = array(
|
|
|
- 'type_id' => array(48,2, 3, 30, 31, 13, 14, 15, 16, 17, 18, 19, 25, 26, 27, 28, 29),
|
|
|
- 'limit' => 12,
|
|
|
+ $article_map = [
|
|
|
+ 'type_id' => [48, 2, 3, 30, 31, 13, 14, 15, 16, 17, 18, 19, 25, 26, 27, 28, 29],
|
|
|
+ 'limit' => 12,
|
|
|
'titlelen' => 25,
|
|
|
- 'dot' => '...'
|
|
|
- );
|
|
|
- $articles = $this->articleService->getArticleCache($article_map, 'home');
|
|
|
+ 'dot' => '...',
|
|
|
+ ];
|
|
|
+ $articles = $this->articleService->getArticleCache($article_map, 'home');
|
|
|
|
|
|
$articles_img = $this->articleService->getArticlesByType(3, 5);
|
|
|
|
|
@@ -217,37 +218,37 @@ class HomeController extends WebBaseController
|
|
|
//是否已签到
|
|
|
$isSign = $this->taskLogRepository->getTaskLogCount($user->id, 18, $user->utype);
|
|
|
//待处理简历
|
|
|
- $condition1 = [
|
|
|
- 'is_reply' => 0,
|
|
|
+ $condition1 = [
|
|
|
+ 'is_reply' => 0,
|
|
|
'company_id' => $this->getUser()->id,
|
|
|
];
|
|
|
$resumesCount = $this->personalJobsApplyRepository->resumesCount($condition1);
|
|
|
//谁看过我
|
|
|
|
|
|
$map['company_id'] = auth('web-company')->user()->id;
|
|
|
- $concern = $this->personFocusComRepository->getFansCount($map);
|
|
|
+ $concern = $this->personFocusComRepository->getFansCount($map);
|
|
|
|
|
|
//我的消息
|
|
|
$where['msgtouid'] = $this->getUser()->id;
|
|
|
- $where['utype'] = $this->getUser()->utype;
|
|
|
- $where['new'] = 1;
|
|
|
+ $where['utype'] = $this->getUser()->utype;
|
|
|
+ $where['new'] = 1;
|
|
|
|
|
|
$pms = $this->pmsRepository->getPmsCount($where);
|
|
|
|
|
|
- $company_setmeal = $this->memberSetmealRepository->getSetmealByUid($user->id, $user->utype);//会员套餐
|
|
|
- $jobs_meanwhile = $company_setmeal->jobs_meanwhile;
|
|
|
+ $company_setmeal = $this->memberSetmealRepository->getSetmealByUid($user->id, $user->utype);//会员套餐
|
|
|
+ $jobs_meanwhile = $company_setmeal->jobs_meanwhile;
|
|
|
$jobsCountwhere[] = ['company_id', '=', $user->id];
|
|
|
- $jobsCount = $this->jobsRepository->getJobCount($jobsCountwhere);
|
|
|
+ $jobsCount = $this->jobsRepository->getJobCount($jobsCountwhere);
|
|
|
} else {
|
|
|
//是否已签到
|
|
|
$isSign = $this->taskLogRepository->getTaskLogCount($user->id, 3, $user->utype);
|
|
|
$resume = $this->resumeRepository->getPersonInfo($this->getUser()->id);
|
|
|
if ($resume) {
|
|
|
- $interview = $this->companyInterviewRepository->getInterview($this->getUser()->id, getJobsStatus());
|
|
|
+ $interview = $this->companyInterviewRepository->getInterview($this->getUser()->id, getJobsStatus());
|
|
|
$viewResume = $this->companyFavoriteRepository->getAttentionByResume($resume->id);
|
|
|
- $resumeid = $resume->id;
|
|
|
+ $resumeid = $resume->id;
|
|
|
} else {
|
|
|
- $interview = 0;
|
|
|
+ $interview = 0;
|
|
|
$viewResume = 0;
|
|
|
}
|
|
|
$mypms = $this->pmsRepository->getPmsCount(['msgtype' => 1, 'new' => 1, 'utype' => 2, 'msgtouid' => $this->getUser()->id]);
|
|
@@ -255,61 +256,61 @@ class HomeController extends WebBaseController
|
|
|
}
|
|
|
|
|
|
//人才新闻
|
|
|
- $ad_pic_where1[] = array('type_id', '=',3);
|
|
|
- $ad_pic_where1[] = array('small_img', '<>','');
|
|
|
- $ad_pic1 = Article::where($ad_pic_where1)->orderBy('list_order', 'asc')->orderBy('id', 'desc')->limit(1)->get();
|
|
|
+ $ad_pic_where1[] = ['type_id', '=', 3];
|
|
|
+ $ad_pic_where1[] = ['small_img', '<>', ''];
|
|
|
+ $ad_pic1 = Article::where($ad_pic_where1)->orderBy('list_order', 'asc')->orderBy('id', 'desc')->limit(1)->get();
|
|
|
|
|
|
//人才疗休养活动
|
|
|
- $ad_pic_where2[] =array('r_c_id', '!=',0);
|
|
|
- $ad_pic_where2[] =array('deleted_at', '=',null);
|
|
|
- $ad_pic_where2[] = array('small_img', '<>','');
|
|
|
- $ad_pic2 = Recuperate::where($ad_pic_where2)->orderBy('list_order', 'asc')->orderBy('id', 'desc')->limit(4)->get();
|
|
|
+ $ad_pic_where2[] = ['r_c_id', '!=', 0];
|
|
|
+ $ad_pic_where2[] = ['deleted_at', '=', null];
|
|
|
+ $ad_pic_where2[] = ['small_img', '<>', ''];
|
|
|
+ $ad_pic2 = Recuperate::where($ad_pic_where2)->orderBy('list_order', 'asc')->orderBy('id', 'desc')->limit(4)->get();
|
|
|
//人才疗休养分类
|
|
|
- $Recuperatecategory_arr=RecuperateCategory::where('deleted_at',null)->select('id','name')->get()->toArray();
|
|
|
+ $Recuperatecategory_arr = RecuperateCategory::where('deleted_at', null)->select('id', 'name')->get()->toArray();
|
|
|
|
|
|
//人才新闻
|
|
|
- $ad_pic_where3[] = array('type_id', '=',51);
|
|
|
- $ad_pic_where3[] = array('small_img', '<>','');
|
|
|
- $ad_pic3 = Article::where($ad_pic_where3)->orderBy('list_order', 'asc')->orderBy('id', 'desc')->limit(4)->get();
|
|
|
+ $ad_pic_where3[] = ['type_id', '=', 51];
|
|
|
+ $ad_pic_where3[] = ['small_img', '<>', ''];
|
|
|
+ $ad_pic3 = Article::where($ad_pic_where3)->orderBy('list_order', 'asc')->orderBy('id', 'desc')->limit(4)->get();
|
|
|
|
|
|
- $rcinfos=$this->policyService->getRcInfosByIndex();
|
|
|
+ $rcinfos = $this->policyService->getRcInfosByIndex();
|
|
|
|
|
|
//招考系统
|
|
|
- $recruit = Recruit::where([['status','=',1]])->orderBy('ordid','desc')->orderBy('updated_at','desc')->limit(4)->get();
|
|
|
+ $recruit = Recruit::where([['status', '=', 1]])->orderBy('ordid', 'desc')->orderBy('updated_at', 'desc')->limit(4)->get();
|
|
|
if (!$recruit->isEmpty()) {
|
|
|
foreach ($recruit as $k => $v) {
|
|
|
$recruit[$k] = Recruit::parse_index($v);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $return_data = array(
|
|
|
- 'links_logo' => $links_logo,
|
|
|
- 'links_url' => $links_url,
|
|
|
- 'ads' => $ads,
|
|
|
- 'userInfo' => $userInfo,
|
|
|
- 'time' => $time,
|
|
|
- 'notices' => $notices,
|
|
|
- 'articles' => $articles,
|
|
|
+ $return_data = [
|
|
|
+ 'links_logo' => $links_logo,
|
|
|
+ 'links_url' => $links_url,
|
|
|
+ 'ads' => $ads,
|
|
|
+ 'userInfo' => $userInfo,
|
|
|
+ 'time' => $time,
|
|
|
+ 'notices' => $notices,
|
|
|
+ 'articles' => $articles,
|
|
|
//'seatmeal_companies' => $seatmeal_companies,
|
|
|
- 'am_pm' => $am_pm,
|
|
|
- 'isSign' => $isSign,
|
|
|
- 'jobs_meanwhile' => $jobs_meanwhile,
|
|
|
- 'jobsCount' => $jobsCount,
|
|
|
- 'resumesCount' => $resumesCount,
|
|
|
- 'concern' => $concern,
|
|
|
- 'pms' => $pms,
|
|
|
- 'resumeid' => $resumeid,
|
|
|
- 'interview' => $interview,
|
|
|
- 'viewResume' => $viewResume,
|
|
|
- 'mypms' => $mypms,
|
|
|
- 'articles_img' => $articles_img,
|
|
|
- 'ad_pic1' => $ad_pic1,
|
|
|
- 'ad_pic2' => $ad_pic2,
|
|
|
- 'ad_pic3' => $ad_pic3,
|
|
|
- 'rcinfos' => $rcinfos,
|
|
|
+ 'am_pm' => $am_pm,
|
|
|
+ 'isSign' => $isSign,
|
|
|
+ 'jobs_meanwhile' => $jobs_meanwhile,
|
|
|
+ 'jobsCount' => $jobsCount,
|
|
|
+ 'resumesCount' => $resumesCount,
|
|
|
+ 'concern' => $concern,
|
|
|
+ 'pms' => $pms,
|
|
|
+ 'resumeid' => $resumeid,
|
|
|
+ 'interview' => $interview,
|
|
|
+ 'viewResume' => $viewResume,
|
|
|
+ 'mypms' => $mypms,
|
|
|
+ 'articles_img' => $articles_img,
|
|
|
+ 'ad_pic1' => $ad_pic1,
|
|
|
+ 'ad_pic2' => $ad_pic2,
|
|
|
+ 'ad_pic3' => $ad_pic3,
|
|
|
+ 'rcinfos' => $rcinfos,
|
|
|
'recuperate_category_arr' => $Recuperatecategory_arr,
|
|
|
- 'recruit' => $recruit,
|
|
|
- );
|
|
|
+ 'recruit' => $recruit,
|
|
|
+ ];
|
|
|
//获取分站模板信息
|
|
|
if (get_subsite_id() > 0) {
|
|
|
$tpl_name = $this->subsiteService->getSubsiteTpl(get_subsite_id());
|
|
@@ -336,18 +337,18 @@ class HomeController extends WebBaseController
|
|
|
|
|
|
public function getLinks($alias, $type = '', $limit = 18)
|
|
|
{
|
|
|
- $where = array(
|
|
|
+ $where = [
|
|
|
'alias' => $alias,
|
|
|
- 'type' => $type,
|
|
|
- 'limit' => $limit
|
|
|
- );
|
|
|
+ 'type' => $type,
|
|
|
+ 'limit' => $limit,
|
|
|
+ ];
|
|
|
$links = $this->LinkService->getLinks($where);
|
|
|
return $links;
|
|
|
}
|
|
|
|
|
|
public function getUser()
|
|
|
{
|
|
|
- $user = array();
|
|
|
+ $user = [];
|
|
|
if (auth('web-member')->check()) {
|
|
|
$user = auth('web-member')->user();
|
|
|
} elseif (auth('web-company')->check()) {
|
|
@@ -364,35 +365,49 @@ class HomeController extends WebBaseController
|
|
|
}
|
|
|
|
|
|
/*优秀人才申请*/
|
|
|
- public function declare(Request $request){
|
|
|
+ public function declare(Request $request)
|
|
|
+ {
|
|
|
|
|
|
- if($this->getUser()){
|
|
|
- if(!$user=auth('web-company')->user()){
|
|
|
- return $this->showMessage('个人未开放申请优秀人才申报系统功能!', route('home'), true,'','1');
|
|
|
+ if ($this->getUser()) {
|
|
|
+ if (!$user = auth('web-company')->user()) {
|
|
|
+ return $this->showMessage('个人未开放申请优秀人才申报系统功能!', route('home'), true, '', '1');
|
|
|
}
|
|
|
- $url='http://rc.jucai.gov.cn/api/jucaiInterface/login';
|
|
|
- $data=array(
|
|
|
- 'username'=>$user->username,
|
|
|
- 'userType'=>1,
|
|
|
- 'timestr'=>time(),
|
|
|
-/* 'name'=>$user->companyname,
|
|
|
- 'idCard'=>$user->organization_code,
|
|
|
- 'type'=>1*/
|
|
|
+ $url = 'http://rc.jucai.gov.cn/api/jucaiInterface/login';
|
|
|
+ $data = [
|
|
|
+ 'username' => $user->username,
|
|
|
+ 'userType' => 1,
|
|
|
+ 'timestr' => time(),
|
|
|
+ /* 'name'=>$user->companyname,
|
|
|
+ 'idCard'=>$user->organization_code,
|
|
|
+ 'type'=>1*/
|
|
|
|
|
|
- );
|
|
|
+ ];
|
|
|
|
|
|
ksort($data);
|
|
|
- $sign_arr=array_merge($data,array( 'key'=>'rsKVyec52fqEKpk4RRD2TU8fKvPxt6ombKg0qSq1velPQtBHVi'));
|
|
|
- $sign=strtoupper(md5(http_build_query($sign_arr)));
|
|
|
- $data['sign']=$sign;
|
|
|
- $data['name']=htmlspecialchars($user->companyname);
|
|
|
- $data['idCard']=$user->organization_code;
|
|
|
- $data['type']=1;
|
|
|
- return redirect()->away('http://rc.jucai.gov.cn/api/jucaiInterface/login?timestr='.time().'&userType=1&username='.$user->username.'&sign='.$sign.'&name='.$user->companyname.'&idCard='.$user->organization_code.'&type=1&id='.$user->id);
|
|
|
- }else{
|
|
|
+ $sign_arr = array_merge($data, ['key' => 'rsKVyec52fqEKpk4RRD2TU8fKvPxt6ombKg0qSq1velPQtBHVi']);
|
|
|
+ $sign = strtoupper(md5(http_build_query($sign_arr)));
|
|
|
+ $data['sign'] = $sign;
|
|
|
+ $data['name'] = htmlspecialchars($user->companyname);
|
|
|
+ $data['idCard'] = $user->organization_code;
|
|
|
+ $data['type'] = 1;
|
|
|
+ return redirect()->away('http://rc.jucai.gov.cn/api/jucaiInterface/login?timestr=' . time() . '&userType=1&username=' . $user->username . '&sign=' . $sign . '&name=' . $user->companyname . '&idCard=' . $user->organization_code . '&type=1&id=' . $user->id);
|
|
|
+ } else {
|
|
|
return redirect()->away('http://rc.jucai.gov.cn/login');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 短链接生成
|
|
|
+ */
|
|
|
+ public function short_url($url)
|
|
|
+ {
|
|
|
+ $short_url = ShortUrl::where('key', $url)->first();
|
|
|
+ if (empty($short_url)) {
|
|
|
+ return redirect(route('home'));
|
|
|
+ } else {
|
|
|
+ return redirect($short_url['url']);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|