|
@@ -7,7 +7,12 @@ use App\Model\Category;
|
|
|
use App\Model\WebsiteCategory;
|
|
|
use App\Model\ArticleSurvey;
|
|
|
use App\Model\jobHunting;
|
|
|
+use App\Model\JobEnum;
|
|
|
+use App\Model\JobIndustry;
|
|
|
+use App\Model\JobPosition;
|
|
|
+use App\Model\JobRecruiting;
|
|
|
use App\Model\Good;
|
|
|
+use App\Model\JobNature;
|
|
|
use App\Model\Website;
|
|
|
use Hyperf\DbConnection\Db;
|
|
|
use Hyperf\RpcServer\Annotation\RpcService;
|
|
@@ -1023,7 +1028,15 @@ class NewsService implements NewsServiceInterface
|
|
|
|
|
|
public function getGoodList(array $data): array
|
|
|
{
|
|
|
+ $type_id = isset($data['type_id']) ? $data['type_id'] : '';
|
|
|
+ unset($data['type_id']);
|
|
|
+ $user_id = isset($data['user_id']) ? $data['user_id'] : '';
|
|
|
$where = [];
|
|
|
+ if ($type_id != '10000') {
|
|
|
+ $where = [
|
|
|
+ 'good.user_id' => $user_id,
|
|
|
+ ];
|
|
|
+ }
|
|
|
//类型
|
|
|
if (isset($data['type_id']) && $data['type_id']) {
|
|
|
$where = [
|
|
@@ -1137,22 +1150,31 @@ class NewsService implements NewsServiceInterface
|
|
|
public function getJobHuntingList(array $data): array
|
|
|
{
|
|
|
$where = [];
|
|
|
- if (isset($data['name']) && !empty($data['name'])) {
|
|
|
+ if (isset($data['username']) && !empty($data['username'])) {
|
|
|
|
|
|
- $where[] = ['name', 'like', '%' . $data['name'] . '%'];
|
|
|
+ $where[] = ['user.user_name', 'like', '%' . $data['username'] . '%'];
|
|
|
+ }
|
|
|
+ $type_id = isset($data['type_id']) ? $data['type_id'] : '';
|
|
|
+ $user_id = isset($data['user_id']) ? $data['user_id'] : '';
|
|
|
+ unset($data['type_id']);
|
|
|
+ if ($type_id != '10000') {
|
|
|
+ $where[] = ['job_hunting.user_id', '=', $user_id];
|
|
|
}
|
|
|
$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")
|
|
|
+ ->orderBy("id", "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();
|
|
|
+ $count = JobHunting::where($where)
|
|
|
+ ->leftJoin('user', 'user.id', '=', 'job_hunting.user_id')
|
|
|
+ ->leftJoin('website', 'website.id', '=', 'job_hunting.website_id')
|
|
|
+ ->count();
|
|
|
$data = [
|
|
|
'rows' => $result->toArray(),
|
|
|
'count' => $count,
|
|
@@ -1161,8 +1183,16 @@ class NewsService implements NewsServiceInterface
|
|
|
}
|
|
|
public function addJobHunting(array $data): array
|
|
|
{
|
|
|
+ date_default_timezone_set('Asia/Shanghai');
|
|
|
+ unset($data['company_name']);
|
|
|
+ unset($data['job_industry']);
|
|
|
+ unset($data['job_name']);
|
|
|
+ unset($data['department']);
|
|
|
+ unset($data['job_timeList']);
|
|
|
+ unset($data['job_content']);
|
|
|
$data['created_at'] = date('Y-m-d H:i:s');
|
|
|
$data['updated_at'] = date('Y-m-d H:i:s');
|
|
|
+ var_dump($data, '-----------------test---------');
|
|
|
$result = JobHunting::create($data);
|
|
|
if (empty($result)) {
|
|
|
return Result::error("添加失败", 0);
|
|
@@ -1179,6 +1209,16 @@ class NewsService implements NewsServiceInterface
|
|
|
}
|
|
|
public function updateJobHunting(array $data): array
|
|
|
{
|
|
|
+ //设置东八区
|
|
|
+ date_default_timezone_set('Asia/Shanghai');
|
|
|
+ unset($data['company_name']);
|
|
|
+ unset($data['job_industry']);
|
|
|
+ unset($data['job_name']);
|
|
|
+ unset($data['department']);
|
|
|
+ unset($data['job_timeList']);
|
|
|
+ unset($data['job_content']);
|
|
|
+ $data['created_at'] = date('Y-m-d H:i:s');
|
|
|
+ $data['updated_at'] = date('Y-m-d H:i:s');
|
|
|
$result = JobHunting::where('id', $data['id'])->update($data);
|
|
|
if (empty($result)) {
|
|
|
return Result::error("更新失败", 0);
|
|
@@ -1193,4 +1233,23 @@ class NewsService implements NewsServiceInterface
|
|
|
}
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
+ public function getJobHuntingData(array $data): array
|
|
|
+ {
|
|
|
+ $jobEnum = JobEnum::get();
|
|
|
+ $jobIndustry = JobIndustry::get();
|
|
|
+ $jobNature = JobNature::get();
|
|
|
+ $jobPosition = JobPosition::get();
|
|
|
+ $data = [
|
|
|
+ 'jobEnum' => $jobEnum,
|
|
|
+ 'jobIndustry' => $jobIndustry,
|
|
|
+ 'jobNature' => $jobNature,
|
|
|
+ 'jobPosition' => $jobPosition,
|
|
|
+ ];
|
|
|
+ return Result::success($data);
|
|
|
+ }
|
|
|
+ public function delJobHuntingInfo(array $data): array
|
|
|
+ {
|
|
|
+ $result = JobHunting::where('id', $data['id'])->delete();
|
|
|
+ return Result::success();
|
|
|
+ }
|
|
|
}
|