Ver código fonte

新春招聘会

linwu 3 anos atrás
pai
commit
a193e92ca1

+ 0 - 528
app/Http/Controllers/Mobile/Active/Online2021Controller.php

@@ -1,528 +0,0 @@
-<?php
-
-namespace App\Http\Controllers\Mobile\Active;
-
-use App\Http\Controllers\Mobile\MobileBaseController;
-use App\Models\LotteryLog;
-use App\Models\LotteryPrize;
-use App\Models\LotteryWin;
-use App\Models\Thirdlogin;
-use App\Services\Common\CategoryService;
-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\DB;
-use Illuminate\Support\Facades\Session;
-
-class Online2021Controller extends MobileBaseController
-{
-    private $wechatService;
-    protected $categoryService;
-    protected $authService;
-    protected $homeService;
-
-    public function __construct(WechatService $wechatService, CategoryService $categoryService, authService $authService, HomeService $homeService)
-    {
-        $this->wechatService   = $wechatService;
-        $this->categoryService = $categoryService;
-        $this->authService     = $authService;
-        $this->homeService     = $homeService;
-    }
-
-    /**
-     * 专题页
-     */
-    public function index(Request $request)
-    {
-        //是否登录
-        $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->getOnline2021Live(),
-        ];
-
-        return view('mobile.app.active.online2021', $return_data);
-    }
-
-    /**
-     * 专区页
-     */
-    public function special(Request $request)
-    {
-        $offset = isset($request->page) ? $request->page : 0;
-        $limit  = 8;
-
-        $citycategory = $request->input('citycategory', '');
-        $trade        = $request->input('trade', '');
-        $param_array  = ['citycategory', 'trade', 'nature'];
-
-        $params = [];
-        if ($request->all()) {
-            foreach ($request->all() as $k => $v) {
-                if (in_array($k, $param_array) && $v) {
-                    $params[$k] = $v;
-                }
-            }
-        }
-
-        $filter_where = [
-            'AIX_trade'        => 100,
-            'AIX_company_type' => 100,
-        ];
-        $categories   = $this->categoryService->getCategories($filter_where);
-
-        $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 > '2021-01-01 00:00:00' and jobs.deleted_at is null")->groupBy('jobs.company_id')->select('jobs.company_id')->pluck('company_id')->toArray();
-
-        $where   = [];
-        $where[] = ['user_status', '=', 1];
-        $where[] = ['audit', '=', 1];
-        $where[] = ['deleted_at', '=', null];
-        if (!empty($trade)) {
-            $where[] = ['trade', '=', $trade];
-        }
-
-        $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,
-                    ];
-                    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_online2021_special_com', [
-                    'res'        => $res,
-                    'city'       => $citys,
-                    'params'     => $params,
-                    'categories' => $categories,
-                    'more'       => $more,
-                ])->render()]);
-            }
-            return response()->json(['status' => 0]);
-        }
-
-        return view('mobile.app.active.online2021_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.online2021_special') . '?citycategory=' . $citycategory,
-        ]);
-    }
-
-    /**
-     * 经开区专区页
-     */
-    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.online2021_jkq_login', ['type' => $type, 'source' => $source]));
-                }
-            } else {
-                $third   = Thirdlogin::where('uid', $user->id)->first();
-                $open_id = $third['openid'];
-            }
-
-//            $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 > '2021-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_online2021_special_com', [
-                    'res'  => $res,
-                    'more' => $more,
-                ])->render()]);
-            }
-            return response()->json(['status' => 0]);
-        }
-
-        return view('mobile.app.active.online2021_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->getOnline2021Live(),
-        ]);
-    }
-
-    /**
-     * 微信登录
-     */
-    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.online2021_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 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();
-        }
-        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.online2021_special_jkq', ['type' => $state[0], 'source' => $state[1]]);
-        return redirect($url);
-    }
-
-    /**
-     * 直播专用页
-     */
-    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 > '2021-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_online2021_special_com', [
-                    'res'  => $res,
-                    'more' => $more,
-                ])->render()]);
-            }
-            return response()->json(['status' => 0]);
-        }
-
-        return view('mobile.app.active.online2021_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->getOnline2021Live(),
-        ]);
-    }
-}

