|
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Web\Content;
|
|
|
|
|
|
use App\Http\Controllers\Web\WebBaseController;
|
|
|
use App\Models\Article;
|
|
|
+use App\Models\Resume;
|
|
|
use App\Models\TalentHouse;
|
|
|
use App\Models\TalentHouseApply;
|
|
|
use App\Services\Content\ArticleService;
|
|
@@ -26,6 +27,7 @@ class BuyhouseController extends WebBaseController
|
|
|
private $tag_status = ['', 'info', 'success', 'danger'];
|
|
|
private $apply_status = ['未知', '审核中', '已通过', '已拒绝'];
|
|
|
private $check_type = ['', 'warning', 'success', 'error'];
|
|
|
+ private $talent_level = ['不是人才', '第一层次', '第二层次', '第三层次', '第四层次', '第五层次', '第六层次', '第七层次'];
|
|
|
protected $articleService;
|
|
|
protected $articleCategoryService;
|
|
|
protected $adService;
|
|
@@ -111,15 +113,6 @@ class BuyhouseController extends WebBaseController
|
|
|
*/
|
|
|
public function list(Request $request)
|
|
|
{
|
|
|
- $time = time();
|
|
|
- $request_post = [
|
|
|
- 'idCards' => ['350524198704156033'],
|
|
|
- 'sign' => md5("timestr={$time}&key=rsKVyec52fqEKpk4RRD2TU8fKvPxt6ombKg0qSq1velPQtBHVi"),
|
|
|
- 'timeStr' => $time,
|
|
|
- ];
|
|
|
- $res = https_request('http://rc.jucai.gov.cn/api/dataInterface/findTalentInfoByIdCards', json_encode($request_post), ['Accept:application/json', 'Content-Type:application/json;charset=utf-8']);
|
|
|
- dd($res);
|
|
|
-
|
|
|
$login = $this->checkLogin();
|
|
|
if ($login) {
|
|
|
return $login;
|
|
@@ -132,16 +125,6 @@ class BuyhouseController extends WebBaseController
|
|
|
return $this->showMessage('该房源不存在或已删除', $back_url, true, '上一页', '3');
|
|
|
}
|
|
|
|
|
|
- //人才判断
|
|
|
- /*$time = time();
|
|
|
- $request_post = [
|
|
|
- 'idCards' => ['350524198704156033'],
|
|
|
- 'sign' => md5("timestr={$time}&key=rsKVyec52fqEKpk4RRD2TU8fKvPxt6ombKg0qSq1velPQtBHVi"),
|
|
|
- 'timeStr' => $time,
|
|
|
- ];
|
|
|
- $res = https_request('http://rc.jucai.gov.cn/api/dataInterface/findTalentInfoByIdCards', json_encode($request_post), ['Accept:application/json', 'Content-Type:application/json;charset=utf-8']);
|
|
|
- dd($res);*/
|
|
|
-
|
|
|
//房源信息
|
|
|
$house = TalentHouse::where('id', $id)->first();
|
|
|
if (empty($house)) {
|
|
@@ -157,13 +140,6 @@ class BuyhouseController extends WebBaseController
|
|
|
$apply = TalentHouseApply::where('house_id', $id)->where('user_id', $user_id)->first();
|
|
|
$check = [];
|
|
|
if ($apply) {
|
|
|
- $apply['family'] = json_decode($apply['family'], true);
|
|
|
- $apply['certificates'] = json_decode($apply['certificates'], true);
|
|
|
- $apply['marry_prove'] = json_decode($apply['marry_prove'], true);
|
|
|
- $apply['household_register'] = json_decode($apply['household_register'], true);
|
|
|
- $apply['work_prove'] = json_decode($apply['work_prove'], true);
|
|
|
- $apply['checked'] = true;
|
|
|
-
|
|
|
//审核状态
|
|
|
if ($apply['rs_check_status'] != 2) {
|
|
|
$check['status_text'] = '人社局' . $this->apply_status[$apply['rs_check_status']];
|
|
@@ -180,16 +156,54 @@ class BuyhouseController extends WebBaseController
|
|
|
$check['type'] = 'success';
|
|
|
}
|
|
|
} else {
|
|
|
- $apply = [
|
|
|
- 'family' => [['relation' => '', 'realname' => '', 'idcard' => '']],
|
|
|
- 'checked' => true,
|
|
|
- 'certificates' => [],
|
|
|
- 'marry_prove' => [],
|
|
|
- 'household_register' => [],
|
|
|
- 'work_prove' => [],
|
|
|
+ $time = time();
|
|
|
+ $resume = Resume::where('uid', $user_id)->where('def', 1)->first();
|
|
|
+ if (empty($resume) || empty($resume['idcard'])) {
|
|
|
+ $back_url = route('person.resume');
|
|
|
+ return $this->showMessage('请先填写一份简历', $back_url, true, '上一页', '3');
|
|
|
+ }
|
|
|
+ $request_post = [
|
|
|
+ 'idCards' => [$resume['idcard']],
|
|
|
+ 'sign' => mb_strtoupper(md5("timestr={$time}&key=rsKVyec52fqEKpk4RRD2TU8fKvPxt6ombKg0qSq1velPQtBHVi")),
|
|
|
+ 'timeStr' => (string)$time,
|
|
|
+ ];
|
|
|
+ $res = https_request('https://rc.jucai.gov.cn/api/dataInterface/findTalentInfoByIdCards', json_encode($request_post), ['Content-Type:application/json']);
|
|
|
+ $talent = json_decode($res, true);
|
|
|
+ if (empty($talent['obj'])) {
|
|
|
+ $back_url = \Illuminate\Support\Facades\URL::previous();
|
|
|
+ return $this->showMessage('您还未认定人才,暂无申报资格', $back_url, true, '上一页', '3');
|
|
|
+ }
|
|
|
+ $talent = $talent['obj'][0];
|
|
|
+ $add = [
|
|
|
+ 'user_id' => $user_id,
|
|
|
+ 'house_id' => $id,
|
|
|
+ 'name' => $talent['name'],
|
|
|
+ 'mobile' => $talent['phone'],
|
|
|
+ 'native' => $talent['nativePlace'],
|
|
|
+ 'email' => $talent['email'],
|
|
|
+ 'talent_level' => $this->talent_level[$talent['talentArrange']],
|
|
|
+ 'talent_card_validity' => $talent['activeDate'],
|
|
|
+ 'talent_tags' => '',
|
|
|
+ 'talent_condition' => $talent['identifyCondition'],
|
|
|
+ 'family' => json_encode([['relation' => '', 'realname' => '', 'idcard' => '']]),
|
|
|
+ 'certificates' => '[]',
|
|
|
+ 'marry_prove' => '[]',
|
|
|
+ 'household_register' => '[]',
|
|
|
+ 'work_prove' => '[]',
|
|
|
+ 'created_at' => date('Y-m-d H:i:s'),
|
|
|
+ 'updated_at' => date('Y-m-d H:i:s'),
|
|
|
];
|
|
|
+ $id = TalentHouseApply::insertGetId($add);
|
|
|
+ $apply = TalentHouseApply::find($id);
|
|
|
}
|
|
|
|
|
|
+ $apply['family'] = json_decode($apply['family'], true);
|
|
|
+ $apply['certificates'] = json_decode($apply['certificates'], true);
|
|
|
+ $apply['marry_prove'] = json_decode($apply['marry_prove'], true);
|
|
|
+ $apply['household_register'] = json_decode($apply['household_register'], true);
|
|
|
+ $apply['work_prove'] = json_decode($apply['work_prove'], true);
|
|
|
+ $apply['checked'] = true;
|
|
|
+
|
|
|
$return_data = [
|
|
|
'check' => $check,
|
|
|
'apply' => json_encode($apply),
|