| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 | 
							- <?php
 
- /**
 
-  * Created by PhpStorm.
 
-  * User: michaelwu
 
-  * Date: 2018/10/31
 
-  * Time: 10:02
 
-  */
 
- namespace App\Http\Controllers\Mobile\Company;
 
- use App\Http\Controllers\Mobile\MobileBaseController;
 
- use App\Models\CompanyTalent;
 
- use App\Models\CompanyTalentBase;
 
- use App\Models\CompanyTalentNeed;
 
- use App\Models\CompanyTalentSuggest;
 
- use Illuminate\Http\Request;
 
- class TalentController extends MobileBaseController
 
- {
 
-     private $_sub_site = '';
 
-     public function __construct()
 
-     {
 
-         if (get_subsite_id() > 0) {
 
-             $this->_sub_site = 'jkq.';
 
-         }
 
-     }
 
-     /**
 
-      * 人才管理
 
-      */
 
-     public function index()
 
-     {
 
-         $company = auth('web-company')->user();
 
-         $base    = CompanyTalentBase::where('id', $company->id)->first();
 
-         if (empty($base)) {
 
-             return redirect(route($this->_sub_site . 'mobile.company.talent.base_info'));
 
-         }
 
-         return view('mobile.app.company.talent.index', ['wap_title' => '人才管理', 'company' => $company, 'base' => $base]);
 
-     }
 
-     /**
 
-      * 企业基础信息
 
-      */
 
-     public function baseInfo()
 
-     {
 
-         $company = auth('web-company')->user();
 
-         $base    = CompanyTalentBase::where('id', $company->id)->first();
 
-         if (empty($base)) {
 
-             $base = [
 
-                 'company_grade'    => 1,
 
-                 'laboratory_grade' => 1,
 
-             ];
 
-         }
 
-         $data = [
 
-             'wap_title'        => '企业基础信息',
 
-             'company'          => $company,
 
-             'base'             => $base,
 
-             'company_grade'    => CompanyTalentBase::$company_grade,
 
-             'laboratory_grade' => CompanyTalentBase::$laboratory_grade,
 
-         ];
 
-         return view('mobile.app.company.talent.base_info', $data);
 
-     }
 
-     /**
 
-      * 提交基础信息
 
-      */
 
-     public function baseInfoSave(Request $request)
 
-     {
 
-         $company = auth('web-company')->user();
 
-         $data    = $request->all();
 
-         foreach ($data as &$v) {
 
-             if (empty($v)) {
 
-                 $v = 0;
 
-             }
 
-         }
 
-         $data['updated_at'] = date('Y-m-d H:i:s');
 
-         $base               = CompanyTalentBase::where('id', $company->id)->first();
 
-         if (empty($base)) {
 
-             $data['id'] = $company->id;
 
-             CompanyTalentBase::create($data);
 
-         } else {
 
-             CompanyTalentBase::where('id', $company->id)->update($data);
 
-         }
 
-         return $this->sendSuccessResponse();
 
-     }
 
-     /**
 
-      * 人才信息
 
-      */
 
-     public function talentList(Request $request)
 
-     {
 
-         $company = auth('web-company')->user();
 
-         $size = 8;
 
-         $rst  = CompanyTalent::where('company_id', $company->id)->paginate($size);
 
-         if ($request->ajax()) {
 
-             if ($rst->lastPage() < $rst->currentPage()) {
 
-                 return response()->json(['status' => 0]);
 
-             }
 
-             return response()->json(['status' => 1, 'data' => view('mobile.app.company.talent.ajax_talent_list', ['list' => $rst])->render()]);
 
-         }
 
-         $mobile_dropload = false;
 
-         if ($rst->total() > $size) {
 
-             $mobile_dropload = true;
 
-         }
 
-         $return_data = [
 
-             'list'            => $rst,
 
-             'current_url'     => \Illuminate\Support\Facades\Request::getRequestUri(),
 
-             'wap_title'       => '人才信息列表',
 
-             'mobile_dropload' => $mobile_dropload,
 
-             'back_url'        => route('mobile.company.talent.index'),
 
-         ];
 
-         return view('mobile.app.company.talent.talent_list', $return_data);
 
-     }
 
-     /**
 
-      * 人才删除
 
-      */
 
-     public function talentDelete(Request $request)
 
-     {
 
-         $id  = $request->input('id');
 
-         $res = CompanyTalent::destroy($id);
 
-         if ($res) {
 
-             return response()->json(['status' => 1, 'msg' => '删除成功']);
 
-         } else {
 
-             return response()->json(['status' => 0, 'msg' => '网络问题,请刷新重试']);
 
-         }
 
-     }
 
-     /**
 
-      * 人才信息
 
-      */
 
-     public function talentInfo(Request $request)
 
-     {
 
-         $id   = $request->input('id');
 
-         $info = [];
 
-         if (!empty($id)) {
 
-             $info = CompanyTalent::where('id', $id)->first();
 
-         }
 
-         return view('mobile.app.company.talent.talent_info', ['info' => $info, 'wap_title' => '人才信息']);
 
-     }
 
-     /**
 
-      * 人才信息保存
 
-      */
 
-     public function talentInfoSave(Request $request)
 
-     {
 
-         $data = $request->all();
 
-         if (empty($data['id'])) {
 
-             $company            = auth('web-company')->user();
 
-             $data['company_id'] = $company->id;
 
-             CompanyTalent::create($data);
 
-         } else {
 
-             CompanyTalent::where('id', $data['id'])->update($data);
 
-         }
 
-         return $this->sendSuccessResponse();
 
-     }
 
-     /**
 
-      * 意见建议
 
-      */
 
-     public function talentSuggest()
 
-     {
 
-         return view('mobile.app.company.talent.talent_suggest', ['wap_title' => '意见建议']);
 
-     }
 
-     /**
 
-      * 意见建议保存
 
-      */
 
-     public function talentSuggestSave(Request $request)
 
-     {
 
-         $data = $request->all();
 
-         foreach ($data as &$v) {
 
-             if (empty($v)) {
 
-                 $v = '';
 
-             }
 
-         }
 
-         $company            = auth('web-company')->user();
 
-         $data['company_id'] = $company->id;
 
-         CompanyTalentSuggest::create($data);
 
-         return $this->sendSuccessResponse();
 
-     }
 
-     /**
 
-      * 人才需求列表
 
-      */
 
-     public function needList(Request $request)
 
-     {
 
-         $company = auth('web-company')->user();
 
-         $size = 8;
 
-         $rst  = CompanyTalentNeed::where('company_id', $company->id)->paginate($size);
 
-         if ($request->ajax()) {
 
-             if ($rst->lastPage() < $rst->currentPage()) {
 
-                 return response()->json(['status' => 0]);
 
-             }
 
-             return response()->json(['status' => 1, 'data' => view('mobile.app.company.talent.ajax_need_list', ['list' => $rst])->render()]);
 
-         }
 
-         $mobile_dropload = false;
 
-         if ($rst->total() > $size) {
 
-             $mobile_dropload = true;
 
-         }
 
-         $return_data = [
 
-             'list'            => $rst,
 
-             'current_url'     => \Illuminate\Support\Facades\Request::getRequestUri(),
 
-             'wap_title'       => '人才需求列表',
 
-             'mobile_dropload' => $mobile_dropload,
 
-             'type'            => CompanyTalentNeed::$type,
 
-             'back_url'        => route('mobile.company.talent.index'),
 
-         ];
 
-         return view('mobile.app.company.talent.need_list', $return_data);
 
-     }
 
-     /**
 
-      * 删除需求
 
-      */
 
-     public function needDelete(Request $request)
 
-     {
 
-         $id  = $request->input('id');
 
-         $res = CompanyTalentNeed::destroy($id);
 
-         if ($res) {
 
-             return response()->json(['status' => 1, 'msg' => '删除成功']);
 
-         } else {
 
-             return response()->json(['status' => 0, 'msg' => '网络问题,请刷新重试']);
 
-         }
 
-     }
 
-     /**
 
-      * 需求详情
 
-      */
 
-     public function needInfo(Request $request)
 
-     {
 
-         $id   = $request->input('id');
 
-         $info = ['type' => 1];
 
-         if (!empty($id)) {
 
-             $info = CompanyTalentNeed::where('id', $id)->first();
 
-         }
 
-         $rst = [
 
-             'info'                  => $info,
 
-             'wap_title'             => '人才信息',
 
-             'type'                  => CompanyTalentNeed::$type,
 
-             'cooperation'           => CompanyTalentNeed::$cooperation,
 
-             'manager_level'         => CompanyTalentNeed::$manager_level,
 
-             'manager_qualification' => CompanyTalentNeed::$manager_qualification,
 
-             'manager_education'     => CompanyTalentNeed::$manager_education,
 
-             'technology_level'      => CompanyTalentNeed::$technology_level,
 
-             'technology_education'  => CompanyTalentNeed::$technology_education,
 
-             'skill_level'           => CompanyTalentNeed::$skill_level,
 
-         ];
 
-         return view('mobile.app.company.talent.need_info', $rst);
 
-     }
 
-     /**
 
-      * 需求提交
 
-      */
 
-     public function needInfoSave(Request $request)
 
-     {
 
-         $data = $request->all();
 
-         if (empty($data['id'])) {
 
-             $company            = auth('web-company')->user();
 
-             $data['company_id'] = $company->id;
 
-             CompanyTalentNeed::create($data);
 
-         } else {
 
-             CompanyTalentNeed::where('id', $data['id'])->update($data);
 
-         }
 
-         return $this->sendSuccessResponse();
 
-     }
 
- }
 
 
  |