123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace app\mobile\controller;
- use app\common\model\Broker as BrokerModel;
- use app\common\model\OutResume as OutResumeModel;
- use app\mobile\MobileBaseController;
- use app\mobile\validate\CandidateValidate;
- use think\exception\ValidateException;
- class Candidate extends MobileBaseController
- {
- public function info()
- {
- $broker_id = input('get.broker_id');
- empty($broker_id) && jump('无法获取经纪人信息');
- $broker = BrokerModel::where('id', $broker_id)->find();
- empty($broker) && jump('无法获取经纪人信息');
- $broker['type'] != 3 && jump('无法获取经纪人信息');
- return view('candidate/info', ['broker' => $broker]);
- }
- public function infoPost()
- {
- $data = input('post.');
- try {
- validate(CandidateValidate::class)->check($data);
- } catch (ValidateException $e) {
- ajax_return(1, $e->getError());
- }
- $idcard_check = OutResumeModel::where('idcard', $data['idcard'])->find();
- $idcard_check && ajax_return(1, '该身份证号已被登记!');
- $mobile_check = OutResumeModel::where('mobile', $data['mobile'])->find();
- $mobile_check && ajax_return(1, '该手机号已被登记!');
- $data['updatetime'] = $data['createtime'] = time();
- OutResumeModel::create($data);
- ajax_return();
- }
- }
|