|
@@ -6,6 +6,7 @@ use App\Model\ArticleData;
|
|
|
use App\Model\Category;
|
|
|
use App\Model\WebsiteCategory;
|
|
|
use App\Model\ArticleSurvey;
|
|
|
+use App\Model\jobHunting;
|
|
|
use App\Model\Good;
|
|
|
use App\Model\Website;
|
|
|
use Hyperf\DbConnection\Db;
|
|
@@ -184,6 +185,7 @@ class NewsService implements NewsServiceInterface
|
|
|
unset($data['user_id']);
|
|
|
|
|
|
$where = [];
|
|
|
+ $status1 = [];
|
|
|
|
|
|
if (isset($data['title']) && $data['title']) {
|
|
|
array_push($where, ['article.title', 'like', '%' . $data['title'] . '%']);
|
|
@@ -200,6 +202,9 @@ class NewsService implements NewsServiceInterface
|
|
|
if (isset($data['status']) && $data['status'] !== "") {
|
|
|
array_push($where, ['article.status', '=', $data['status']]);
|
|
|
}
|
|
|
+ if (isset($data['status1'])) {
|
|
|
+ $status1 = json_decode(($data['status1']));
|
|
|
+ }
|
|
|
//不是管理员展示个人数据;
|
|
|
if ($type_id != 10000) {
|
|
|
$where[] = ['article.admin_user_id', '=', $user_id];
|
|
@@ -207,12 +212,22 @@ class NewsService implements NewsServiceInterface
|
|
|
|
|
|
$rep = 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')
|
|
|
->select("article.*", "category.name as category_name")
|
|
|
->orderBy("article.id", "desc")
|
|
|
->limit($data['pageSize'])
|
|
|
->offset(($data['page'] - 1) * $data['pageSize'])->get();
|
|
|
$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();
|
|
|
$data = [
|
|
|
'rows' => $rep->toArray(),
|
|
@@ -1044,5 +1059,64 @@ class NewsService implements NewsServiceInterface
|
|
|
}
|
|
|
|
|
|
//20250226 产品列表
|
|
|
+ //20250306 求职信息
|
|
|
+ public function getJobHuntingList(array $data): array
|
|
|
+ {
|
|
|
+ $where = [];
|
|
|
+ if (isset($data['name']) && !empty($data['name'])) {
|
|
|
|
|
|
+ $where[] = ['name', 'like', '%' . $data['name'] . '%'];
|
|
|
+ }
|
|
|
+ $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 = [
|
|
|
+ 'rows' => $result->toArray(),
|
|
|
+ 'count' => $count,
|
|
|
+ ];
|
|
|
+ return Result::success($data);
|
|
|
+ }
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}
|