+ 209 - 0
app/Http/Controllers/Mobile/Active/Spring1Controller.php

@@ -0,0 +1,209 @@
+<?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\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 Illuminate\Support\Facades\Cache;
+use Illuminate\Support\Facades\Hash;
+use App\Services\Common\MembersSetmealService;
+
+class Spring1Controller extends MobileBaseController
+{
+    protected $springJobService;
+    protected $springCompanyService;
+    protected $categoryService;
+    protected $resumeService;
+    protected $jobsService;
+    protected $smsService;
+    private $membersSetmealService;
+
+    public function __construct(SpringJobService $springJobService,SpringCompanyService $springCompanyService,CategoryService $categoryService,ResumeService $resumeService,JobsService $jobsService, SmsService $smsService, MembersSetmealService $membersSetmealService)
+    {
+        $this->springJobService = $springJobService;
+        $this->springCompanyService = $springCompanyService;
+        $this->categoryService = $categoryService;
+        $this->resumeService = $resumeService;
+        $this->jobsService = $jobsService;
+        $this->smsService = $smsService;
+        $this->membersSetmealService = $membersSetmealService;
+    }
+
+    public function enterprise(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
+            ]);
+        }
+
+    }
+
+    public function uploadfile(Request $request)
+    {
+        $file = $request->file('files');
+        if($file ->isValid()) { //判断文件是否存在
+            //获取文件的扩展名
+            $ext = $file->getClientOriginalExtension();
+
+            //获取文件的绝对路径
+            $path = $file->getRealPath();
+
+            $oldname= $file->getClientOriginalName();
+
+            //定义文件名
+            $filename = date('Y-m-d-h-i-s').'.'.$ext;
+
+            //存储文件。disk里面的public。总的来说,就是调用disk模块里的public配置
+            Storage::disk('public')->put($filename, file_get_contents($path));
+
+        }
+
+        $res['status'] = 1;
+        $res['filename'] = $oldname;
+        $res['path'] = "/storage/".$filename;
+
+        return response()->json($res);
+    }
+
+    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'=>'新春招聘会报名登记表'
+        ]);
+    }
+
+    public function jobHunterRegister(PersonValidatorRequest $request){
+        //添加基础信息
+        $resume_res = $this->resumeService->activeResumeCreate($request->except(['add_tag','_token']), auth('web-member')->user());
+
+        if ($resume_res['code']==1) {
+            return $this->sendSuccessResponse(['id'=>'登记成功','tag'=>$request->add_tag]);
+        } else {
+            return $this->sendErrorResponse('更新简历失败', '', 400);
+        }
+    }
+
+    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 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);
+        }
+        $msg['status'] = 'ok';
+        echo json_encode($msg);
+    }
+
+    public function verify(){
+        return view('mobile.app.active.verify');
+    }
+
+    public function test(){
+
+        $this->smsService->sendSms('18060002035','sms_custom',array('username'=>'测试','phone'=>'18060002035','content'=>'聚才网'));
+    }
+}

+ 482 - 163
app/Http/Controllers/Mobile/Active/SpringController.php

@@ -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(),
+        ]);
     }
 }

+ 1 - 1
app/Http/Controllers/Mobile/Lottery/LotteryController.php

@@ -63,7 +63,7 @@ class LotteryController extends MobileBaseController
             Session::save();
         }
         $type = $request->input('state', 1);
-        $url  = route('mobile.active.online2021', ['type' => $type]);
+        $url  = route('mobile.active.spring', ['type' => $type]);
         return redirect($url);
     }
 

