|
@@ -61,50 +61,59 @@ class CompanyController extends WebBaseController
|
|
|
* @param $taskService
|
|
|
* @param $searchService
|
|
|
*/
|
|
|
- public function __construct(MemberLogRepository $memberLogRepository,CompanyService $companyService, TaskService $taskService, JobsService $jobsService, SmsService $smsService, EmailService $emailService, CompanyImgService $companyImgService, AuditReasonsRepository $auditReasonsRepository, SearchService $searchService, CompanyConsultantService $companyConsultantService,OrganizationService $organizationService,ServiceService $serviceService, DispensingService $dispensingService)
|
|
|
- {
|
|
|
- $this->companyService = $companyService;
|
|
|
- $this->companyImgService= $companyImgService;
|
|
|
- $this->auditReasonsRepository = $auditReasonsRepository;
|
|
|
- $this->emailService = $emailService;
|
|
|
- $this->smsService = $smsService;
|
|
|
- $this->jobsService = $jobsService;
|
|
|
- $this->taskService = $taskService;
|
|
|
- $this->searchService = $searchService;
|
|
|
- $this->recommend_limit = 10;
|
|
|
- $this->recommend_need_limit = 50;
|
|
|
+ public function __construct(MemberLogRepository $memberLogRepository, CompanyService $companyService, TaskService $taskService, JobsService $jobsService, SmsService $smsService, EmailService $emailService, CompanyImgService $companyImgService, AuditReasonsRepository $auditReasonsRepository, SearchService $searchService, CompanyConsultantService $companyConsultantService, OrganizationService $organizationService, ServiceService $serviceService, DispensingService $dispensingService)
|
|
|
+ {
|
|
|
+ $this->companyService = $companyService;
|
|
|
+ $this->companyImgService = $companyImgService;
|
|
|
+ $this->auditReasonsRepository = $auditReasonsRepository;
|
|
|
+ $this->emailService = $emailService;
|
|
|
+ $this->smsService = $smsService;
|
|
|
+ $this->jobsService = $jobsService;
|
|
|
+ $this->taskService = $taskService;
|
|
|
+ $this->searchService = $searchService;
|
|
|
+ $this->recommend_limit = 10;
|
|
|
+ $this->recommend_need_limit = 50;
|
|
|
$this->companyConsultantService = $companyConsultantService;
|
|
|
- $this->memberLogRepository=$memberLogRepository;
|
|
|
- $this->organizationService = $organizationService;
|
|
|
- $this->serviceService = $serviceService;
|
|
|
- $this->dispensingService = $dispensingService;
|
|
|
+ $this->memberLogRepository = $memberLogRepository;
|
|
|
+ $this->organizationService = $organizationService;
|
|
|
+ $this->serviceService = $serviceService;
|
|
|
+ $this->dispensingService = $dispensingService;
|
|
|
}
|
|
|
|
|
|
//会员中心
|
|
|
public function index()
|
|
|
{
|
|
|
- $user = auth('web-company')->user();
|
|
|
- $res = $this->companyService->index($user);
|
|
|
+ $user = auth('web-company')->user();
|
|
|
+ $res = $this->companyService->index($user);
|
|
|
$jobs_total = $this->jobsService->jobsTotal($user->id);
|
|
|
- if (Cache::has('recommend_click_resumes_'.get_subsite_id())) {
|
|
|
- Cache::forget('recommend_click_resumes_'.get_subsite_id());
|
|
|
+ if (Cache::has('recommend_click_resumes_' . get_subsite_id())) {
|
|
|
+ Cache::forget('recommend_click_resumes_' . get_subsite_id());
|
|
|
}
|
|
|
//用于匹配简历的职位
|
|
|
- $recommend_rst = $this->getRecommendResumes($this->recommend_limit); //获取推荐简历
|
|
|
+ $recommend_rst = $this->getRecommendResumes($this->recommend_limit); //获取推荐简历
|
|
|
$res['recommend_resumes'] = $recommend_rst['resumes'];
|
|
|
- $res['match_job'] = $recommend_rst['match_job'];
|
|
|
- $res['jobsCount'] = $jobs_total;
|
|
|
- $res['has_job'] = $recommend_rst['has_job'];
|
|
|
- $res['consultant'] = $this->companyConsultantService->getCompanyConsultant(auth('web-company')->user());
|
|
|
+ $res['match_job'] = $recommend_rst['match_job'];
|
|
|
+ $res['jobsCount'] = $jobs_total;
|
|
|
+ $res['has_job'] = $recommend_rst['has_job'];
|
|
|
+ $res['consultant'] = $this->companyConsultantService->getCompanyConsultant(auth('web-company')->user());
|
|
|
return view('app.company.company_index', $res);
|
|
|
}
|
|
|
|
|
|
+ //薪动餐饮
|
|
|
+ public function join(Request $request)
|
|
|
+ {
|
|
|
+ $status = $request->input('status');
|
|
|
+ $user = auth('web-company')->user();
|
|
|
+ DB::table('companys')->where('id', $user->id)->update(['is_restaurant' => $status]);
|
|
|
+ return response()->json(['code'=>0,'message'=>'操作成功']);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public function ajaxSms()
|
|
|
{
|
|
|
$res = $this->companyService->ajaxSms(auth('web-company')->user());
|
|
|
- if($res['id']){
|
|
|
- $html = view('app.company.ajax.ajax_sms',['info'=>$res['message']])->render();
|
|
|
+ if ($res['id']) {
|
|
|
+ $html = view('app.company.ajax.ajax_sms', ['info' => $res['message']])->render();
|
|
|
$res['message'] = $html;
|
|
|
return response()->json($res);
|
|
|
}
|
|
@@ -114,26 +123,26 @@ class CompanyController extends WebBaseController
|
|
|
public function getRecommendResumes($limit = 10)
|
|
|
{
|
|
|
|
|
|
- $need_limit = $this->recommend_need_limit;
|
|
|
- $list = array();
|
|
|
- $user = auth('web-company')->user();
|
|
|
- $has_job = 1;
|
|
|
+ $need_limit = $this->recommend_need_limit;
|
|
|
+ $list = [];
|
|
|
+ $user = auth('web-company')->user();
|
|
|
+ $has_job = 1;
|
|
|
$recommend_order = $this->companyService->getRecommendorder($user);
|
|
|
$recommend_where = $this->companyService->getRecommendWhere($user);
|
|
|
if ($recommend_where) {
|
|
|
//添加30天的时间限制
|
|
|
- $recommend_where['and'][] = ['updated_at','>=', date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-30 day"))))];
|
|
|
+ $recommend_where['and'][] = ['updated_at', '>=', date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-30 day"))))];
|
|
|
|
|
|
$recommend_resume_lists = $this->searchService->getRecommends($user, 'Resume', $recommend_where, $recommend_order, '', $limit);
|
|
|
- $rids = $recommend_resume_lists->pluck('id')->toArray();
|
|
|
+ $rids = $recommend_resume_lists->pluck('id')->toArray();
|
|
|
if ($recommend_resume_lists->total() >= $limit) {
|
|
|
$list = array_slice($recommend_resume_lists->items(), 0, $limit);
|
|
|
} else {
|
|
|
//获取点击量高的简历
|
|
|
- $click_where = $this->companyService->getRecommendResumeWhere(array());
|
|
|
+ $click_where = $this->companyService->getRecommendResumeWhere([]);
|
|
|
$click_resumes = $this->searchService->search('Resume', $click_where, $recommend_order, '', $need_limit);
|
|
|
$click_resumes = $click_resumes->items();
|
|
|
- Cache::forever('recommend_click_resumes_'.get_subsite_id(), $click_resumes);
|
|
|
+ Cache::forever('recommend_click_resumes_' . get_subsite_id(), $click_resumes);
|
|
|
//去除已有简历
|
|
|
if ($click_resumes && $rids) {
|
|
|
foreach ($click_resumes as $k => $v) {
|
|
@@ -143,47 +152,48 @@ class CompanyController extends WebBaseController
|
|
|
}
|
|
|
}
|
|
|
$recommend_resumes = $recommend_resume_lists->items();
|
|
|
- $recommend_total = $recommend_resume_lists->total();
|
|
|
- $need_resumes = array_slice($click_resumes, 0, $need_limit - $recommend_total);
|
|
|
- $all_resumes = array_merge($recommend_resumes, $need_resumes);
|
|
|
- $list = array_slice($all_resumes, 0, $limit);
|
|
|
+ $recommend_total = $recommend_resume_lists->total();
|
|
|
+ $need_resumes = array_slice($click_resumes, 0, $need_limit - $recommend_total);
|
|
|
+ $all_resumes = array_merge($recommend_resumes, $need_resumes);
|
|
|
+ $list = array_slice($all_resumes, 0, $limit);
|
|
|
}
|
|
|
} else {
|
|
|
//没有可匹配的职位
|
|
|
$has_job = 0;
|
|
|
}
|
|
|
- return array(
|
|
|
- 'resumes' => $list,
|
|
|
- 'match_job' => array(),
|
|
|
- 'has_job' => $has_job
|
|
|
- );
|
|
|
+ return [
|
|
|
+ 'resumes' => $list,
|
|
|
+ 'match_job' => [],
|
|
|
+ 'has_job' => $has_job,
|
|
|
+ ];
|
|
|
}
|
|
|
+
|
|
|
public function ajaxGetRecommendResumes(Request $request)
|
|
|
{
|
|
|
- $limit = $this->recommend_limit;
|
|
|
+ $limit = $this->recommend_limit;
|
|
|
$need_limit = $this->recommend_need_limit;
|
|
|
- $page = $request->input('page');
|
|
|
- $has_job = 1;
|
|
|
- $user = auth('web-company')->user();
|
|
|
- $order_by = $this->companyService->getRecommendorder($user);
|
|
|
- $list = array();
|
|
|
+ $page = $request->input('page');
|
|
|
+ $has_job = 1;
|
|
|
+ $user = auth('web-company')->user();
|
|
|
+ $order_by = $this->companyService->getRecommendorder($user);
|
|
|
+ $list = [];
|
|
|
|
|
|
$recommend_where = $this->companyService->getRecommendWhere($user);
|
|
|
if ($recommend_where) {
|
|
|
- $recommend_where['and'][] = ['updated_at','>=', date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-30 day"))))];
|
|
|
+ $recommend_where['and'][] = ['updated_at', '>=', date('Y-m-d H:i:s', strtotime(date("Y-m-d", strtotime("-30 day"))))];
|
|
|
|
|
|
$recommend_resume_lists = $this->searchService->getRecommends($user, 'Resume', $recommend_where, $order_by, '', $need_limit, 1);
|
|
|
- $rids = $recommend_resume_lists->pluck('id')->toArray();
|
|
|
- $next_page = (int)$page + 1;
|
|
|
+ $rids = $recommend_resume_lists->pluck('id')->toArray();
|
|
|
+ $next_page = (int)$page + 1;
|
|
|
|
|
|
- if ($recommend_resume_lists->total() >= $next_page*$limit) {
|
|
|
- $list = array_slice($recommend_resume_lists->items(), $page*$limit, $limit);
|
|
|
+ if ($recommend_resume_lists->total() >= $next_page * $limit) {
|
|
|
+ $list = array_slice($recommend_resume_lists->items(), $page * $limit, $limit);
|
|
|
} else {
|
|
|
- $click_resumes = Cache::get('recommend_click_resumes_'.get_subsite_id());
|
|
|
+ $click_resumes = Cache::get('recommend_click_resumes_' . get_subsite_id());
|
|
|
|
|
|
if ($click_resumes === null) {
|
|
|
- $click_resumes = $this->searchService->getClickResumes($order_by, array(), $need_limit);
|
|
|
- Cache::forever('recommend_click_resumes_'.get_subsite_id(), $click_resumes);
|
|
|
+ $click_resumes = $this->searchService->getClickResumes($order_by, [], $need_limit);
|
|
|
+ Cache::forever('recommend_click_resumes_' . get_subsite_id(), $click_resumes);
|
|
|
}
|
|
|
if ($click_resumes && $rids) {
|
|
|
foreach ($click_resumes as $k => $v) {
|
|
@@ -194,12 +204,12 @@ class CompanyController extends WebBaseController
|
|
|
}
|
|
|
|
|
|
$recommend_resumes = $recommend_resume_lists->items();
|
|
|
- $recommend_total = $recommend_resume_lists->total();
|
|
|
- $need_resumes = array_slice($click_resumes, 0, $need_limit - $recommend_total);
|
|
|
- $all_resumes = array_merge($recommend_resumes, $need_resumes);
|
|
|
- $list = array_slice($all_resumes, $page*$limit, $limit);
|
|
|
+ $recommend_total = $recommend_resume_lists->total();
|
|
|
+ $need_resumes = array_slice($click_resumes, 0, $need_limit - $recommend_total);
|
|
|
+ $all_resumes = array_merge($recommend_resumes, $need_resumes);
|
|
|
+ $list = array_slice($all_resumes, $page * $limit, $limit);
|
|
|
if (!$list) {
|
|
|
- $list = array_slice($all_resumes, 0, $limit);
|
|
|
+ $list = array_slice($all_resumes, 0, $limit);
|
|
|
$next_page = 1;
|
|
|
}
|
|
|
}
|
|
@@ -207,11 +217,11 @@ class CompanyController extends WebBaseController
|
|
|
} else {
|
|
|
$has_job = 0;
|
|
|
}
|
|
|
- $match_job =0;
|
|
|
+ $match_job = 0;
|
|
|
$recommend_rst['resumes'] = $list;
|
|
|
$recommend_rst['has_job'] = $has_job;
|
|
|
- $html = view('app.company.ajax.ajax_resume_list', $recommend_rst)->render();
|
|
|
- $return_data = array( 'status'=>1, 'html' => $html,'match_job'=>$match_job,'page'=>$next_page);
|
|
|
+ $html = view('app.company.ajax.ajax_resume_list', $recommend_rst)->render();
|
|
|
+ $return_data = ['status' => 1, 'html' => $html, 'match_job' => $match_job, 'page' => $next_page];
|
|
|
return response()->json($return_data);
|
|
|
}
|
|
|
|
|
@@ -236,7 +246,7 @@ class CompanyController extends WebBaseController
|
|
|
*/
|
|
|
public function companyInfo()
|
|
|
{
|
|
|
- $user = auth('web-company')->user();
|
|
|
+ $user = auth('web-company')->user();
|
|
|
$companyInfo = $this->companyService->companyInfo($user);
|
|
|
return view('app.company.company_info', $companyInfo);
|
|
|
}
|
|
@@ -249,7 +259,7 @@ class CompanyController extends WebBaseController
|
|
|
public function companySave(CompanyValidatorRequest $request)
|
|
|
{
|
|
|
$data = $request->except('_method', '_token');
|
|
|
- $res = $this->companyService->companySave($data, auth('web-company')->user());
|
|
|
+ $res = $this->companyService->companySave($data, auth('web-company')->user());
|
|
|
return response()->json($res);
|
|
|
}
|
|
|
|
|
@@ -263,7 +273,7 @@ class CompanyController extends WebBaseController
|
|
|
$user = auth('web-company')->user();
|
|
|
if ($request->method() == 'GET') {
|
|
|
$mobile = $this->companyService->authMobile($user);
|
|
|
- return response()->json(['status'=>1,'data'=>view('app.company.ajax.ajax_auth_mobile', $mobile)->render()]);
|
|
|
+ return response()->json(['status' => 1, 'data' => view('app.company.ajax.ajax_auth_mobile', $mobile)->render()]);
|
|
|
}
|
|
|
return $this->companyService->verifyCode($request->mobile, $user);
|
|
|
}
|
|
@@ -290,14 +300,15 @@ class CompanyController extends WebBaseController
|
|
|
$user = auth('web-company')->user();
|
|
|
return $this->companyService->logoDel($user);
|
|
|
}
|
|
|
+
|
|
|
/**企业风采
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
|
*/
|
|
|
public function companyImg()
|
|
|
{
|
|
|
$user = auth('web-company')->user();
|
|
|
- $res = $this->companyImgService->list($user->id);
|
|
|
- return view('app.company.company_img', ['imgList'=>$res]);
|
|
|
+ $res = $this->companyImgService->list($user->id);
|
|
|
+ return view('app.company.company_img', ['imgList' => $res]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -333,7 +344,7 @@ class CompanyController extends WebBaseController
|
|
|
{
|
|
|
$user = auth('web-company')->user();
|
|
|
|
|
|
- return $this->companyImgService->saveRemark($request,$user);
|
|
|
+ return $this->companyImgService->saveRemark($request, $user);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -346,10 +357,10 @@ class CompanyController extends WebBaseController
|
|
|
{
|
|
|
if ($request->type) {
|
|
|
$user = auth('web-company')->user();
|
|
|
- return $this->companyImgService->delImg($id,$user);
|
|
|
+ return $this->companyImgService->delImg($id, $user);
|
|
|
}
|
|
|
- $tip='被删除后将无法恢复,您确定要删除该风采照片吗?';
|
|
|
- return view('app.company.ajax.ajax_warning', ['tip'=>$tip]);
|
|
|
+ $tip = '被删除后将无法恢复,您确定要删除该风采照片吗?';
|
|
|
+ return view('app.company.ajax.ajax_warning', ['tip' => $tip]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -360,13 +371,13 @@ class CompanyController extends WebBaseController
|
|
|
*/
|
|
|
public function companyAuth($anew = '')
|
|
|
{
|
|
|
- $user = auth('web-company')->user();
|
|
|
- $companyInfo = $this->companyService->getInfoById($user);
|
|
|
+ $user = auth('web-company')->user();
|
|
|
+ $companyInfo = $this->companyService->getInfoById($user);
|
|
|
$companyInfo->reason = $this->auditReasonsRepository->getAuditReasons(auth('web-company')->user()->id, 8);
|
|
|
- if ($anew=='anew') {
|
|
|
+ if ($anew == 'anew') {
|
|
|
$companyInfo->audit = 0;
|
|
|
}
|
|
|
- return view('app.company.company_auth', ['companyInfo'=>$companyInfo, 'anew'=>$anew]);
|
|
|
+ return view('app.company.company_auth', ['companyInfo' => $companyInfo, 'anew' => $anew]);
|
|
|
}
|
|
|
|
|
|
public function certificate(Request $request)
|
|
@@ -382,7 +393,7 @@ class CompanyController extends WebBaseController
|
|
|
*/
|
|
|
public function companySecurity()
|
|
|
{
|
|
|
- $user = auth('web-company')->user();
|
|
|
+ $user = auth('web-company')->user();
|
|
|
$companyInfo = $this->companyService->companySecurity($user);
|
|
|
return view('app.company.company_security', $companyInfo);
|
|
|
}
|
|
@@ -393,11 +404,11 @@ class CompanyController extends WebBaseController
|
|
|
*/
|
|
|
public function loginLog()
|
|
|
{
|
|
|
- $user = auth('web-company')->user();
|
|
|
- $loginLog = $this->companyService->companyLoginLog($user);
|
|
|
- $companyInfo = $user;
|
|
|
+ $user = auth('web-company')->user();
|
|
|
+ $loginLog = $this->companyService->companyLoginLog($user);
|
|
|
+ $companyInfo = $user;
|
|
|
$companyInfo['loginLog'] = $loginLog;
|
|
|
- return view('app.company.login_log', ['companyInfo'=>$companyInfo]);
|
|
|
+ return view('app.company.login_log', ['companyInfo' => $companyInfo]);
|
|
|
}
|
|
|
|
|
|
/**我的消息
|
|
@@ -408,7 +419,7 @@ class CompanyController extends WebBaseController
|
|
|
{
|
|
|
$user = auth('web-company')->user();
|
|
|
$data = $request->all();
|
|
|
- $res = $this->companyService->comPms($data, $user);
|
|
|
+ $res = $this->companyService->comPms($data, $user);
|
|
|
return view('app.company.company_pms', $res);
|
|
|
}
|
|
|
|
|
@@ -432,7 +443,7 @@ class CompanyController extends WebBaseController
|
|
|
|
|
|
public function msgDelete()
|
|
|
{
|
|
|
- if (request()->method()=='POST') {
|
|
|
+ if (request()->method() == 'POST') {
|
|
|
$res = $this->companyService->msgDelete(request()->all());
|
|
|
if ($res) {
|
|
|
return $this->sendSuccessResponse('删除成功!');
|
|
@@ -440,20 +451,20 @@ class CompanyController extends WebBaseController
|
|
|
return $this->sendErrorResponse('删除失败!');
|
|
|
}
|
|
|
} else {
|
|
|
- return view('app.person.ajax.resume_delete', ['tpis'=>'删除后将无法恢复,您确定要删除选择的咨询消息吗?']);
|
|
|
+ return view('app.person.ajax.resume_delete', ['tpis' => '删除后将无法恢复,您确定要删除选择的咨询消息吗?']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
public function companyPmsDel(Request $request)
|
|
|
{
|
|
|
- if ($request->method()== 'POST') {
|
|
|
+ if ($request->method() == 'POST') {
|
|
|
$user = auth('web-company')->user();
|
|
|
|
|
|
- return $this->companyService->companyPmsDel($request,$user);
|
|
|
+ return $this->companyService->companyPmsDel($request, $user);
|
|
|
}
|
|
|
$tip = "被删除后将无法恢复,您确定要删除选中的系统消息吗?";
|
|
|
- return response()->json(['status'=>1,'data'=>['html'=>view('app.company.ajax.ajax_warning', ['tip'=>$tip])->render()]]);
|
|
|
+ return response()->json(['status' => 1, 'data' => ['html' => view('app.company.ajax.ajax_warning', ['tip' => $tip])->render()]]);
|
|
|
}
|
|
|
|
|
|
public function companyPmsCheck(Request $request)
|
|
@@ -467,7 +478,7 @@ class CompanyController extends WebBaseController
|
|
|
public function companyPmsConsult()
|
|
|
{
|
|
|
$res = $this->companyService->companyPmsConsult(auth('web-company')->user());
|
|
|
- return view('app.company.company_pmsconsult', ['content'=>$res]);
|
|
|
+ return view('app.company.company_pmsconsult', ['content' => $res]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -476,7 +487,7 @@ class CompanyController extends WebBaseController
|
|
|
public function modifyUsername()
|
|
|
{
|
|
|
$user = auth('web-company')->user();
|
|
|
- $res = $this->companyService->modifyUserName($user);
|
|
|
+ $res = $this->companyService->modifyUserName($user);
|
|
|
return view('app.company.ajax.username', $res);
|
|
|
}
|
|
|
|
|
@@ -515,7 +526,7 @@ class CompanyController extends WebBaseController
|
|
|
return $this->sendErrorResponse('密码修改失败!');
|
|
|
}
|
|
|
if ($user->mobile) {
|
|
|
- $this->smsService->sendSms($user->mobile, Smser::TEMPLATE_SMS_EDITPWD, ['sitename'=>subsite_config('aix.system.site.site.site_name'),'newpassword'=>$request->password]);
|
|
|
+ $this->smsService->sendSms($user->mobile, Smser::TEMPLATE_SMS_EDITPWD, ['sitename' => subsite_config('aix.system.site.site.site_name'), 'newpassword' => $request->password]);
|
|
|
}
|
|
|
return $this->sendSuccessResponse('密码修改成功!');
|
|
|
}
|
|
@@ -527,7 +538,7 @@ class CompanyController extends WebBaseController
|
|
|
|
|
|
public function authMobile()
|
|
|
{
|
|
|
- $user = auth('web-company')->user();
|
|
|
+ $user = auth('web-company')->user();
|
|
|
$mobile = $this->companyService->authMobile($user);
|
|
|
return view('app.company.ajax.ajax_auth_mobile', $mobile);
|
|
|
}
|
|
@@ -540,34 +551,34 @@ class CompanyController extends WebBaseController
|
|
|
public function verifyCode(CompanyValidatorRequest $request)
|
|
|
{
|
|
|
$mobile = $request->mobile;
|
|
|
- $id = $request->id;
|
|
|
+ $id = $request->id;
|
|
|
if (!$this->companyService->checkMobileAudit($id, $mobile)->isEmpty()) {
|
|
|
- return response()->json(['status'=>0, 'msg'=>'手机已验证']);
|
|
|
+ return response()->json(['status' => 0, 'msg' => '手机已验证']);
|
|
|
}
|
|
|
$this->smsService->sendAuthSms($mobile, smser::TEMPLATE_AUTH_CHECK);
|
|
|
- return response()->json(['status'=>1]);
|
|
|
+ return response()->json(['status' => 1]);
|
|
|
}
|
|
|
|
|
|
public function mobileAudit(CompanyValidatorRequest $request)
|
|
|
{
|
|
|
- $user = auth('web-company')->user();
|
|
|
- $mobile = $request->mobile;
|
|
|
+ $user = auth('web-company')->user();
|
|
|
+ $mobile = $request->mobile;
|
|
|
$verifyCode = $request->verifycode;
|
|
|
- $res = $this->smsService->checkAuthSms($mobile, smser::TEMPLATE_AUTH_CHECK, $verifyCode);
|
|
|
+ $res = $this->smsService->checkAuthSms($mobile, smser::TEMPLATE_AUTH_CHECK, $verifyCode);
|
|
|
if (!$res) {
|
|
|
- return response()->json(['status'=>0,'msg'=>'验证码错误']);
|
|
|
+ return response()->json(['status' => 0, 'msg' => '验证码错误']);
|
|
|
}
|
|
|
$res = $this->companyService->verifyCode($mobile, $user);
|
|
|
- if ($res['status']==1) {
|
|
|
- $this->memberLogRepository->createLog($user,8002,"");
|
|
|
+ if ($res['status'] == 1) {
|
|
|
+ $this->memberLogRepository->createLog($user, 8002, "");
|
|
|
|
|
|
if (isset($res['data'])) {
|
|
|
- return response()->json(['status'=>1,'msg'=>'手机认证成功','data'=>['mobile'=>$mobile, 'points'=>$res['data']['points']]]);
|
|
|
+ return response()->json(['status' => 1, 'msg' => '手机认证成功', 'data' => ['mobile' => $mobile, 'points' => $res['data']['points']]]);
|
|
|
} else {
|
|
|
- return response()->json(['status'=>1,'msg'=>'手机认证成功','data'=>['mobile'=>$mobile]]);
|
|
|
+ return response()->json(['status' => 1, 'msg' => '手机认证成功', 'data' => ['mobile' => $mobile]]);
|
|
|
}
|
|
|
} else {
|
|
|
- return response()->json(['status'=>0,'msg'=>'手机认证失败']);
|
|
|
+ return response()->json(['status' => 0, 'msg' => '手机认证失败']);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -579,9 +590,9 @@ class CompanyController extends WebBaseController
|
|
|
{
|
|
|
$user = auth('web-company')->user();
|
|
|
if (!$email = $this->companyService->authEmail($user)) {
|
|
|
- return response()->json(['status'=>0,'msg'=>'参数错误!']);
|
|
|
+ return response()->json(['status' => 0, 'msg' => '参数错误!']);
|
|
|
}
|
|
|
- return response()->json(['status'=>1,'msg'=>'查询成功!','data'=>view('app.company.ajax.ajax_auth_email', $email)->render()]);
|
|
|
+ return response()->json(['status' => 1, 'msg' => '查询成功!', 'data' => view('app.company.ajax.ajax_auth_email', $email)->render()]);
|
|
|
}
|
|
|
|
|
|
/**认证Email 及修改状态
|
|
@@ -591,17 +602,17 @@ class CompanyController extends WebBaseController
|
|
|
public function emailSend(CompanyValidatorRequest $request)
|
|
|
{
|
|
|
$email = $request->email;
|
|
|
- $id = $request->id;
|
|
|
+ $id = $request->id;
|
|
|
if (!$this->companyService->checkEmailAudit($id, $email)->isEmpty()) {
|
|
|
- return response()->json(['status'=>0, 'msg'=>'email已验证!']);
|
|
|
+ return response()->json(['status' => 0, 'msg' => 'email已验证!']);
|
|
|
}
|
|
|
$user = auth('web-company')->user();
|
|
|
- $this->memberLogRepository->createLog($user,8001,"");
|
|
|
+ $this->memberLogRepository->createLog($user, 8001, "");
|
|
|
|
|
|
$this->emailService->setAuthTag('company')
|
|
|
->setCallback('App\Services\Company\CompanyService', 'sendAuthEmailHook', [$email, auth('web-company')->user()])
|
|
|
->sendAuthMail($email, EmailService::TEMPLATE_VALIDATION);
|
|
|
- return response()->json(['status'=>1]);
|
|
|
+ return response()->json(['status' => 1]);
|
|
|
}
|
|
|
|
|
|
/**签到
|
|
@@ -610,153 +621,161 @@ class CompanyController extends WebBaseController
|
|
|
public function sign()
|
|
|
{
|
|
|
$user = auth('web-company')->user();
|
|
|
- $res = $this->companyService->signIn($user);
|
|
|
- return response()->json(['status'=>$res['code'],'msg'=>$res['msg'],'data'=>$res['info']]);
|
|
|
+ $res = $this->companyService->signIn($user);
|
|
|
+ return response()->json(['status' => $res['code'], 'msg' => $res['msg'], 'data' => $res['info']]);
|
|
|
}
|
|
|
|
|
|
public function ajaxResumeSearch(Request $request)
|
|
|
{
|
|
|
- $key = $request->input('key', '');
|
|
|
+ $key = $request->input('key', '');
|
|
|
$search_type = $request->input('search_type', 'precise');
|
|
|
- return response()->json(['status'=>1,'data'=>route(url_rewrite('AIX_resumelist'), ['key'=>$key, 'search_type'=>$search_type])]);
|
|
|
+ return response()->json(['status' => 1, 'data' => route(url_rewrite('AIX_resumelist'), ['key' => $key, 'search_type' => $search_type])]);
|
|
|
}
|
|
|
|
|
|
|
|
|
public function unBindThird(Request $request)
|
|
|
{
|
|
|
$alias = $request->alias;
|
|
|
- $user = auth('web-company')->user();
|
|
|
+ $user = auth('web-company')->user();
|
|
|
return $this->companyService->unBindThird($alias, $user);
|
|
|
}
|
|
|
|
|
|
//企业联系人信息
|
|
|
public function contact(Request $request)
|
|
|
{
|
|
|
- $user = auth('web-company')->user();
|
|
|
- $contacts = $this->companyService->companyContact($user, 10);
|
|
|
- $return_data = array(
|
|
|
- 'contacts' => $contacts
|
|
|
- );
|
|
|
+ $user = auth('web-company')->user();
|
|
|
+ $contacts = $this->companyService->companyContact($user, 10);
|
|
|
+ $return_data = [
|
|
|
+ 'contacts' => $contacts,
|
|
|
+ ];
|
|
|
|
|
|
return view('app.company.company_contact', $return_data);
|
|
|
}
|
|
|
+
|
|
|
//企业联系人信息ajax请求
|
|
|
- public function ContactAjax(){
|
|
|
- $user = auth('web-company')->user();
|
|
|
+ public function ContactAjax()
|
|
|
+ {
|
|
|
+ $user = auth('web-company')->user();
|
|
|
$contacts = $this->companyService->companyContact($user, 10);
|
|
|
|
|
|
return response()->json($contacts);
|
|
|
}
|
|
|
+
|
|
|
public function showContact(Request $request)
|
|
|
{
|
|
|
- $id = $request->input('id');
|
|
|
+ $id = $request->input('id');
|
|
|
$rst = $this->companyService->getContactInfo($id, auth('web-company')->user());
|
|
|
if (array_has($rst, 'status') && $rst['status'] == 1) {
|
|
|
- $contact = $rst['contact'];
|
|
|
+ $contact = $rst['contact'];
|
|
|
$landline_tel = dealContactPhone($contact->landline_tel);
|
|
|
- $html = view('app.company.ajax.show_contact', ['contact'=>$contact, 'landline_tel'=>$landline_tel])->render();
|
|
|
- $return_data = array( 'status'=>1, 'data' => $html);
|
|
|
+ $html = view('app.company.ajax.show_contact', ['contact' => $contact, 'landline_tel' => $landline_tel])->render();
|
|
|
+ $return_data = ['status' => 1, 'data' => $html];
|
|
|
return response()->json($return_data);
|
|
|
|
|
|
} else {
|
|
|
return response()->json($rst);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
public function deleteContact(Request $request)
|
|
|
{
|
|
|
- $id = $request->input('id');
|
|
|
- $ids = is_array($id)?$id:explode(",", $id);
|
|
|
+ $id = $request->input('id');
|
|
|
+ $ids = is_array($id) ? $id : explode(",", $id);
|
|
|
return $this->companyService->companyContactDel($ids, auth('web-company')->user());
|
|
|
}
|
|
|
+
|
|
|
public function editContact(Request $request)
|
|
|
{
|
|
|
if ($request->method() == 'POST') {
|
|
|
$user = auth('web-company')->user();
|
|
|
|
|
|
- $id = $request->input('id');
|
|
|
+ $id = $request->input('id');
|
|
|
$data = $request->except('_token', '_method');
|
|
|
- $rst = $this->companyService->updateContact($data,$user);
|
|
|
+ $rst = $this->companyService->updateContact($data, $user);
|
|
|
if ($rst) {
|
|
|
- $return_data = array('status'=>1, 'msg'=>'修改成功');
|
|
|
+ $return_data = ['status' => 1, 'msg' => '修改成功'];
|
|
|
} else {
|
|
|
- $return_data = array('status'=>0, 'msg'=>'修改失败');
|
|
|
+ $return_data = ['status' => 0, 'msg' => '修改失败'];
|
|
|
}
|
|
|
return response()->json($return_data);
|
|
|
} else {
|
|
|
- $id = $request->input('id');
|
|
|
+ $id = $request->input('id');
|
|
|
$rst = $this->companyService->getContactInfo($id, auth('web-company')->user());
|
|
|
if (array_has($rst, 'status') == 1) {
|
|
|
$return_data = ['contact' => $rst['contact']];
|
|
|
- $html = view('app.company.ajax.add_contact', $return_data)->render();
|
|
|
- $return_data = array( 'status'=>1, 'data' => $html);
|
|
|
+ $html = view('app.company.ajax.add_contact', $return_data)->render();
|
|
|
+ $return_data = ['status' => 1, 'data' => $html];
|
|
|
return response()->json($return_data);
|
|
|
} else {
|
|
|
return $rst;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
public function addContact(Request $request)
|
|
|
{
|
|
|
if ($request->method() == 'POST') {
|
|
|
- $contact = $request->input('contact', '');
|
|
|
+ $contact = $request->input('contact', '');
|
|
|
$telephone = $request->input('telephone', '');
|
|
|
$tel_first = $request->input('tel_first', '');
|
|
|
- $tel_next = $request->input('tel_next', '');
|
|
|
- $tel_last = $request->input('tel_last', '');
|
|
|
- $email = $request->input('email', '');
|
|
|
- $qq = $request->input('qq', '');
|
|
|
- $address = $request->input('address', '');
|
|
|
+ $tel_next = $request->input('tel_next', '');
|
|
|
+ $tel_last = $request->input('tel_last', '');
|
|
|
+ $email = $request->input('email', '');
|
|
|
+ $qq = $request->input('qq', '');
|
|
|
+ $address = $request->input('address', '');
|
|
|
|
|
|
if (!$contact) {
|
|
|
- $return_data = array( 'status'=>0, 'msg' => '请输入联系人信息');
|
|
|
+ $return_data = ['status' => 0, 'msg' => '请输入联系人信息'];
|
|
|
}
|
|
|
//座机和手机号至少填写一项
|
|
|
if (!$email) {
|
|
|
- $return_data = array( 'status'=>0, 'msg' => '请输入联系邮箱');
|
|
|
+ $return_data = ['status' => 0, 'msg' => '请输入联系邮箱'];
|
|
|
}
|
|
|
if (!$address) {
|
|
|
- $return_data = array( 'status'=>0, 'msg' => '请输入联系地址');
|
|
|
+ $return_data = ['status' => 0, 'msg' => '请输入联系地址'];
|
|
|
}
|
|
|
|
|
|
- if (!empty($tel_first) && !empty($tel_next)){
|
|
|
- $landline_tel=$tel_first."-".$tel_next;
|
|
|
- if (!empty($tel_last)){ $landline_tel.="-".$tel_last; }
|
|
|
- }else{
|
|
|
- $landline_tel="";
|
|
|
+ if (!empty($tel_first) && !empty($tel_next)) {
|
|
|
+ $landline_tel = $tel_first . "-" . $tel_next;
|
|
|
+ if (!empty($tel_last)) {
|
|
|
+ $landline_tel .= "-" . $tel_last;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $landline_tel = "";
|
|
|
}
|
|
|
|
|
|
- $set_data = array(
|
|
|
+ $set_data = [
|
|
|
'company_id' => (int)auth('web-company')->user()->id,
|
|
|
'contact' => $contact,
|
|
|
'telephone' => $telephone,
|
|
|
'landline_tel' => $landline_tel,
|
|
|
'email' => $email,
|
|
|
'qq' => $qq,
|
|
|
- 'address' => $address
|
|
|
- );
|
|
|
- $rst = $this->companyService->addContact($set_data);
|
|
|
+ 'address' => $address,
|
|
|
+ ];
|
|
|
+ $rst = $this->companyService->addContact($set_data);
|
|
|
if ($rst) {
|
|
|
- $return_data = array('status'=>1, 'msg'=>'添加成功');
|
|
|
+ $return_data = ['status' => 1, 'msg' => '添加成功'];
|
|
|
} else {
|
|
|
- $return_data = array('status'=>0, 'msg'=>'添加失败');
|
|
|
+ $return_data = ['status' => 0, 'msg' => '添加失败'];
|
|
|
}
|
|
|
return response()->json($return_data);
|
|
|
} else {
|
|
|
- $return_data = ['contact'=>''];
|
|
|
- $html = view('app.company.ajax.add_contact', $return_data)->render();
|
|
|
- $return_data = array( 'status'=>1, 'data' => $html);
|
|
|
+ $return_data = ['contact' => ''];
|
|
|
+ $html = view('app.company.ajax.add_contact', $return_data)->render();
|
|
|
+ $return_data = ['status' => 1, 'data' => $html];
|
|
|
return response()->json($return_data);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public function myCode(Request $requset)
|
|
|
{
|
|
|
- $id = $requset->id?$requset->id:0;
|
|
|
+ $id = $requset->id ? $requset->id : 0;
|
|
|
$user = $this->getLoginUser();
|
|
|
- if ($user->id!=$id) {
|
|
|
- return response()->json(['status'=>0,'img'=>'企业不存在!']);
|
|
|
+ if ($user->id != $id) {
|
|
|
+ return response()->json(['status' => 0, 'img' => '企业不存在!']);
|
|
|
}
|
|
|
- return response()->json(['status'=>1,'img'=>get_qrcode_html(route('mobile.firm.com.wzp.index',['id'=>$id]))]);
|
|
|
+ return response()->json(['status' => 1, 'img' => get_qrcode_html(route('mobile.firm.com.wzp.index', ['id' => $id]))]);
|
|
|
}
|
|
|
|
|
|
//服务广场
|
|
@@ -769,7 +788,7 @@ class CompanyController extends WebBaseController
|
|
|
{
|
|
|
$service_list = $this->serviceService->list();
|
|
|
|
|
|
- return view('app.company.company_share',['service_list'=>$service_list]);
|
|
|
+ return view('app.company.company_share', ['service_list' => $service_list]);
|
|
|
}
|
|
|
|
|
|
public function dispensing()
|
|
@@ -779,40 +798,40 @@ class CompanyController extends WebBaseController
|
|
|
|
|
|
public function dispensingList()
|
|
|
{
|
|
|
- $user = auth('web-company')->user();
|
|
|
+ $user = auth('web-company')->user();
|
|
|
$dispensingList = $this->dispensingService->list($user);
|
|
|
- return view('app.company.company_dispensingList',['dispensing'=>$dispensingList]);
|
|
|
+ return view('app.company.company_dispensingList', ['dispensing' => $dispensingList]);
|
|
|
}
|
|
|
|
|
|
public function dispensingAdd(Request $request)
|
|
|
{
|
|
|
$data = $request->except('_method', '_token');
|
|
|
- return $this->dispensingService->save($data,auth('web-company')->user());
|
|
|
+ return $this->dispensingService->save($data, auth('web-company')->user());
|
|
|
}
|
|
|
|
|
|
public function dispensingEdit(Request $request)
|
|
|
{
|
|
|
- if(request()->method()=='POST'){
|
|
|
+ if (request()->method() == 'POST') {
|
|
|
$data = $request->except('_method', '_token');
|
|
|
- return $this->dispensingService->save($data,auth('web-company')->user());
|
|
|
+ return $this->dispensingService->save($data, auth('web-company')->user());
|
|
|
|
|
|
- }else{
|
|
|
- $id = $request->input('id');
|
|
|
- $user = auth('web-company')->user();
|
|
|
- $where['id'] = $id;
|
|
|
- $where['uid'] = $user->id;
|
|
|
+ } else {
|
|
|
+ $id = $request->input('id');
|
|
|
+ $user = auth('web-company')->user();
|
|
|
+ $where['id'] = $id;
|
|
|
+ $where['uid'] = $user->id;
|
|
|
$dispensingInfo = $this->dispensingService->dispensingInfo($where);
|
|
|
- if(!$dispensingInfo){
|
|
|
+ if (!$dispensingInfo) {
|
|
|
return $this->showMessage('没有这个需求!', route('com.dispensingList'), true);
|
|
|
}
|
|
|
|
|
|
- return view('app.company.company_dispensingEdit',['dispensing'=>$dispensingInfo]);
|
|
|
+ return view('app.company.company_dispensingEdit', ['dispensing' => $dispensingInfo]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public function dispensingDel(Request $request)
|
|
|
{
|
|
|
- $id = $request->id;
|
|
|
+ $id = $request->id;
|
|
|
$user = auth('web-company')->user();
|
|
|
return $this->dispensingService->dispensingDel($id, $user);
|
|
|
}
|