|
@@ -1,209 +1,528 @@
|
|
|
<?php
|
|
|
+
|
|
|
namespace App\Http\Controllers\Mobile\Active;
|
|
|
|
|
|
use App\Http\Controllers\Mobile\MobileBaseController;
|
|
|
-use App\Services\Company\SpringCompanyService;
|
|
|
-use App\Services\Company\SpringJobService;
|
|
|
-use Illuminate\Http\Request;
|
|
|
-use App\Models\Category;
|
|
|
-use Illuminate\Support\Facades\DB;
|
|
|
+use App\Models\LotteryLog;
|
|
|
+use App\Models\LotteryPrize;
|
|
|
+use App\Models\LotteryWin;
|
|
|
+use App\Models\Thirdlogin;
|
|
|
use App\Services\Common\CategoryService;
|
|
|
-use Illuminate\Support\Facades\Storage;
|
|
|
-use App\Validators\PersonValidatorRequest;
|
|
|
-use App\Services\Person\ResumeService;
|
|
|
-use App\Services\Company\JobsService;
|
|
|
-use App\Services\Common\SmsService;
|
|
|
+use App\Services\Common\WechatService;
|
|
|
+use App\Services\Auth\AuthService;
|
|
|
+use App\Services\HomeService;
|
|
|
+use Illuminate\Http\Request;
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
-use Illuminate\Support\Facades\Hash;
|
|
|
-use App\Services\Common\MembersSetmealService;
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
|
+use Illuminate\Support\Facades\Session;
|
|
|
|
|
|
class SpringController extends MobileBaseController
|
|
|
{
|
|
|
- protected $springJobService;
|
|
|
- protected $springCompanyService;
|
|
|
+ private $wechatService;
|
|
|
protected $categoryService;
|
|
|
- protected $resumeService;
|
|
|
- protected $jobsService;
|
|
|
- protected $smsService;
|
|
|
- private $membersSetmealService;
|
|
|
+ protected $authService;
|
|
|
+ protected $homeService;
|
|
|
|
|
|
- public function __construct(SpringJobService $springJobService,SpringCompanyService $springCompanyService,CategoryService $categoryService,ResumeService $resumeService,JobsService $jobsService, SmsService $smsService, MembersSetmealService $membersSetmealService)
|
|
|
+ public function __construct(WechatService $wechatService, CategoryService $categoryService, authService $authService, HomeService $homeService)
|
|
|
{
|
|
|
- $this->springJobService = $springJobService;
|
|
|
- $this->springCompanyService = $springCompanyService;
|
|
|
+ $this->wechatService = $wechatService;
|
|
|
$this->categoryService = $categoryService;
|
|
|
- $this->resumeService = $resumeService;
|
|
|
- $this->jobsService = $jobsService;
|
|
|
- $this->smsService = $smsService;
|
|
|
- $this->membersSetmealService = $membersSetmealService;
|
|
|
+ $this->authService = $authService;
|
|
|
+ $this->homeService = $homeService;
|
|
|
}
|
|
|
|
|
|
- public function enterprise(Request $request)
|
|
|
+ /**
|
|
|
+ * 专题页
|
|
|
+ */
|
|
|
+ public function index(Request $request)
|
|
|
{
|
|
|
- if($request->isMethod('post'))
|
|
|
- {
|
|
|
- $data['company_name'] = $request->input('company_name');
|
|
|
- $data['company_type'] = $request->input('company_type');
|
|
|
- $data['company_trade'] = $request->input('company_trade');
|
|
|
- $data['company_desc'] = $request->input('company_desc');
|
|
|
- $data['company_address'] = $request->input('company_address');
|
|
|
- $data['date'] = "2020-".$request->input('time');
|
|
|
- $data['real_name'] = $request->input('real_name');
|
|
|
- $data['phone'] = $request->input('phone');
|
|
|
- $data['attachment'] = $request->input('attachment');
|
|
|
- $data['license'] = empty($request->input('license')) ? '' : $request->input('license');
|
|
|
- $data['scene'] = implode(",",$request->input('scene'));
|
|
|
- $id = $this->springCompanyService->saveCompany($data);
|
|
|
- $jobs_name = $request->input('job_name');
|
|
|
- $jobs_type = $request->input('job_type');
|
|
|
- $jobs_num = $request->input('job_num');
|
|
|
- $jobs_salary = $request->input('job_salary');
|
|
|
- $jobs_desc = $request->input('job_desc');
|
|
|
- $jobs = [];
|
|
|
- foreach ($jobs_name as $k => $v){
|
|
|
- $item = [];
|
|
|
- $item['company_id'] = $id->id;
|
|
|
- $item['job_name'] = $jobs_name[$k];
|
|
|
- $item['job_type'] = $jobs_type[$k];
|
|
|
- $item['job_num'] = $jobs_num[$k];
|
|
|
- $item['job_salary'] = $jobs_salary[$k];
|
|
|
- $item['job_desc'] = $jobs_desc[$k];
|
|
|
- array_push($jobs,$item);
|
|
|
- }
|
|
|
- DB::table('spring_jobs')->insert($jobs);
|
|
|
- return $this->sendSuccessResponse(['msg'=>'登记成功']);
|
|
|
- }else{
|
|
|
- $result = $this->categoryService->getAllJobsCategory();
|
|
|
- $companyType = [];
|
|
|
- foreach (Category::categoryType('AIX_company_type') as $k => $v){
|
|
|
- $item = [
|
|
|
- 'name' => $v,
|
|
|
- 'value' => $k
|
|
|
- ];
|
|
|
- array_push($companyType,$item);
|
|
|
- }
|
|
|
- $companyTrade = [];
|
|
|
- foreach (Category::categoryType('AIX_trade') as $k => $v){
|
|
|
- $item = [
|
|
|
- 'name' => $v,
|
|
|
- 'value' => $k
|
|
|
- ];
|
|
|
- array_push($companyTrade,$item);
|
|
|
- }
|
|
|
- return view('mobile.app.active.enterprise')->with([
|
|
|
- 'jobs' => json_encode($result),
|
|
|
- 'companyType' => $companyType,
|
|
|
- 'companyTrade' => $companyTrade
|
|
|
- ]);
|
|
|
+ //是否登录
|
|
|
+ $user = auth('web-member')->user();
|
|
|
+ if (empty($user)) {
|
|
|
+ $open_id = Session::get('open_id');
|
|
|
+ if (empty($open_id)) {
|
|
|
+ return redirect(route('mobile.lottery.login'));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $third = Thirdlogin::where('uid', $user->id)->first();
|
|
|
+ $open_id = $third['openid'];
|
|
|
+ }
|
|
|
+
|
|
|
+// $open_id = '11';
|
|
|
+ //抽奖次数
|
|
|
+ $type = $request->input('type', 1);
|
|
|
+ $date = date('Y-m-d');
|
|
|
+ $log = LotteryLog::where([
|
|
|
+ ['create_time', '=', $date],
|
|
|
+ ['type', '=', $type],
|
|
|
+ ['open_id', '=', $open_id],
|
|
|
+ ])->first();
|
|
|
+ $number = 1;
|
|
|
+ if (!empty($log)) {
|
|
|
+ $number = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ //奖品列表
|
|
|
+ $prize = LotteryPrize::all();
|
|
|
+ $ids = [];
|
|
|
+ $restaraunts = [];
|
|
|
+ $colors = [];
|
|
|
+ $images = [];
|
|
|
+ foreach ($prize as $v) {
|
|
|
+ $ids[] = $v->id;
|
|
|
+ $restaraunts[] = $v->prize_name;
|
|
|
+ $colors[] = $v->prize_bg;
|
|
|
+ $images[] = upload_asset($v->prize_image);
|
|
|
}
|
|
|
|
|
|
+ //中奖记录
|
|
|
+ $win = [];
|
|
|
+ $user = auth('web-member')->user();
|
|
|
+ if (!empty($user)) {
|
|
|
+ $win = LotteryWin::with('prize')->where('member_id', $user->id)->orderBy('status', 'asc')->orderBy('created_at', 'desc')->limit(8)->get();
|
|
|
+ }
|
|
|
+
|
|
|
+ $return_data = [
|
|
|
+ 'open_id' => $open_id,
|
|
|
+ 'current_url' => \Illuminate\Support\Facades\Request::getRequestUri(),
|
|
|
+ 'user' => $user,
|
|
|
+ 'number' => $number,
|
|
|
+ 'type' => $type,
|
|
|
+ 'prize' => $prize,
|
|
|
+ 'win' => $win,
|
|
|
+ 'ids' => $ids,
|
|
|
+ 'restaraunts' => $restaraunts,
|
|
|
+ 'colors' => $colors,
|
|
|
+ 'images' => $images,
|
|
|
+ 'wap_title' => '抽奖',
|
|
|
+ 'share_title' => '【福利通知】免费找工作,抽大奖拿好礼',
|
|
|
+ 'share_desc' => '晋江好福利!免费找工作、找人才,还能抽奖,100%中奖,万份好礼免费拿!',
|
|
|
+ 'share_link' => route('mobile.lottery.login'),
|
|
|
+ 'share_image_url' => theme_asset('mobile/images/online2021/share_logo.jpg'),
|
|
|
+ 'live_list' => $this->homeService->getSpringLive(),
|
|
|
+ ];
|
|
|
+
|
|
|
+ return view('mobile.app.active.spring', $return_data);
|
|
|
}
|
|
|
|
|
|
- public function uploadfile(Request $request)
|
|
|
+ /**
|
|
|
+ * 专区页
|
|
|
+ */
|
|
|
+ public function special(Request $request)
|
|
|
{
|
|
|
- $file = $request->file('files');
|
|
|
- if($file ->isValid()) { //判断文件是否存在
|
|
|
- //获取文件的扩展名
|
|
|
- $ext = $file->getClientOriginalExtension();
|
|
|
+ $offset = isset($request->page) ? $request->page : 0;
|
|
|
+ $limit = 8;
|
|
|
|
|
|
- //获取文件的绝对路径
|
|
|
- $path = $file->getRealPath();
|
|
|
+ $citycategory = $request->input('citycategory', '');
|
|
|
+ $trade = $request->input('trade', '');
|
|
|
+ $param_array = ['citycategory', 'trade', 'nature'];
|
|
|
|
|
|
- $oldname= $file->getClientOriginalName();
|
|
|
+ $params = [];
|
|
|
+ if ($request->all()) {
|
|
|
+ foreach ($request->all() as $k => $v) {
|
|
|
+ if (in_array($k, $param_array) && $v) {
|
|
|
+ $params[$k] = $v;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- //定义文件名
|
|
|
- $filename = date('Y-m-d-h-i-s').'.'.$ext;
|
|
|
+ $filter_where = [
|
|
|
+ 'AIX_trade' => 100,
|
|
|
+ 'AIX_company_type' => 100,
|
|
|
+ ];
|
|
|
+ $categories = $this->categoryService->getCategories($filter_where);
|
|
|
|
|
|
- //存储文件。disk里面的public。总的来说,就是调用disk模块里的public配置
|
|
|
- Storage::disk('public')->put($filename, file_get_contents($path));
|
|
|
+ $subsites = Cache::get('subsites_list');
|
|
|
+ if ($subsites) {
|
|
|
+ if (!array_has($params, 'citycategory')) {
|
|
|
+ if (get_subsite_id() > 0) {
|
|
|
+ $citycategory = $subsites[get_subsite_id()]['district'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $title = '晋江市新春招聘会';
|
|
|
+ $citys = $this->categoryService->getCitys($citycategory);
|
|
|
|
|
|
+ if (empty($citycategory)) {
|
|
|
+ $district_str = "(district like ? or district like ?)";
|
|
|
+ $district_arr = ["%.623%", "%623.%"];
|
|
|
+ } else {
|
|
|
+ $select_id = $citys['select']['id'];
|
|
|
+ $district_str = "(district like ? or district like ?)";
|
|
|
+ $district_arr = ["%.{$select_id}%", "%{$select_id}.%"];
|
|
|
+ $title = $citys['select']['name'] . '专区';
|
|
|
}
|
|
|
+ $companys = DB::table('jobs')->join('companys', 'jobs.company_id', '=', 'companys.id')->whereRaw("jobs.updated_at > '2022-01-01 00:00:00' and jobs.deleted_at is null")->groupBy('jobs.company_id')->select('jobs.company_id')->pluck('company_id')->toArray();
|
|
|
|
|
|
- $res['status'] = 1;
|
|
|
- $res['filename'] = $oldname;
|
|
|
- $res['path'] = "/storage/".$filename;
|
|
|
+ $where = [];
|
|
|
+ $where[] = ['user_status', '=', 1];
|
|
|
+ $where[] = ['audit', '=', 1];
|
|
|
+ $where[] = ['deleted_at', '=', null];
|
|
|
+ if (!empty($trade)) {
|
|
|
+ $where[] = ['trade', '=', $trade];
|
|
|
+ }
|
|
|
|
|
|
- return response()->json($res);
|
|
|
- }
|
|
|
+ $list = DB::table('companys')->where($where)->whereRaw($district_str, $district_arr)->whereIn('id', $companys)->orderBy('sort_index', 'desc')->orderBy('id', 'desc')->offset($limit * $offset)->limit($limit)->get();
|
|
|
+ $more = count($list) >= $limit ? true : false;
|
|
|
|
|
|
- public function job(){
|
|
|
- $user = auth('web-member')->user();
|
|
|
- if(!$user){
|
|
|
- $is_login = 0;
|
|
|
- }else{
|
|
|
- $is_login = 1;
|
|
|
- }
|
|
|
- $district = $this->categoryService->getDefaultDistrict();
|
|
|
- return view('mobile.app.active.job',[
|
|
|
- 'is_login'=>$is_login,
|
|
|
- 'user'=>$user,
|
|
|
- 'defaultCity'=>$district->defaultCity,
|
|
|
- 'disCity'=>$district->disCity,
|
|
|
- 'disHan'=>$district->disHan,
|
|
|
- 'wap_title'=>'新春招聘会报名登记表'
|
|
|
+ $res = [];
|
|
|
+ foreach ($list as $val) {
|
|
|
+
|
|
|
+ $item = [
|
|
|
+ 'id' => $val->id,
|
|
|
+ 'companyname' => $val->companyname,
|
|
|
+ 'jobs' => [],
|
|
|
+ 'tag_arr' => [],
|
|
|
+ ];
|
|
|
+
|
|
|
+ //在招职位
|
|
|
+ $jobs_where = [
|
|
|
+ ['company_id', '=', $val->id],
|
|
|
+ ['valid', '=', 1],
|
|
|
+ ['display', '=', 1],
|
|
|
+ ['audit', '=', 1],
|
|
|
+ ['deleted_at', '=', null],
|
|
|
+ ];
|
|
|
+
|
|
|
+ $jobs = DB::table('jobs')->where($jobs_where)->get();
|
|
|
+ if (!$jobs->isEmpty()) {
|
|
|
+ foreach ($jobs as $value) {
|
|
|
+ $job = [
|
|
|
+ 'id' => $value->id,
|
|
|
+ 'jobs_name' => $value->jobs_name,
|
|
|
+ 'amount' => $value->amount,
|
|
|
+ 'wage' => $value->wage,
|
|
|
+ 'wage_min' => $value->wage_min,
|
|
|
+ 'wage_max' => $value->wage_max,
|
|
|
+ ];
|
|
|
+ array_push($item['jobs'], $job);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //企业福利
|
|
|
+ if (!empty($val->tag)) {
|
|
|
+ $tags = explode(',', $val->tag);
|
|
|
+ $tag_arr = DB::table('categorys')->whereIn('id', $tags)->limit(3)->get(['demand'])->toArray();
|
|
|
+ $item['tag_arr'] = $tag_arr;
|
|
|
+ }
|
|
|
+
|
|
|
+ array_push($res, $item);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($request->ajax()) {
|
|
|
+ if (count($res)) {
|
|
|
+ return response()->json(['status' => 1, 'data' => view('mobile.app.active.ajax.ajax_spring_special_com', [
|
|
|
+ 'res' => $res,
|
|
|
+ 'city' => $citys,
|
|
|
+ 'params' => $params,
|
|
|
+ 'categories' => $categories,
|
|
|
+ 'more' => $more,
|
|
|
+ ])->render()]);
|
|
|
+ }
|
|
|
+ return response()->json(['status' => 0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ return view('mobile.app.active.spring_special', [
|
|
|
+ 'title' => $title,
|
|
|
+ 'res' => $res,
|
|
|
+ 'city' => $citys,
|
|
|
+ 'params' => $params,
|
|
|
+ 'categories' => $categories,
|
|
|
+ 'more' => $more,
|
|
|
+ 'share_title' => "【{$title}】免费找工作",
|
|
|
+ 'share_desc' => '晋江好福利!免费找工作、找人才,还能抽奖,100%中奖,万份好礼免费拿!',
|
|
|
+ 'share_image_url' => theme_asset('mobile/images/online2021/share_logo.jpg'),
|
|
|
+ 'share_link' => route('mobile.active.spring_special') . '?citycategory=' . $citycategory,
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
- public function jobHunterRegister(PersonValidatorRequest $request){
|
|
|
- //添加基础信息
|
|
|
- $resume_res = $this->resumeService->activeResumeCreate($request->except(['add_tag','_token']), auth('web-member')->user());
|
|
|
+ /**
|
|
|
+ * 经开区专区页
|
|
|
+ */
|
|
|
+ public function special_jkq(Request $request)
|
|
|
+ {
|
|
|
+ $source = $request->input('source', 0);
|
|
|
+ $type = $request->input('type', 1);
|
|
|
+ if (!$request->ajax()) {
|
|
|
+ //是否登录
|
|
|
+ $user = auth('web-member')->user();
|
|
|
+ if (empty($user)) {
|
|
|
+ $open_id = Session::get('open_id');
|
|
|
+ if (empty($open_id)) {
|
|
|
+ return redirect(route('mobile.active.spring_jkq_login', ['type' => $type, 'source' => $source]));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $third = Thirdlogin::where('uid', $user->id)->first();
|
|
|
+ $open_id = $third['openid'];
|
|
|
+ }
|
|
|
|
|
|
- if ($resume_res['code']==1) {
|
|
|
- return $this->sendSuccessResponse(['id'=>'登记成功','tag'=>$request->add_tag]);
|
|
|
- } else {
|
|
|
- return $this->sendErrorResponse('更新简历失败', '', 400);
|
|
|
+// $open_id = '11';
|
|
|
+ //抽奖次数
|
|
|
+ $date = date('Y-m-d');
|
|
|
+ $log = LotteryLog::where([
|
|
|
+ ['create_time', '=', $date],
|
|
|
+ ['type', '=', $type],
|
|
|
+ ['open_id', '=', $open_id],
|
|
|
+ ])->first();
|
|
|
+ $number = 1;
|
|
|
+ if (!empty($log)) {
|
|
|
+ $number = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ //奖品列表
|
|
|
+ $prize = LotteryPrize::all();
|
|
|
+ $ids = [];
|
|
|
+ $restaraunts = [];
|
|
|
+ $colors = [];
|
|
|
+ $images = [];
|
|
|
+ foreach ($prize as $v) {
|
|
|
+ $ids[] = $v->id;
|
|
|
+ $restaraunts[] = $v->prize_name;
|
|
|
+ $colors[] = $v->prize_bg;
|
|
|
+ $images[] = upload_asset($v->prize_image);
|
|
|
+ }
|
|
|
+
|
|
|
+ //中奖记录
|
|
|
+ $win = [];
|
|
|
+ $user = auth('web-member')->user();
|
|
|
+ if (!empty($user)) {
|
|
|
+ $win = LotteryWin::with('prize')->where('member_id', $user->id)->orderBy('status', 'asc')->orderBy('created_at', 'desc')->limit(8)->get();
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ $offset = isset($request->page) ? $request->page : 0;
|
|
|
+ $limit = 8;
|
|
|
+
|
|
|
+ $citycategory = 'jjkfq';
|
|
|
+ $companys = DB::table('jobs')->join('companys', 'jobs.company_id', '=', 'companys.id')->whereRaw("jobs.updated_at > '2022-01-01 00:00:00' and jobs.deleted_at is null")->groupBy('jobs.company_id')->select('jobs.company_id')->pluck('company_id')->toArray();
|
|
|
+
|
|
|
+
|
|
|
+ $citys = $this->categoryService->getCitys($citycategory);
|
|
|
+ $select_id = $citys['select']['id'];
|
|
|
+ $district_str = "(district like ? or district like ?)";
|
|
|
+ $district_arr = ["%.{$select_id}%", "%{$select_id}.%"];
|
|
|
+
|
|
|
+ $where = [];
|
|
|
+ $where[] = ['user_status', '=', 1];
|
|
|
+ $where[] = ['audit', '=', 1];
|
|
|
+ $where[] = ['deleted_at', '=', null];
|
|
|
+
|
|
|
+ $list = DB::table('companys')->where($where)->whereRaw($district_str, $district_arr)->whereIn('id', $companys)->orderBy('sort_index', 'desc')->orderBy('id', 'desc')->offset($limit * $offset)->limit($limit)->get();
|
|
|
+ $more = count($list) >= $limit ? true : false;
|
|
|
+
|
|
|
+ $res = [];
|
|
|
+ foreach ($list as $val) {
|
|
|
+
|
|
|
+ $item = [
|
|
|
+ 'id' => $val->id,
|
|
|
+ 'companyname' => $val->companyname,
|
|
|
+ 'jobs' => [],
|
|
|
+ 'tag_arr' => [],
|
|
|
+ ];
|
|
|
+
|
|
|
+ //在招职位
|
|
|
+ $jobs_where = [
|
|
|
+ ['company_id', '=', $val->id],
|
|
|
+ ['valid', '=', 1],
|
|
|
+ ['display', '=', 1],
|
|
|
+ ['audit', '=', 1],
|
|
|
+ ['deleted_at', '=', null],
|
|
|
+ ];
|
|
|
+
|
|
|
+ $jobs = DB::table('jobs')->where($jobs_where)->get();
|
|
|
+ if (!$jobs->isEmpty()) {
|
|
|
+ foreach ($jobs as $value) {
|
|
|
+ $job = [
|
|
|
+ 'id' => $value->id,
|
|
|
+ 'jobs_name' => $value->jobs_name,
|
|
|
+ 'amount' => $value->amount,
|
|
|
+ 'wage' => $value->wage,
|
|
|
+ 'wage_min' => $value->wage_min,
|
|
|
+ 'wage_max' => $value->wage_max,
|
|
|
+ 'wage_str' => $value->wage_str,
|
|
|
+ ];
|
|
|
+ array_push($item['jobs'], $job);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //企业福利
|
|
|
+ if (!empty($val->tag)) {
|
|
|
+ $tags = explode(',', $val->tag);
|
|
|
+ $tag_arr = DB::table('categorys')->whereIn('id', $tags)->limit(3)->get(['demand'])->toArray();
|
|
|
+ $item['tag_arr'] = $tag_arr;
|
|
|
+ }
|
|
|
+
|
|
|
+ array_push($res, $item);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($request->ajax()) {
|
|
|
+ if (count($res)) {
|
|
|
+ return response()->json(['status' => 1, 'data' => view('mobile.app.active.ajax.ajax_spring_special_com', [
|
|
|
+ 'res' => $res,
|
|
|
+ 'more' => $more,
|
|
|
+ ])->render()]);
|
|
|
+ }
|
|
|
+ return response()->json(['status' => 0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ return view('mobile.app.active.spring_special_jkq', [
|
|
|
+ 'source' => $source,
|
|
|
+ 'params' => ['citycategory' => 'jjkfq'],
|
|
|
+ 'open_id' => $open_id,
|
|
|
+ 'current_url' => \Illuminate\Support\Facades\Request::getRequestUri(),
|
|
|
+ 'user' => $user,
|
|
|
+ 'number' => $number,
|
|
|
+ 'type' => $type,
|
|
|
+ 'prize' => $prize,
|
|
|
+ 'win' => $win,
|
|
|
+ 'ids' => $ids,
|
|
|
+ 'restaraunts' => $restaraunts,
|
|
|
+ 'colors' => $colors,
|
|
|
+ 'images' => $images,
|
|
|
+ 'res' => $res,
|
|
|
+ 'more' => $more,
|
|
|
+ 'share_title' => '【福利通知】免费找工作,抽大奖拿好礼',
|
|
|
+ 'share_desc' => '晋江好福利!免费找工作、找人才,还能抽奖,100%中奖,万份好礼免费拿!',
|
|
|
+ 'share_image_url' => theme_asset('mobile/images/online2021/share_logo.jpg'),
|
|
|
+ 'live_list' => $this->homeService->getSpringLive(),
|
|
|
+ ]);
|
|
|
}
|
|
|
|
|
|
- public function getCompanyList(Request $request){
|
|
|
-
|
|
|
- $trade = Category::categoryType('AIX_trade');
|
|
|
- $type = Category::categoryType('AIX_company_type');
|
|
|
- $title = $request->input('title');
|
|
|
- $status = $request->input('status');
|
|
|
- $list = $this->springCompanyService->list($title, $status,10);
|
|
|
- $result = [];
|
|
|
- foreach ($list as $k => $v) {
|
|
|
- $item = [];
|
|
|
- $item['id'] = $v['id'];
|
|
|
- $item['name'] = $v['company_name'];
|
|
|
- $item['type'] = $type[$v['company_type']];
|
|
|
- $item['trade'] = $trade[$v['company_trade']];
|
|
|
- $item['realname'] = $v['real_name'];
|
|
|
- $item['phone'] = $v['phone'];
|
|
|
- $item['address'] = $v['company_address'];
|
|
|
- $item['desc'] = $v['company_desc'];
|
|
|
- $item['url'] = 'http://www.jucai.gov.cn'.$v['license'];
|
|
|
- $item['attachment'] = 'http://www.jucai.gov.cn'.$v['attachment'];
|
|
|
- $item['scene'] = $v['scene'];
|
|
|
- $item['status'] = $v['status'];
|
|
|
- array_push($result,$item);
|
|
|
- }
|
|
|
- $msg['status'] = 'ok';
|
|
|
- $msg['msg'] = '数据获取成功';
|
|
|
- $msg['total'] = $list->total();
|
|
|
- $msg['data'] = $result;
|
|
|
- echo json_encode($msg);
|
|
|
+ /**
|
|
|
+ * 微信登录
|
|
|
+ */
|
|
|
+ public function jkq_login(Request $request)
|
|
|
+ {
|
|
|
+ //type:web-电脑端,mobile-手机端,
|
|
|
+ $app_id = subsite_config('aix.system.oauth.wechat_official.app_id');
|
|
|
+ $redirect_uri = urlencode(route('mobile.active.spring_jkq_wechat_back'));
|
|
|
+ $type = $request->input('type', 1);
|
|
|
+ $source = $request->input('source', 0);
|
|
|
+ $wechat_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$app_id}&redirect_uri={$redirect_uri}&response_type=code&scope=snsapi_userinfo&state={$type}_{$source}#wechat_redirect";
|
|
|
+ return redirect($wechat_url);
|
|
|
}
|
|
|
|
|
|
- public function verifyCompany(Request $request){
|
|
|
- $id = $request->input('id');
|
|
|
- $res = $this->springCompanyService->registerCompany($id);
|
|
|
- $list = DB::table('spring_jobs')->where(array('company_id'=>$res['id']))->get();
|
|
|
- $this->membersSetmealService->addMemberSetmeal($res['company'], config('aix.companyset.setmeal_com.setmeal_com_set.reg_service'));
|
|
|
- foreach ($list as $k => $v){
|
|
|
- $this->jobsService->jobSaveBySpring($v,$res['company']->id);
|
|
|
+ /**
|
|
|
+ * 微信回调
|
|
|
+ */
|
|
|
+ public function jkq_wechat_back(Request $request)
|
|
|
+ {
|
|
|
+ //微信登录
|
|
|
+ $officialAccount = $this->wechatService->getOfficialAccount();
|
|
|
+ $wechatUser = $officialAccount->oauth->user()->getOriginal();
|
|
|
+ $thirdlogin = Thirdlogin::where('openid', $wechatUser['openid'])->first();
|
|
|
+ if (!$thirdlogin && $wechatUser['unionid']) {
|
|
|
+ $thirdlogin = Thirdlogin::where('unionid', $wechatUser['unionid'])->first();
|
|
|
}
|
|
|
- $msg['status'] = 'ok';
|
|
|
- echo json_encode($msg);
|
|
|
+ if ($thirdlogin) {
|
|
|
+ $member = $thirdlogin->member()->withTrashed()->first();
|
|
|
+ $this->authService->login($member, 1);
|
|
|
+ } else {
|
|
|
+ Session::put('open_id', $wechatUser['openid']);
|
|
|
+ Session::put('union_id', $wechatUser['unionid'] ?: '');
|
|
|
+ Session::save();
|
|
|
+ }
|
|
|
+ $state = $request->input('state', '');
|
|
|
+ $state = explode('_', $state);
|
|
|
+ $url = route('mobile.active.spring_special_jkq', ['type' => $state[0], 'source' => $state[1]]);
|
|
|
+ return redirect($url);
|
|
|
}
|
|
|
|
|
|
- public function verify(){
|
|
|
- return view('mobile.app.active.verify');
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 直播专用页
|
|
|
+ */
|
|
|
+ public function special_live(Request $request)
|
|
|
+ {
|
|
|
+ if (!$request->ajax()) {
|
|
|
+ //奖品列表
|
|
|
+ $prize = LotteryPrize::all();
|
|
|
+ }
|
|
|
+ $offset = isset($request->page) ? $request->page : 0;
|
|
|
+ $limit = 8;
|
|
|
+
|
|
|
+ $citycategory = 'jjkfq';
|
|
|
+ $companys = DB::table('jobs')->join('companys', 'jobs.company_id', '=', 'companys.id')->whereRaw("jobs.updated_at > '2022-01-01 00:00:00' and jobs.deleted_at is null")->groupBy('jobs.company_id')->select('jobs.company_id')->pluck('company_id')->toArray();
|
|
|
+
|
|
|
+
|
|
|
+ $citys = $this->categoryService->getCitys($citycategory);
|
|
|
+ $select_id = $citys['select']['id'];
|
|
|
+ $district_str = "(district like ? or district like ?)";
|
|
|
+ $district_arr = ["%.{$select_id}%", "%{$select_id}.%"];
|
|
|
+
|
|
|
+ $where = [];
|
|
|
+ $where[] = ['user_status', '=', 1];
|
|
|
+ $where[] = ['audit', '=', 1];
|
|
|
+ $where[] = ['deleted_at', '=', null];
|
|
|
+
|
|
|
+ $list = DB::table('companys')->where($where)->whereRaw($district_str, $district_arr)->whereIn('id', $companys)->orderBy('sort_index', 'desc')->orderBy('id', 'desc')->offset($limit * $offset)->limit($limit)->get();
|
|
|
+ $more = count($list) >= $limit ? true : false;
|
|
|
+
|
|
|
+ $res = [];
|
|
|
+ foreach ($list as $val) {
|
|
|
|
|
|
- public function test(){
|
|
|
+ $item = [
|
|
|
+ 'id' => $val->id,
|
|
|
+ 'companyname' => $val->companyname,
|
|
|
+ 'jobs' => [],
|
|
|
+ 'tag_arr' => [],
|
|
|
+ ];
|
|
|
|
|
|
- $this->smsService->sendSms('18060002035','sms_custom',array('username'=>'测试','phone'=>'18060002035','content'=>'聚才网'));
|
|
|
+ //在招职位
|
|
|
+ $jobs_where = [
|
|
|
+ ['company_id', '=', $val->id],
|
|
|
+ ['valid', '=', 1],
|
|
|
+ ['display', '=', 1],
|
|
|
+ ['audit', '=', 1],
|
|
|
+ ['deleted_at', '=', null],
|
|
|
+ ];
|
|
|
+
|
|
|
+ $jobs = DB::table('jobs')->where($jobs_where)->get();
|
|
|
+ if (!$jobs->isEmpty()) {
|
|
|
+ foreach ($jobs as $value) {
|
|
|
+ $job = [
|
|
|
+ 'id' => $value->id,
|
|
|
+ 'jobs_name' => $value->jobs_name,
|
|
|
+ 'amount' => $value->amount,
|
|
|
+ 'wage' => $value->wage,
|
|
|
+ 'wage_min' => $value->wage_min,
|
|
|
+ 'wage_max' => $value->wage_max,
|
|
|
+ 'wage_str' => $value->wage_str,
|
|
|
+ ];
|
|
|
+ array_push($item['jobs'], $job);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //企业福利
|
|
|
+ if (!empty($val->tag)) {
|
|
|
+ $tags = explode(',', $val->tag);
|
|
|
+ $tag_arr = DB::table('categorys')->whereIn('id', $tags)->limit(3)->get(['demand'])->toArray();
|
|
|
+ $item['tag_arr'] = $tag_arr;
|
|
|
+ }
|
|
|
+
|
|
|
+ array_push($res, $item);
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($request->ajax()) {
|
|
|
+ if (count($res)) {
|
|
|
+ return response()->json(['status' => 1, 'data' => view('mobile.app.active.ajax.ajax_spring_special_com', [
|
|
|
+ 'res' => $res,
|
|
|
+ 'more' => $more,
|
|
|
+ ])->render()]);
|
|
|
+ }
|
|
|
+ return response()->json(['status' => 0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ return view('mobile.app.active.spring_special_live', [
|
|
|
+ 'params' => ['citycategory' => 'jjkfq'],
|
|
|
+ 'current_url' => \Illuminate\Support\Facades\Request::getRequestUri(),
|
|
|
+ 'res' => $res,
|
|
|
+ 'more' => $more,
|
|
|
+ 'prize' => $prize,
|
|
|
+ 'share_title' => '【福利通知】免费找工作,抽大奖拿好礼',
|
|
|
+ 'share_desc' => '晋江好福利!免费找工作、找人才,还能抽奖,100%中奖,万份好礼免费拿!',
|
|
|
+ 'share_image_url' => theme_asset('mobile/images/online2021/share_logo.jpg'),
|
|
|
+ 'live_list' => $this->homeService->getSpringLive(),
|
|
|
+ ]);
|
|
|
}
|
|
|
}
|