+ 3 - 3
app/Http/Controllers/Web/Active/JobfairController.php

@@ -401,7 +401,7 @@ class JobfairController extends WebBaseController
             $district_arr = ["%.{$select_id}%", "%{$select_id}.%"];
         }
 
-        $companys = DB::table('jobs')->join('companys', 'jobs.company_id', '=', 'companys.id')->whereRaw("jobs.created_at > '2021-01-01 00:00:00' and jobs.deleted_at is null")->groupBy('jobs.company_id')->select('jobs.company_id')->pluck('company_id')->toArray();
+        $companys = DB::table('jobs')->join('companys', 'jobs.company_id', '=', 'companys.id')->whereRaw("jobs.created_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();
 
 //        echo '<pre>';
 //
@@ -530,7 +530,7 @@ class JobfairController extends WebBaseController
         $limit = 40;
 
         $citycategory = 'jjkfq';
-        $companys     = DB::table('jobs')->join('companys', 'jobs.company_id', '=', 'companys.id')->whereRaw("jobs.updated_at > '2021-01-01 00:00:00' and jobs.deleted_at is null")->groupBy('jobs.company_id')->select('jobs.company_id')->pluck('company_id')->toArray();
+        $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'];
@@ -632,7 +632,7 @@ class JobfairController extends WebBaseController
         $limit  = 18;
 
         $citycategory = 'jjkfq';
-        $companys     = DB::table('jobs')->join('companys', 'jobs.company_id', '=', 'companys.id')->whereRaw("jobs.updated_at > '2021-01-01 00:00:00' and jobs.deleted_at is null")->groupBy('jobs.company_id')->select('jobs.company_id')->pluck('company_id')->toArray();
+        $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'];

+ 6 - 6
app/Services/HomeService.php

@@ -131,14 +131,14 @@ class HomeService
         return (object)['morning'=>$Morning,'noon'=>$Noon,'night'=>$Night];
     }
 
