|
@@ -8,8 +8,8 @@ use App\Model\Website;
|
|
use App\Model\WebsiteCategory;
|
|
use App\Model\WebsiteCategory;
|
|
use App\Model\ArticleSurvey;
|
|
use App\Model\ArticleSurvey;
|
|
use App\Model\District;
|
|
use App\Model\District;
|
|
|
|
+use App\Model\jobHunting;
|
|
use App\Model\Good;
|
|
use App\Model\Good;
|
|
-
|
|
|
|
use App\Model\JobRecruiting;
|
|
use App\Model\JobRecruiting;
|
|
use App\Model\JobIndustry;
|
|
use App\Model\JobIndustry;
|
|
use App\Model\JobPosition;
|
|
use App\Model\JobPosition;
|
|
@@ -56,7 +56,8 @@ class NewsService implements NewsServiceInterface
|
|
})
|
|
})
|
|
->leftJoin('district', 'category.city_id', 'district.id')
|
|
->leftJoin('district', 'category.city_id', 'district.id')
|
|
->leftJoin('department', 'category.department_id', 'department.id')
|
|
->leftJoin('department', 'category.department_id', 'department.id')
|
|
- ->select("category.*", "district.name as city_name", "department.name as department_name")
|
|
|
|
|
|
+ ->leftJoin('category as c', 'c.pid', 'category.id')
|
|
|
|
+ ->select("category.*", "district.name as city_name", "department.name as department_name","c.name as parent_name")
|
|
->limit($data['pageSize'])->orderByDesc('category.updated_at')->offset(($data['page'] - 1) * $data['pageSize'])->get();
|
|
->limit($data['pageSize'])->orderByDesc('category.updated_at')->offset(($data['page'] - 1) * $data['pageSize'])->get();
|
|
$count = Category::where($where)->when($city_id, function ($query) use ($city_id) {
|
|
$count = Category::where($where)->when($city_id, function ($query) use ($city_id) {
|
|
if (isset($city_id) && $city_id) {
|
|
if (isset($city_id) && $city_id) {
|
|
@@ -196,6 +197,7 @@ class NewsService implements NewsServiceInterface
|
|
unset($data['user_id']);
|
|
unset($data['user_id']);
|
|
|
|
|
|
$where = [];
|
|
$where = [];
|
|
|
|
+ $status1 = [];
|
|
|
|
|
|
if (isset($data['title']) && $data['title']) {
|
|
if (isset($data['title']) && $data['title']) {
|
|
array_push($where, ['article.title', 'like', '%' . $data['title'] . '%']);
|
|
array_push($where, ['article.title', 'like', '%' . $data['title'] . '%']);
|
|
@@ -212,6 +214,9 @@ class NewsService implements NewsServiceInterface
|
|
if (isset($data['status']) && $data['status'] !== "") {
|
|
if (isset($data['status']) && $data['status'] !== "") {
|
|
array_push($where, ['article.status', '=', $data['status']]);
|
|
array_push($where, ['article.status', '=', $data['status']]);
|
|
}
|
|
}
|
|
|
|
+ if (isset($data['status1'])) {
|
|
|
|
+ $status1 = json_decode(($data['status1']));
|
|
|
|
+ }
|
|
//不是管理员展示个人数据;
|
|
//不是管理员展示个人数据;
|
|
if ($type_id != 10000) {
|
|
if ($type_id != 10000) {
|
|
$where[] = ['article.admin_user_id', '=', $user_id];
|
|
$where[] = ['article.admin_user_id', '=', $user_id];
|
|
@@ -219,12 +224,22 @@ class NewsService implements NewsServiceInterface
|
|
|
|
|
|
$rep = Article::where($where)
|
|
$rep = Article::where($where)
|
|
->whereNotIn('article.status', [404])
|
|
->whereNotIn('article.status', [404])
|
|
|
|
+ ->when($status1, function ($query) use ($status1) {
|
|
|
|
+ if (isset($status1) && $status1) {
|
|
|
|
+ $query->whereIn('article.status', $status1);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
->leftJoin('category', 'article.catid', 'category.id')
|
|
->leftJoin('category', 'article.catid', 'category.id')
|
|
->select("article.*", "category.name as category_name")
|
|
->select("article.*", "category.name as category_name")
|
|
->orderBy("article.id", "desc")
|
|
->orderBy("article.id", "desc")
|
|
->limit($data['pageSize'])
|
|
->limit($data['pageSize'])
|
|
->offset(($data['page'] - 1) * $data['pageSize'])->get();
|
|
->offset(($data['page'] - 1) * $data['pageSize'])->get();
|
|
$count = Article::where($where)->whereNotIn('article.status', [404])
|
|
$count = Article::where($where)->whereNotIn('article.status', [404])
|
|
|
|
+ ->when($status1, function ($query) use ($status1) {
|
|
|
|
+ if (isset($status1) && $status1) {
|
|
|
|
+ $query->whereIn('article.status', $status1);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
->leftJoin('category', 'article.catid', 'category.id')->count();
|
|
->leftJoin('category', 'article.catid', 'category.id')->count();
|
|
$data = [
|
|
$data = [
|
|
'rows' => $rep->toArray(),
|
|
'rows' => $rep->toArray(),
|
|
@@ -259,7 +274,7 @@ class NewsService implements NewsServiceInterface
|
|
unset($data['survey_name']);
|
|
unset($data['survey_name']);
|
|
unset($data['suvey_array']);
|
|
unset($data['suvey_array']);
|
|
unset($data['website_id']);
|
|
unset($data['website_id']);
|
|
-
|
|
|
|
|
|
+ $data['web_site_id'] = is_array($data['web_site_id']) ? json_encode($data['web_site_id']) : ($data['web_site_id']);
|
|
if ($data['hits'] == '') {
|
|
if ($data['hits'] == '') {
|
|
$data['hits'] = 0;
|
|
$data['hits'] = 0;
|
|
}
|
|
}
|
|
@@ -269,7 +284,6 @@ class NewsService implements NewsServiceInterface
|
|
if ($data['status'] == '') {
|
|
if ($data['status'] == '') {
|
|
$data['status'] = 0;
|
|
$data['status'] = 0;
|
|
}
|
|
}
|
|
-
|
|
|
|
$articleData = $data;
|
|
$articleData = $data;
|
|
unset($articleData['content']);
|
|
unset($articleData['content']);
|
|
$id = Article::insertGetId($articleData);
|
|
$id = Article::insertGetId($articleData);
|
|
@@ -377,6 +391,7 @@ class NewsService implements NewsServiceInterface
|
|
unset($data['survey_name']);
|
|
unset($data['survey_name']);
|
|
unset($data['suvey_array']);
|
|
unset($data['suvey_array']);
|
|
unset($data['website_id']);
|
|
unset($data['website_id']);
|
|
|
|
+ $data['web_site_id'] = is_array($data['web_site_id']) ? json_encode($data['web_site_id']) : ($data['web_site_id']);
|
|
if ($data['hits'] == '') {
|
|
if ($data['hits'] == '') {
|
|
$data['hits'] = 0;
|
|
$data['hits'] = 0;
|
|
}
|
|
}
|
|
@@ -615,6 +630,7 @@ class NewsService implements NewsServiceInterface
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
*获取新闻列表
|
|
*获取新闻列表
|
|
* @param array $data
|
|
* @param array $data
|
|
@@ -864,6 +880,142 @@ class NewsService implements NewsServiceInterface
|
|
return Result::error("参数必填!");
|
|
return Result::error("参数必填!");
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
|
|
+<<<<<<< HEAD
|
|
|
|
+=======
|
|
|
|
+ * 后端-获取网站调查问卷列表
|
|
|
|
+ * @param array $data
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function getSurveyList(array $data): array
|
|
|
|
+ {
|
|
|
|
+ $where = [];
|
|
|
|
+ if (isset($data['survey_name']) && !empty($data['survey_name'])) {
|
|
|
|
+ array_push($where, ['survey_name', 'like', '%' . $data['survey_name'] . '%']);
|
|
|
|
+ }
|
|
|
|
+ if (isset($data['survey_type']) && $data['survey_type'] != null) {
|
|
|
|
+ array_push($where, ['survey_type', '=', $data['survey_type']]);
|
|
|
|
+ }
|
|
|
|
+ if (isset($data['is_survey']) && $data['is_survey'] != null) {
|
|
|
|
+ array_push($where, ['is_survey', '=', $data['is_survey']]);
|
|
|
|
+ }
|
|
|
|
+ // return Result::success($where);
|
|
|
|
+ if (!empty($where)) {
|
|
|
|
+ $query = Article::where($where)->whereNotNull('survey_name');
|
|
|
|
+ } else {
|
|
|
|
+ $query = Article::whereNotNull('survey_name');
|
|
|
|
+ }
|
|
|
|
+ $count = $query->count();
|
|
|
|
+ $survey = $query->orderByDesc('id')
|
|
|
|
+ ->limit($data['pageSize'])
|
|
|
|
+ ->offset(($data['page'] - 1) * $data['pageSize'])
|
|
|
|
+ ->get();
|
|
|
|
+ if (empty($survey->toArray())) {
|
|
|
|
+ return Result::error("暂无调查问卷!", 0);
|
|
|
|
+ }
|
|
|
|
+ $result = [
|
|
|
|
+ 'rows' => $survey,
|
|
|
|
+ 'count' => $count,
|
|
|
|
+ ];
|
|
|
|
+ return Result::success($result);
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * 后端-获取网站调查问卷详情
|
|
|
|
+ * @param array $data
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function getSurveyInfo(array $data): array
|
|
|
|
+ {
|
|
|
|
+ if (isset($data['sur_id']) && !empty($data['sur_id'])) {
|
|
|
|
+ $where = ['sur_id' => $data['sur_id']];
|
|
|
|
+ $choose = ArticleSurvey::where($where)->where('is_other', 0)
|
|
|
|
+ ->leftJoin('article', 'article_survey.art_id', 'article.id')
|
|
|
|
+ ->select('article_survey.*', 'article.survey_type')
|
|
|
|
+ ->get()->all();
|
|
|
|
+ if (empty($choose)) {
|
|
|
|
+ return Result::error("此调查问卷不存在", 0);
|
|
|
|
+ }
|
|
|
|
+ $resultsArray = array_column($choose, 'results');
|
|
|
|
+ $total = array_sum($resultsArray);
|
|
|
|
+ $other = ArticleSurvey::where($where)->where('is_other', 1)->where('other_id', 0)->first();
|
|
|
|
+ $others = ArticleSurvey::where($where)->where('is_other', 1)->where('other_id', '!=', 0)->orderByDesc('created_at')->get()->all();
|
|
|
|
+ // $total = 0;
|
|
|
|
+ if (!empty($other)) {
|
|
|
|
+ $total = $total + $other['results'];
|
|
|
|
+ $other['choice_name'] = $other['choice_name'] . '(其他)';
|
|
|
|
+ if (!empty($others)) {
|
|
|
|
+ $other['hasChildren'] = true;
|
|
|
|
+ // array_push($other,['hasChildren','=',true]);
|
|
|
|
+ $other['children'] = $others;
|
|
|
|
+ $other_choices = [$other->toArray()];
|
|
|
|
+ $mer_choice = array_merge($choose, $other_choices);
|
|
|
|
+ $value_choice = array_values($mer_choice);
|
|
|
|
+ } else {
|
|
|
|
+ // return Result::error('1111');
|
|
|
|
+ $other_choices = [$other->toArray()];
|
|
|
|
+ $other_choices = array_merge($choose, $other_choices);
|
|
|
|
+ $value_choice = array_values($other_choices);
|
|
|
|
+ // return Result::success($result);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ $value_choice = $choose;
|
|
|
|
+ }
|
|
|
|
+ $result = [
|
|
|
|
+ 'choose' => $value_choice,
|
|
|
|
+ 'total' => $total,
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ return Result::success($result);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 前端-搜索新闻列表
|
|
|
|
+ * @param array $data
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function selectWebsiteArticle(array $data): array
|
|
|
|
+ {
|
|
|
|
+ $where = [];
|
|
|
|
+ // 初始化查询构造器
|
|
|
|
+ $category = WebsiteCategory::where('website_id',$data['website_id'])->pluck('category_id');
|
|
|
|
+ $query = Article::where('status', 1)
|
|
|
|
+ ->whereIn('catid', $category)
|
|
|
|
+ ->where(function ($query) use ($data) {
|
|
|
|
+ $query->where(function ($subQuery) use ($data) {
|
|
|
|
+ $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '".intval($data['website_id'])."') = 0");
|
|
|
|
+ })->orWhereNull("ignore_ids");
|
|
|
|
+ });
|
|
|
|
+ // return Result::success($all_articles);
|
|
|
|
+ // 检查是否存在 cityid 参数
|
|
|
|
+ if (isset($data['cityid']) && !empty($data['cityid'])) {
|
|
|
|
+ $query->whereRaw("JSON_CONTAINS(city_arr_id, '".intval($data['cityid'])."')");
|
|
|
|
+ }
|
|
|
|
+ // 检查是否存在 department_id 参数
|
|
|
|
+ if (isset($data['department_id']) && !empty($data['department_id'])) {
|
|
|
|
+ $query->whereRaw("JSON_CONTAINS(department_arr_id, '".intval($data['department_id'])."')");
|
|
|
|
+ }
|
|
|
|
+ // 检查是否存在 keyword 参数
|
|
|
|
+ if (isset($data['keyword']) && !empty($data['keyword'])) {
|
|
|
|
+ $query->where('title', 'like', '%'.$data['keyword'].'%');
|
|
|
|
+ }
|
|
|
|
+ // 计算总数
|
|
|
|
+ $count = $query->count();
|
|
|
|
+ // 分页查询
|
|
|
|
+ $articles = $query->orderBy("updated_at", "desc")
|
|
|
|
+ ->limit($data['pageSize'])
|
|
|
|
+ ->offset(($data['page'] - 1) * $data['pageSize'])
|
|
|
|
+ ->get()->all();
|
|
|
|
+ if (empty($articles)) {
|
|
|
|
+ return Result::error("没有符合条件的资讯数据");
|
|
|
|
+ }
|
|
|
|
+ $data = [
|
|
|
|
+ 'rows' => $articles,
|
|
|
|
+ 'count' => $count
|
|
|
|
+ ];
|
|
|
|
+ return Result::success($data);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+>>>>>>> bugfix_03_13_admin_liu
|
|
* 验证导航名称是否重复
|
|
* 验证导航名称是否重复
|
|
* @return void
|
|
* @return void
|
|
*/
|
|
*/
|
|
@@ -999,139 +1151,33 @@ class NewsService implements NewsServiceInterface
|
|
|
|
|
|
//20250226 产品列表
|
|
//20250226 产品列表
|
|
|
|
|
|
- /**
|
|
|
|
- * 后端-获取网站调查问卷列表
|
|
|
|
- * @param array $data
|
|
|
|
- * @return array
|
|
|
|
- */
|
|
|
|
- public function getSurveyList(array $data): array
|
|
|
|
|
|
+ //20250306 求职信息
|
|
|
|
+ public function getJobHuntingList(array $data): array
|
|
{
|
|
{
|
|
$where = [];
|
|
$where = [];
|
|
- if (isset($data['survey_name']) && !empty($data['survey_name'])) {
|
|
|
|
- array_push($where, ['survey_name', 'like', '%' . $data['survey_name'] . '%']);
|
|
|
|
- }
|
|
|
|
- if (isset($data['survey_type']) && $data['survey_type'] != null) {
|
|
|
|
- array_push($where, ['survey_type', '=', $data['survey_type']]);
|
|
|
|
- }
|
|
|
|
- if (isset($data['is_survey']) && $data['is_survey'] != null) {
|
|
|
|
- array_push($where, ['is_survey', '=', $data['is_survey']]);
|
|
|
|
- }
|
|
|
|
- // return Result::success($where);
|
|
|
|
- if (!empty($where)) {
|
|
|
|
- $query = Article::where($where)->whereNotNull('survey_name');
|
|
|
|
- } else {
|
|
|
|
- $query = Article::whereNotNull('survey_name');
|
|
|
|
- }
|
|
|
|
- $count = $query->count();
|
|
|
|
- $survey = $query->orderByDesc('id')
|
|
|
|
- ->limit($data['pageSize'])
|
|
|
|
- ->offset(($data['page'] - 1) * $data['pageSize'])
|
|
|
|
- ->get();
|
|
|
|
- if (empty($survey->toArray())) {
|
|
|
|
- return Result::error("暂无调查问卷!", 0);
|
|
|
|
- }
|
|
|
|
- $result = [
|
|
|
|
- 'rows' => $survey,
|
|
|
|
- 'count' => $count,
|
|
|
|
- ];
|
|
|
|
- return Result::success($result);
|
|
|
|
- }
|
|
|
|
- /**
|
|
|
|
- * 后端-获取网站调查问卷详情
|
|
|
|
- * @param array $data
|
|
|
|
- * @return array
|
|
|
|
- */
|
|
|
|
- public function getSurveyInfo(array $data): array
|
|
|
|
- {
|
|
|
|
- if (isset($data['sur_id']) && !empty($data['sur_id'])) {
|
|
|
|
- $where = ['sur_id' => $data['sur_id']];
|
|
|
|
- $choose = ArticleSurvey::where($where)->where('is_other', 0)
|
|
|
|
- ->leftJoin('article', 'article_survey.art_id', 'article.id')
|
|
|
|
- ->select('article_survey.*', 'article.survey_type')
|
|
|
|
- ->get()->all();
|
|
|
|
- if (empty($choose)) {
|
|
|
|
- return Result::error("此调查问卷不存在", 0);
|
|
|
|
- }
|
|
|
|
- $resultsArray = array_column($choose, 'results');
|
|
|
|
- $total = array_sum($resultsArray);
|
|
|
|
- $other = ArticleSurvey::where($where)->where('is_other', 1)->where('other_id', 0)->first();
|
|
|
|
- $others = ArticleSurvey::where($where)->where('is_other', 1)->where('other_id', '!=', 0)->orderByDesc('created_at')->get()->all();
|
|
|
|
- // $total = 0;
|
|
|
|
- if (!empty($other)) {
|
|
|
|
- $total = $total + $other['results'];
|
|
|
|
- $other['choice_name'] = $other['choice_name'] . '(其他)';
|
|
|
|
- if (!empty($others)) {
|
|
|
|
- $other['hasChildren'] = true;
|
|
|
|
- // array_push($other,['hasChildren','=',true]);
|
|
|
|
- $other['children'] = $others;
|
|
|
|
- $other_choices = [$other->toArray()];
|
|
|
|
- $mer_choice = array_merge($choose, $other_choices);
|
|
|
|
- $value_choice = array_values($mer_choice);
|
|
|
|
- } else {
|
|
|
|
- // return Result::error('1111');
|
|
|
|
- $other_choices = [$other->toArray()];
|
|
|
|
- $other_choices = array_merge($choose, $other_choices);
|
|
|
|
- $value_choice = array_values($other_choices);
|
|
|
|
- // return Result::success($result);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- $value_choice = $choose;
|
|
|
|
- }
|
|
|
|
- $result = [
|
|
|
|
- 'choose' => $value_choice,
|
|
|
|
- 'total' => $total,
|
|
|
|
- ];
|
|
|
|
- }
|
|
|
|
- return Result::success($result);
|
|
|
|
- }
|
|
|
|
|
|
+ if (isset($data['name']) && !empty($data['name'])) {
|
|
|
|
|
|
- /**
|
|
|
|
- * 前端-搜索新闻列表
|
|
|
|
- * @param array $data
|
|
|
|
- * @return array
|
|
|
|
- */
|
|
|
|
- public function selectWebsiteArticle(array $data): array
|
|
|
|
- {
|
|
|
|
- $where = [];
|
|
|
|
- // 初始化查询构造器
|
|
|
|
- $category = WebsiteCategory::where('website_id',$data['website_id'])->pluck('category_id');
|
|
|
|
- $query = Article::where('status', 1)
|
|
|
|
- ->whereIn('catid', $category)
|
|
|
|
- ->where(function ($query) use ($data) {
|
|
|
|
- $query->where(function ($subQuery) use ($data) {
|
|
|
|
- $subQuery->whereRaw("JSON_CONTAINS(ignore_ids, '".intval($data['website_id'])."') = 0");
|
|
|
|
- })->orWhereNull("ignore_ids");
|
|
|
|
- });
|
|
|
|
- // return Result::success($all_articles);
|
|
|
|
- // 检查是否存在 cityid 参数
|
|
|
|
- if (isset($data['cityid']) && !empty($data['cityid'])) {
|
|
|
|
- $query->whereRaw("JSON_CONTAINS(city_arr_id, '".intval($data['cityid'])."')");
|
|
|
|
- }
|
|
|
|
- // 检查是否存在 department_id 参数
|
|
|
|
- if (isset($data['department_id']) && !empty($data['department_id'])) {
|
|
|
|
- $query->whereRaw("JSON_CONTAINS(department_arr_id, '".intval($data['department_id'])."')");
|
|
|
|
- }
|
|
|
|
- // 检查是否存在 keyword 参数
|
|
|
|
- if (isset($data['keyword']) && !empty($data['keyword'])) {
|
|
|
|
- $query->where('title', 'like', '%'.$data['keyword'].'%');
|
|
|
|
|
|
+ $where[] = ['name', 'like', '%' . $data['name'] . '%'];
|
|
}
|
|
}
|
|
- // 计算总数
|
|
|
|
- $count = $query->count();
|
|
|
|
- // 分页查询
|
|
|
|
- $articles = $query->orderBy("updated_at", "desc")
|
|
|
|
- ->limit($data['pageSize'])
|
|
|
|
- ->offset(($data['page'] - 1) * $data['pageSize'])
|
|
|
|
- ->get()->all();
|
|
|
|
- if (empty($articles)) {
|
|
|
|
- return Result::error("没有符合条件的资讯数据");
|
|
|
|
|
|
+ $result = JobHunting::where($where)
|
|
|
|
+ ->leftJoin('user', 'user.id', '=', 'job_hunting.user_id')
|
|
|
|
+ ->leftJoin('website', 'website.id', '=', 'job_hunting.website_id')
|
|
|
|
+ ->select('job_hunting.*', 'user.nickname as nickname', 'user.user_name as username', 'website.website_name as website_name')
|
|
|
|
+ ->orderBy("updated_at", "desc")
|
|
|
|
+ ->limit($data['page_size'])
|
|
|
|
+ ->offset(($data['page'] - 1) * $data['page_size'])
|
|
|
|
+ ->get();
|
|
|
|
+ if (empty($result)) {
|
|
|
|
+ return Result::error("查询失败", 0);
|
|
}
|
|
}
|
|
|
|
+ $count = JobHunting::where($where)->count();
|
|
$data = [
|
|
$data = [
|
|
- 'rows' => $articles,
|
|
|
|
- 'count' => $count
|
|
|
|
|
|
+ 'rows' => $result->toArray(),
|
|
|
|
+ 'count' => $count,
|
|
];
|
|
];
|
|
return Result::success($data);
|
|
return Result::success($data);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// 20250306 招聘
|
|
// 20250306 招聘
|
|
/*
|
|
/*
|
|
* 招聘列表
|
|
* 招聘列表
|
|
@@ -1404,4 +1450,38 @@ class NewsService implements NewsServiceInterface
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
// 20250306 招聘
|
|
// 20250306 招聘
|
|
|
|
+ public function addJobHunting(array $data): array
|
|
|
|
+ {
|
|
|
|
+ $data['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
+ $data['updated_at'] = date('Y-m-d H:i:s');
|
|
|
|
+ $result = JobHunting::create($data);
|
|
|
|
+ if (empty($result)) {
|
|
|
|
+ return Result::error("添加失败", 0);
|
|
|
|
+ }
|
|
|
|
+ return Result::success($result);
|
|
|
|
+ }
|
|
|
|
+ public function delJobHunting(array $data): array
|
|
|
|
+ {
|
|
|
|
+ $result = JobHunting::where('id', $data['id'])->delete();
|
|
|
|
+ if (empty($result)) {
|
|
|
|
+ return Result::error("删除失败", 0);
|
|
|
|
+ }
|
|
|
|
+ return Result::success($result);
|
|
|
|
+ }
|
|
|
|
+ public function updateJobHunting(array $data): array
|
|
|
|
+ {
|
|
|
|
+ $result = JobHunting::where('id', $data['id'])->update($data);
|
|
|
|
+ if (empty($result)) {
|
|
|
|
+ return Result::error("更新失败", 0);
|
|
|
|
+ }
|
|
|
|
+ return Result::success($result);
|
|
|
|
+ }
|
|
|
|
+ public function getJobHuntingInfo(array $data): array
|
|
|
|
+ {
|
|
|
|
+ $result = JobHunting::where('id', $data['id'])->first();
|
|
|
|
+ if (empty($result)) {
|
|
|
|
+ return Result::error("查询失败", 0);
|
|
|
|
+ }
|
|
|
|
+ return Result::success($result);
|
|
|
|
+ }
|
|
}
|
|
}
|