|
@@ -8,12 +8,8 @@ use App\Models\Resume;
|
|
use App\Models\TalentHouse;
|
|
use App\Models\TalentHouse;
|
|
use App\Models\TalentHouseApply;
|
|
use App\Models\TalentHouseApply;
|
|
use App\Services\Content\ArticleService;
|
|
use App\Services\Content\ArticleService;
|
|
-use App\Services\Content\ArticleCategoryService;
|
|
|
|
-use App\Services\Content\AdService;
|
|
|
|
-use App\Services\Content\NavigationService;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Request;
|
|
-use Illuminate\Support\Facades\Cache;
|
|
|
|
-use Illuminate\Support\Collection;
|
|
|
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
|
|
|
@@ -29,21 +25,15 @@ class BuyhouseController extends WebBaseController
|
|
private $check_type = ['', 'warning', 'success', 'error'];
|
|
private $check_type = ['', 'warning', 'success', 'error'];
|
|
private $talent_level = ['不是人才', '第一层次', '第二层次', '第三层次', '第四层次', '第五层次', '第六层次', '第七层次'];
|
|
private $talent_level = ['不是人才', '第一层次', '第二层次', '第三层次', '第四层次', '第五层次', '第六层次', '第七层次'];
|
|
protected $articleService;
|
|
protected $articleService;
|
|
- protected $articleCategoryService;
|
|
|
|
- protected $adService;
|
|
|
|
- protected $navigationService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* ArticleController constructor.
|
|
* ArticleController constructor.
|
|
* @param $articleService
|
|
* @param $articleService
|
|
* @param $articleCategoryService
|
|
* @param $articleCategoryService
|
|
*/
|
|
*/
|
|
- public function __construct(ArticleService $articleService, ArticleCategoryService $articleCategoryService, AdService $adService, NavigationService $navigationService)
|
|
|
|
|
|
+ public function __construct(ArticleService $articleService)
|
|
{
|
|
{
|
|
- $this->articleService = $articleService;
|
|
|
|
- $this->articleCategoryService = $articleCategoryService;
|
|
|
|
- $this->adService = $adService;
|
|
|
|
- $this->navigationService = $navigationService;
|
|
|
|
|
|
+ $this->articleService = $articleService;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -55,7 +45,7 @@ class BuyhouseController extends WebBaseController
|
|
$return_data = ['user_id' => $user_id ?: 0, 'apply' => '[]'];
|
|
$return_data = ['user_id' => $user_id ?: 0, 'apply' => '[]'];
|
|
|
|
|
|
//房源
|
|
//房源
|
|
- $house = TalentHouse::orderBy('updated_at', 'desc')->limit(10)->get();
|
|
|
|
|
|
+ $house = TalentHouse::orderBy('updated_at', 'desc')->orderByRaw(DB::raw("FIELD(status,2,1,3)"))->limit(8)->get();
|
|
foreach ($house as $v) {
|
|
foreach ($house as $v) {
|
|
$v['declare_time_text'] = date('Y-m-d', strtotime($v['declare_time']));
|
|
$v['declare_time_text'] = date('Y-m-d', strtotime($v['declare_time']));
|
|
$v['status_text'] = $this->house_status[$v['status']];
|
|
$v['status_text'] = $this->house_status[$v['status']];
|
|
@@ -74,7 +64,11 @@ class BuyhouseController extends WebBaseController
|
|
|
|
|
|
//我的申报
|
|
//我的申报
|
|
if ($user_id > 0) {
|
|
if ($user_id > 0) {
|
|
- $apply = TalentHouseApply::with('house')->select(['id', 'house_id', 'status'])->where('user_id', $user_id)->get();
|
|
|
|
|
|
+ $apply = TalentHouseApply::with('house')
|
|
|
|
+ ->select(['id', 'house_id', 'status'])
|
|
|
|
+ ->where('is_draft', 2)
|
|
|
|
+ ->where('user_id', $user_id)
|
|
|
|
+ ->get();
|
|
foreach ($apply as $v) {
|
|
foreach ($apply as $v) {
|
|
$v['status_text'] = $this->apply_status[$v['status']];
|
|
$v['status_text'] = $this->apply_status[$v['status']];
|
|
$v['status_tag'] = $this->tag_status[$v['status']];
|
|
$v['status_tag'] = $this->tag_status[$v['status']];
|
|
@@ -89,13 +83,19 @@ class BuyhouseController extends WebBaseController
|
|
/**
|
|
/**
|
|
* 房源信息
|
|
* 房源信息
|
|
*/
|
|
*/
|
|
- public function house()
|
|
|
|
|
|
+ public function house(Request $request)
|
|
{
|
|
{
|
|
|
|
+ $lists = TalentHouse::orderByRaw(DB::raw("FIELD(status,2,1,3)"))->paginate(10);
|
|
|
|
+ foreach ($lists as $v) {
|
|
|
|
+ $v['status_text'] = $this->house_status[$v['status']];
|
|
|
|
+ $v['status_tag'] = $this->tag_status[$v['status']];
|
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
|
- return view('app.content.buyhouse.house', [
|
|
|
|
|
|
+ $return_data = [
|
|
|
|
+ 'articles' => $lists,
|
|
'now_cate' => '房源信息',
|
|
'now_cate' => '房源信息',
|
|
- ]);
|
|
|
|
|
|
+ ];
|
|
|
|
+ return view('app.content.buyhouse.house', $return_data);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -103,9 +103,14 @@ class BuyhouseController extends WebBaseController
|
|
*/
|
|
*/
|
|
public function news()
|
|
public function news()
|
|
{
|
|
{
|
|
- return view('app.content.buyhouse.news', [
|
|
|
|
|
|
+ $lists = $this->articleService->list('', 56, '10');
|
|
|
|
+
|
|
|
|
+ $return_data = [
|
|
|
|
+ 'articles' => $lists,
|
|
'now_cate' => '公告',
|
|
'now_cate' => '公告',
|
|
- ]);
|
|
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ return view('app.content.buyhouse.news', $return_data);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -140,6 +145,10 @@ class BuyhouseController extends WebBaseController
|
|
$apply = TalentHouseApply::where('house_id', $id)->where('user_id', $user_id)->first();
|
|
$apply = TalentHouseApply::where('house_id', $id)->where('user_id', $user_id)->first();
|
|
$check = [];
|
|
$check = [];
|
|
if ($apply) {
|
|
if ($apply) {
|
|
|
|
+ if ($house['status'] != 2 && $apply['is_draft'] == 1) {
|
|
|
|
+ $back_url = \Illuminate\Support\Facades\URL::previous();
|
|
|
|
+ return $this->showMessage('该房源未在申报时间', $back_url, true, '上一页', '3');
|
|
|
|
+ }
|
|
//审核状态
|
|
//审核状态
|
|
if ($apply['is_draft'] == 2) {
|
|
if ($apply['is_draft'] == 2) {
|
|
if ($apply['rs_check_status'] != 2) {
|
|
if ($apply['rs_check_status'] != 2) {
|
|
@@ -158,6 +167,11 @@ class BuyhouseController extends WebBaseController
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ if ($house['status'] != 2) {
|
|
|
|
+ $back_url = \Illuminate\Support\Facades\URL::previous();
|
|
|
|
+ return $this->showMessage('该房源未在申报时间', $back_url, true, '上一页', '3');
|
|
|
|
+ }
|
|
|
|
+
|
|
$time = time();
|
|
$time = time();
|
|
$resume = Resume::where('uid', $user_id)->where('def', 1)->first();
|
|
$resume = Resume::where('uid', $user_id)->where('def', 1)->first();
|
|
if (empty($resume) || empty($resume['idcard'])) {
|
|
if (empty($resume) || empty($resume['idcard'])) {
|
|
@@ -175,6 +189,10 @@ class BuyhouseController extends WebBaseController
|
|
$back_url = \Illuminate\Support\Facades\URL::previous();
|
|
$back_url = \Illuminate\Support\Facades\URL::previous();
|
|
return $this->showMessage('您还未认定人才,暂无申报资格', $back_url, true, '上一页', '3');
|
|
return $this->showMessage('您还未认定人才,暂无申报资格', $back_url, true, '上一页', '3');
|
|
}
|
|
}
|
|
|
|
+ if ($talent['type'] != 1) {
|
|
|
|
+ $back_url = \Illuminate\Support\Facades\URL::previous();
|
|
|
|
+ return $this->showMessage('目前仅支持晋江高层次人才申报', $back_url, true, '上一页', '3');
|
|
|
|
+ }
|
|
$talent = $talent['obj'][0];
|
|
$talent = $talent['obj'][0];
|
|
$add = [
|
|
$add = [
|
|
'user_id' => $user_id,
|
|
'user_id' => $user_id,
|
|
@@ -185,7 +203,7 @@ class BuyhouseController extends WebBaseController
|
|
'email' => $talent['email'],
|
|
'email' => $talent['email'],
|
|
'talent_level' => $this->talent_level[$talent['talentArrange']],
|
|
'talent_level' => $this->talent_level[$talent['talentArrange']],
|
|
'talent_card_validity' => $talent['activeDate'],
|
|
'talent_card_validity' => $talent['activeDate'],
|
|
- 'talent_tags' => '',
|
|
|
|
|
|
+ 'talent_tags' => $talent['talentType'],
|
|
'talent_condition' => $talent['identifyCondition'],
|
|
'talent_condition' => $talent['identifyCondition'],
|
|
'family' => json_encode([['relation' => '', 'realname' => '', 'idcard' => '']]),
|
|
'family' => json_encode([['relation' => '', 'realname' => '', 'idcard' => '']]),
|
|
'certificates' => '[]',
|
|
'certificates' => '[]',
|
|
@@ -206,11 +224,21 @@ class BuyhouseController extends WebBaseController
|
|
$apply['work_prove'] = json_decode($apply['work_prove'], true);
|
|
$apply['work_prove'] = json_decode($apply['work_prove'], true);
|
|
$apply['checked'] = true;
|
|
$apply['checked'] = true;
|
|
|
|
|
|
|
|
+ $formDisable = 'false';
|
|
|
|
+ if ($house['status'] == 2) {
|
|
|
|
+ if ($apply['is_draft'] == 1) {
|
|
|
|
+ $formDisable = 'true';
|
|
|
|
+ } elseif ($apply['rs_check_status'] == 3 || $apply['zj_check_status'] == 3) {
|
|
|
|
+ $formDisable = 'true';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
$return_data = [
|
|
$return_data = [
|
|
- 'check' => $check,
|
|
|
|
- 'apply' => json_encode($apply),
|
|
|
|
- 'house' => json_encode($house),
|
|
|
|
- 'module' => ['identification'],
|
|
|
|
|
|
+ 'formDisable' => $formDisable,
|
|
|
|
+ 'check' => $check,
|
|
|
|
+ 'apply' => json_encode($apply),
|
|
|
|
+ 'house' => json_encode($house),
|
|
|
|
+ 'module' => ['identification'],
|
|
];
|
|
];
|
|
|
|
|
|
return view('app.content.buyhouse.list', $return_data);
|
|
return view('app.content.buyhouse.list', $return_data);
|