-    public function getOnline2021Live()
+    public function getSpringLive()
     {
         $arr = [
-            ['name'=>'中高层次人才专场','images'=>theme_asset('mobile/images/online2021/qrcode_high_level.png').'?v=1','time'=>'2021年2月19日 15:00-17:00','company'=>'福建省力诚食品有限公司,晋江海纳机械有限公司,晋江市连天红食品有限责任公司,福建省悦健护理用品有限公司','status'=>'end','url'=>'https://wx.vzan.com/live/tvchat-232395887?v=1614827835949#/'],
-            ['name'=>'综合专场','images'=>theme_asset('mobile/images/online2021/qrcode_multiple_level.png').'?v=1','time'=>'2021年2月24日 15:00-17:00','company'=>'冠达星股份有限公司,晋江海纳机械有限公司,蜡笔小新(福建)食品工业有限公司,盼盼食品集团,向兴(中国)集团有限公司','status'=>'end','url'=>'https://wx.vzan.com/live/tvchat-1739841310?v=1614827835948#/'],
-            ['name'=>'普工专场','images'=>theme_asset('mobile/images/online2021/qrcode_worker.png').'?v=1','time'=>'2021年2月26日 15:00-17:00','company'=>'三六一度(中国)有限公司,福建美明达鞋业发展有限公司,利郎(中国)有限公司,晋江市成达齿轮有限公司,信泰(福建)科技有限公司,福建力利实业有限公司','status'=>'end','url'=>'https://wx.vzan.com/live/tvchat-225368614?v=1614827835947#/'],
-            ['name'=>'经营管理专场','images'=>theme_asset('mobile/images/online2021/qrcode_manage.png').'?v=1','time'=>'2021年2月28日 15:00-17:00','company'=>'焙之味食品(福建)有限公司,信泰(福建)科技有限公司,福建省力诚食品有限公司,金冠食品(福建)有限公司,泉州市嘉利儿童用品有限公司','status'=>'end','url'=>'https://wx.vzan.com/live/tvchat-1760289850?v=1614827835946#/'],
-            ['name'=>'毕业生专场','images'=>theme_asset('mobile/images/online2021/qrcode_graduate.png').'?v=1','time'=>'2021年3月2日 15:00-17:00','company'=>'福建佶龙机械科技股份有限公司,婴舒宝(中国)有限公司,晋江市连天红食品有限责任公司,泉州佳德美电子科技有限公司,晋江市百丝达服装材料有限公司','status'=>'end','url'=>'https://wx.vzan.com/live/tvchat-589649355?v=1614827835945#/'],
+            ['name'=>'硕博专场','images'=>theme_asset('mobile/images/online2021/qrcode_high_level.png').'?v=1','time'=>'2022年1月14日 15:00-17:00','company'=>'','status'=>'end','url'=>'https://wx.vzan.com/live/tvchat-232395887?v=1614827835949#/'],
+            ['name'=>'省外专场','images'=>theme_asset('mobile/images/online2021/qrcode_multiple_level.png').'?v=1','time'=>'2022年1月27日 15:00-17:00','company'=>'','status'=>'unstart','url'=>'https://wx.vzan.com/live/tvchat-1739841310?v=1614827835948#/'],
+            ['name'=>'综合专场','images'=>theme_asset('mobile/images/online2021/qrcode_worker.png').'?v=1','time'=>'2022年2月8日-10日 10:00-12:00','company'=>'','status'=>'unstart','url'=>'https://wx.vzan.com/live/tvchat-225368614?v=1614827835947#/'],
+            ['name'=>'省外专场','images'=>theme_asset('mobile/images/online2021/qrcode_manage.png').'?v=1','time'=>'以新春晋江市企业赴云南招聘会时间为准','company'=>'','status'=>'unstart','url'=>'https://wx.vzan.com/live/tvchat-1760289850?v=1614827835946#/'],
+            ['name'=>'零工专场','images'=>theme_asset('mobile/images/online2021/qrcode_graduate.png').'?v=1','time'=>'以零工市场建成揭幕仪式时间为准','company'=>'','status'=>'unstart','url'=>'https://wx.vzan.com/live/tvchat-589649355?v=1614827835945#/'],
         ];
 
         return $arr;

BIN
public/themes/default/assets/mobile/images/spring/header_2022.jpg


+ 1 - 1
public/themes/default/views/app/active/ai_recruit.blade.php

@@ -66,7 +66,7 @@
                                 </div>
                                 <div class="qrcode_box">
                                     <div id="qrcode_{{$v2['id']}}" class="qrcode">
-                                        {{--<img src="{{theme_asset('app/images/online2021/jkq_qrcode.png')}}" alt="">--}}
+                                        {{--<img src="{{theme_asset('app/images/spring/jkq_qrcode.png')}}" alt="">--}}
                                     </div>
                                     <script>
                                         new QRCode(document.getElementById("qrcode_{{$v2['id']}}"), {

+ 0 - 0
public/themes/default/views/mobile/app/active/ajax/ajax_online2021_special_com.blade.php → public/themes/default/views/mobile/app/active/ajax/ajax_spring_special_com.blade.php


+ 52 - 28
public/themes/default/views/mobile/app/active/online2021.blade.php → public/themes/default/views/mobile/app/active/spring.blade.php

@@ -15,7 +15,7 @@
 
 @section('content')
     <div class="online2021_header">
-        <img src="{{theme_asset('mobile/images/online2021/header.jpg')}}?v=2">
+        <img src="{{theme_asset('mobile/images/spring/header_2022.jpg')}}">
     </div>
 
     <div class="online2021_title">
@@ -26,35 +26,35 @@
     </div>
     <div class="online2021_special">
         <ul>
-            <a href="{{route('mobile.active.online2021_special')}}">
+            <a href="{{route('mobile.active.spring_special')}}">
                 <li>
                     <div class="special_box">
                         <p>>>全晋江<<</p>
                     </div>
                 </li>
             </a>
-            <a href="{{route('mobile.active.online2021_special_jkq')}}">
+            <a href="{{route('mobile.active.spring_special_jkq')}}">
                 <li>
                     <div class="special_box">
                         <p>>>经济开发区专区<<</p>
                     </div>
                 </li>
             </a>
-            <a href="{{route('mobile.active.online2021_special',['citycategory'=>'anhaizhen'])}}">
+            <a href="{{route('mobile.active.spring_special',['citycategory'=>'anhaizhen'])}}">
                 <li>
                     <div class="special_box">
                         <p>>>安海镇专区<<</p>
                     </div>
                 </li>
             </a>
-            <a href="{{route('mobile.active.online2021_special',['citycategory'=>'xintangjiedao'])}}">
+            <a href="{{route('mobile.active.spring_special',['citycategory'=>'xintangjiedao'])}}">
                 <li>
                     <div class="special_box">
                         <p>>>新塘街道专区<<</p>
                     </div>
                 </li>
             </a>
-            <a href="{{route('mobile.active.online2021_special',['citycategory'=>'neikengzhen'])}}">
+            <a href="{{route('mobile.active.spring_special',['citycategory'=>'neikengzhen'])}}">
                 <li>
                     <div class="special_box">
                         <p>>>内坑镇专区<<</p>
@@ -97,9 +97,43 @@
         <p>晋江市新春线下招聘会</p>
     </div>
     <div class="online2021_job_fair">
-        <p>
-            新年新气象,新年新希望,为持续做好就业服务保障工作,助力企业发展,促进劳动者就业创业,现定于2月18日-2月28日举办“牛转薪机”2021年晋江市新春线下招聘会。此次招聘会将分为10个分会场,组织200家企业参加,共提供1500个岗位,招聘3000人。</p>
-        <div class="btn btn_one">了解详情</div>
+        <table border="1" style="width:90%;margin:0 auto 20px auto;" cellpadding="0" cellspacing="0">
+            <tr>
+                <th>场次</th>
+                <th>时间</th>
+                <th>地点</th>
+            </tr>
+            <tr>
+                <td>综合性人才专场</td>
+                <td>2月8日-10日(正月初八-初十)09:00-17:00</td>
+                <td>晋江经济开发区五里万业汇商业广场(中源路)</td>
+            </tr>
+            <tr>
+                <td>综合性人才专场</td>
+                <td>2月8日(正月初八)09:00-12:00</td>
+                <td>晋江市和平广场海峡青年人才社区</td>
+            </tr>
+            <tr>
+                <td>毕业生专场</td>
+                <td>2月11日(正月十一)14:00-17:00</td>
+                <td>晋江市和平广场海峡共享空间一楼</td>
+            </tr>
+            <tr>
+                <td>人力行政、财会电商专场</td>
+                <td>2月12日(正月十二)14:00-17:00</td>
+                <td>晋江市和平广场海峡共享空间一楼</td>
+            </tr>
+            <tr>
+                <td>综合性人才专场</td>
+                <td>2月15日(正月十五)14:00-17:00</td>
+                <td>晋江市宝龙广场一楼中庭</td>
+            </tr>
+            <tr>
+                <td>互联网+工业制造企业专场</td>
+                <td>2月18日(正月十八)14:00-17:00</td>
+                <td>晋江市阳光广场</td>
+            </tr>
+        </table>
     </div>
 
     <div class="online2021_title">
@@ -110,35 +144,25 @@
             <tr>
                 <th>时间</th>
                 <th>路线安排</th>
-                <th>为期</th>
-            </tr>
-            <tr>
-                <td>正月初九(以对方招聘会为准)</td>
-                <td>云南省昆明市、保山市</td>
-                <td>七天</td>
             </tr>
             <tr>
-                <td>正月十一(以对方招聘会为准)</td>
-                <td>贵州省黔西南州、遵义市</td>
-                <td>七天</td>
+                <td>2022年2月8日</td>
+                <td>贵州关岭、晴隆劳务协作</td>
             </tr>
             <tr>
-                <td>正月十六(以对方招聘会为准)</td>
-                <td>河南省郑州市、洛阳市、云南省梁河县</td>
-                <td>五天</td>
+                <td>2022年2月10日</td>
+                <td>贵州习水、绥阳劳务协作</td>
             </tr>
             <tr>
-                <td>正月二十三(以对方招聘会为准)</td>
-                <td>四川省成都市、广安市、巴中市</td>
-                <td>七天</td>
+                <td>2022年2月份</td>
+                <td>云南保山市劳务协作</td>
             </tr>
             <tr>
-                <td>以对方招聘会为准</td>
-                <td>甘肃省兰州市、武威市</td>
-                <td>五天</td>
+                <td>2022年2月份</td>
+                <td>云南红河州劳务协作</td>
             </tr>
         </table>
-        <div class="btn btn_one"><a href="https://mp.weixin.qq.com/s/yX4FLywTCdH8JEhxVogJZQ">了解详情</a></div>
+        {{--<div class="btn btn_one"><a href="https://mp.weixin.qq.com/s/yX4FLywTCdH8JEhxVogJZQ">了解详情</a></div>--}}
         <div class="clear"></div>
     </div>
 

+ 4 - 4
public/themes/default/views/mobile/app/active/online2021_special.blade.php → public/themes/default/views/mobile/app/active/spring_special.blade.php

@@ -32,7 +32,7 @@
 @endpush
 @section('content')
     <div class="online2021_header">
-        <img src="{{theme_asset('mobile/images/online2021/header.jpg')}}?v=2">
+        <img src="{{theme_asset('mobile/images/spring/header_2022.jpg')}}?v=2">
     </div>
     <div class="online2021_title">
         <p>{{$title}}</p>
@@ -100,7 +100,7 @@
                     @endif
                 </div>
                 <div class="f-btn-submit qs-center">
-                    <div onclick="window.location='{{route("mobile.active.online2021_special",array_merge($params, array("trade"=>"")))}}';" class="qs-btn qs-btn-inline qs-btn-medium qs-btn-orange">
+                    <div onclick="window.location='{{route("mobile.active.spring_special",array_merge($params, array("trade"=>"")))}}';" class="qs-btn qs-btn-inline qs-btn-medium qs-btn-orange">
                         不限
                     </div>
                 </div>
@@ -169,7 +169,7 @@
 @section('script')
     <script>
         function goPage() {
-            var toSearchPage = "{{route('mobile.active.online2021_special')}}";
+            var toSearchPage = "{{route('mobile.active.spring_special')}}";
             window.location.href = toSearchPage + '?'+$('#searchForm').serialize();
         }
 
@@ -222,7 +222,7 @@
             var page = $(".load_more_footer span").attr('page');
             $.ajax({
                 type:"get",
-                url:"{{ route('mobile.active.online2021_special',$params) }}",
+                url:"{{ route('mobile.active.spring_special',$params) }}",
                 data:{
                     page:page
                 },

+ 2 - 2
public/themes/default/views/mobile/app/active/online2021_special_jkq.blade.php → public/themes/default/views/mobile/app/active/spring_special_jkq.blade.php

@@ -563,7 +563,7 @@
         });
 
         function goPage() {
-            var toSearchPage = "{{route('mobile.active.online2021_special')}}";
+            var toSearchPage = "{{route('mobile.active.spring_special')}}";
             window.location.href = toSearchPage + '?' + $('#searchForm').serialize();
         }
 
@@ -618,7 +618,7 @@
             var page = $(".load_more_footer span").attr('page');
             $.ajax({
                 type: "get",
-                url: "{{ route('mobile.active.online2021_special',$params) }}",
+                url: "{{ route('mobile.active.spring_special',$params) }}",
                 data: {
                     page: page
                 },

+ 3 - 3
public/themes/default/views/mobile/app/active/online2021_special_live.blade.php → public/themes/default/views/mobile/app/active/spring_special_live.blade.php

@@ -185,7 +185,7 @@
             <p class="lottery_description">
                 <span class="description_content">经济开发区领奖热线:0595-85200580。</span>
             </p>
-            <a href="{{route('mobile.active.online2021_special_jkq')}}">
+            <a href="{{route('mobile.active.spring_special_jkq')}}">
                 <div class="btn btn_one">点击进入抽奖页</div>
             </a>
         </div>
@@ -311,7 +311,7 @@
         });
 
         function goPage() {
-            var toSearchPage = "{{route('mobile.active.online2021_special')}}";
+            var toSearchPage = "{{route('mobile.active.spring_special_special')}}";
             window.location.href = toSearchPage + '?' + $('#searchForm').serialize();
         }
 
@@ -366,7 +366,7 @@
             var page = $(".load_more_footer span").attr('page');
             $.ajax({
                 type: "get",
-                url: "{{ route('mobile.active.online2021_special',$params) }}",
+                url: "{{ route('mobile.active.spring_special',$params) }}",
                 data: {
                     page: page
                 },

+ 1 - 1
public/themes/default/views/mobile/module/section/online_footer.blade.php

@@ -6,7 +6,7 @@
                 <div class="b-img"></div>
                 <div class="b-txt font10">首页</div>
             </a>
-            <a href="{{route('mobile.active.online2021',['type'=>1])}}"
+            <a href="{{route('mobile.active.spring',['type'=>1])}}"
                class="bar-cell job @if(strripos( url($current_url), route('mobile.jobs')) !== false) active @endif">
                 <div class="b-img"></div>
                 <div class="b-txt font10">新春招聘会</div>

+ 6 - 6
routes/mobile.php

@@ -91,12 +91,12 @@ Route::group([
         $router->get('rcg/service_code','Mobile\Active\RcgController@serviceCode')->name('mobile.rcg.serviceCode');
 
         /*新春招聘会*/
-        $router->get('online2021/{type}', 'Mobile\Active\Online2021Controller@index')->name('mobile.active.online2021');
-        $router->get('online2021_special', 'Mobile\Active\Online2021Controller@special')->name('mobile.active.online2021_special');
-        $router->get('online2021_special/jkq', 'Mobile\Active\Online2021Controller@special_jkq')->name('mobile.active.online2021_special_jkq');
-        $router->get('online2021_jkq_login', 'Mobile\Active\Online2021Controller@jkq_login')->name('mobile.active.online2021_jkq_login');
-        $router->get('online2021_jkq_wechat_back', 'Mobile\Active\Online2021Controller@jkq_wechat_back')->name('mobile.active.online2021_jkq_wechat_back');
-        $router->get('online2021_special/live', 'Mobile\Active\Online2021Controller@special_live')->name('mobile.active.online2021_special_live');
+        $router->get('spring/{type}', 'Mobile\Active\SpringController@index')->name('mobile.active.spring');
+        $router->get('spring_special', 'Mobile\Active\SpringController@special')->name('mobile.active.spring_special');
+        $router->get('spring_special/jkq', 'Mobile\Active\SpringController@special_jkq')->name('mobile.active.spring_special_jkq');
+        $router->get('spring_jkq_login', 'Mobile\Active\SpringController@jkq_login')->name('mobile.active.spring_jkq_login');
+        $router->get('spring_jkq_wechat_back', 'Mobile\Active\SpringController@jkq_wechat_back')->name('mobile.active.spring_jkq_wechat_back');
+        $router->get('spring_special/live', 'Mobile\Active\SpringController@special_live')->name('mobile.active.spring_special_live');
     });
 });