Bladeren bron

Merge branch 'master' of http://git.bjzxtw.org.cn:3000/zxt/news_producer

LiuJ 6 dagen geleden
bovenliggende
commit
235a559b5e

+ 159 - 18
app/JsonRpc/NewsService.php

@@ -68,7 +68,7 @@ class NewsService implements NewsServiceInterface
 
         // 1. 查出所有匹配的分类id
         if ($search) {
-            $matchedIds = Category::where('name', 'like', "%{$search}%")->pluck('id')->toArray();
+            $matchedIds = Category::where('name', 'like', "%{$search}%")->orderBy('updated_at', 'desc')->pluck('id')->toArray();
             if (empty($matchedIds)) {
                 return Result::success(['rows' => [], 'total' => 0]);
             }
@@ -93,7 +93,7 @@ class NewsService implements NewsServiceInterface
             $parentIds = array_unique($parentIds);
         } else {
             // 没有搜索,一级分类就是根
-            $parentIds = Category::where('pid', 0)->pluck('id')->toArray();
+            $parentIds = Category::where('pid', 0)->orderBy('updated_at', 'desc')->pluck('id')->toArray();
         }
 
         // 3. 一级分类分页
@@ -2664,6 +2664,30 @@ class NewsService implements NewsServiceInterface
             return $article;
         });
     }
+    /**
+     * c端-获取招工招聘下拉选框
+     * @param array $data
+     * @return array
+     *  */
+    public function getWebsiteJobSelect(array $data): array
+    {
+        $web = Website::where('id', $data['website_id'])->first();
+        if(empty($web)){
+            return Result::error("该网站不存在", 0);
+        }
+        $hy = JobIndustry::get()->all();
+        $zw = JobPosition::where('zwpid',0)->get()->all();
+        $jtzw = JobPosition::where('zwpid','!=',0)->get()->all();
+        $result = [
+            'hy' => $hy,
+            'zw' => $zw,
+            'jtzw' => $jtzw,
+        ];
+        if(empty($result)){
+            return Result::error("查询失败", 0);
+        }
+        return Result::success($result);
+    }
     /**
      * c端-获取招工招聘
      * @param array $data
@@ -2682,16 +2706,8 @@ class NewsService implements NewsServiceInterface
                     $q->WhereRaw("JSON_CONTAINS(job_hunting.city_arr_id, '" . intval($data['city_id']) . "') = 1");
                 });
             })
-            ->select(
-                'job_hunting.id',
-                'job_hunting.cat_arr_id',
-                'job_hunting.job',
-                'job_hunting.industry',
-                'job_hunting.city_arr_id',
-                'job_hunting.experience',
-                'job_hunting.updated_at',
-                'job_hunting.salary'
-            )
+            ->select('job_hunting.id','job_hunting.cat_arr_id','job_hunting.job_name_get','job_hunting.industry','job_hunting.name','job_hunting.sexy'
+            ,'job_hunting.origin','job_hunting.city_arr_id','job_hunting.experience','job_hunting.updated_at','job_hunting.salary')
             ->orderBy('updated_at', 'desc')
             ->limit($data['job1_num'])
             ->get();
@@ -2733,15 +2749,10 @@ class NewsService implements NewsServiceInterface
         } else {
             $job_recruitings = $this->processJob($job_recruiting, $web);
         }
-        $hy = JobIndustry::get()->all();
-        $zw = JobPosition::where('zwpid', 0)->get()->all();
-        $jtzw = JobPosition::where('zwpid', '!=', 0)->get()->all();
+       
         $result = [
             'job_hunting' => $job_huntings,
             'job_recuiting' => $job_recruitings,
-            'hy' => $hy,
-            'zw' => $zw,
-            'jtzw' => $jtzw,
         ];
         return Result::success($result);
     }
@@ -3065,6 +3076,136 @@ class NewsService implements NewsServiceInterface
         }
         return Result::success($result);
     }
+
+    /**
+     * c端  -  验证路由
+     * @param array $data
+     * @return array
+     */
+    public function checkWebsiteRoute(array $data): array
+    {
+        $web = Website::where('id', $data['website_id'])->first(['id','website_name']);
+        if(empty($web)){
+            return Result::error("该网站不存在", 0);
+        }
+        // 验证栏目路由
+        $last_category = WebsiteCategory::where('website_id', $data['website_id'])
+            ->where('aLIas_pinyin', $data['last_route'])
+            ->first();
+        if(empty($last_category)){
+            return Result::error("该栏目不存在", 0);
+        }
+        if(isset($data['id']) && !empty($data['id'])){
+            //   `type` int unsigned DEFAULT '1' COMMENT '类型:1资讯(默认)2商品3书刊音像4招聘5求职类型:1资讯(默认)2商品3书刊音像4招聘5求职6招工招聘'
+            switch ($last_category['type']) {
+                case 1:
+                    // 文章
+                    //   `status` int DEFAULT '1' COMMENT '状态: 2:已拒绝  ;1:已发布,0待发布 草稿箱 404删除(移除) 
+                    $article = Article::where('status', 1)
+                    ->where('id', $data['id'])
+                    ->where(function ($query) use ($data) {
+                        $query->whereRaw("JSON_CONTAINS(ignore_ids, '" . intval($data['website_id']) . "') = 0")
+                            ->orWhereNull("ignore_ids");
+                        })
+                    ->first(['cat_arr_id']);
+                    if(empty($article)){
+                        return Result::error("该文章不存在", 0);
+                    }
+                    // return Result::success($article);
+                    break;
+                case 2:
+                    // 商品
+                    // `status` int DEFAULT '1' COMMENT '审核状态,1待审核2已审核3已拒绝',
+                    $article = Good::where('website_id', $data['website_id'])
+                        ->where('status', 2)
+                        ->where('id', $data['id'])
+                        ->first(['cat_arr_id']);
+                    if(empty($article)){
+                        return Result::error("该商品不存在", 0);
+                    }
+                    break;
+                case 3:
+                    // 书刊信息
+                    // `status` int DEFAULT '1' COMMENT '审核状态,1待审核2已审核3已拒绝',
+                    $article = Book::where('website_id', $data['website_id'])
+                        ->where('status', 2)
+                        ->where('id', $data['id'])
+                        ->first(['id','cat_arr_id']);
+                    if(empty($article)){
+                        return Result::error("该书刊不存在", 0);
+                    }
+                    break;
+                case 4:
+                    // 招聘
+                    //   `status` int DEFAULT '0' COMMENT '状态   0:待审核;1:已审核;(只有企业会员需要审核)',
+                    $article = JobRecruiting::where('website_id', $data['website_id'])
+                        ->where('status', 1)
+                        ->where('id', $data['id'])
+                        ->first(['cat_arr_id']);
+                    if(empty($article)){
+                        return Result::error("该招聘不存在", 0);
+                    }
+                    break;
+                case 5:
+                    // 求职
+                    //   `status` int DEFAULT '1' COMMENT '审核状态,1待审核2已审核3已拒绝',
+                    $article = JobHunting::where('website_id', $data['website_id'])
+                        ->where('status', 2)
+                        ->where('id', $data['id'])
+                        ->first(['cat_arr_id']);
+                    if(empty($article)){
+                        return Result::error("该求职不存在", 0);
+                    }
+                    break;
+                case 6:
+                    // 招工招聘
+                    // `status` int DEFAULT '1' COMMENT '审核状态,1待审核2已审核3已拒绝',
+                    $article = JobRecruiting::where('website_id', $data['website_id'])
+                        ->where('status', 1)
+                        ->where('id', $data['id'])
+                        ->first(['cat_arr_id']);
+                    if(empty($article)){
+                        $article = JobHunting::where('website_id', $data['website_id'])
+                        ->where('status', 2)
+                        ->where('id', $data['id'])
+                        ->first(['cat_arr_id']);
+                    }
+                    if(empty($article)){
+                        return Result::error("该招工招聘不存在", 0);
+                    }
+                    break;
+                default:
+                    return Result::error("该数据不存在", 0);
+                    break;
+            }
+            $catid = json_decode($article['cat_arr_id'], true);
+            if(empty($catid)){
+                return Result::error("该数据不存在", 0);
+            }
+            $pinyin = WebsiteCategory::where('website_id', $data['website_id'])
+                ->orderByRaw('FIELD(category_id, '. implode(',', $catid). ')')
+                ->whereIn('category_id', $catid)
+                ->pluck('aLIas_pinyin')
+                ->implode('/');
+            
+        }
+        if($last_category['pid']!=0){
+            $cat_arr = json_decode($last_category['category_arr_id'], true);
+            $pinyin = WebsiteCategory::where('website_id', $data['website_id'])
+                ->orderByRaw('FIELD(category_id, '. implode(',', $cat_arr). ')')
+                ->whereIn('category_id', $cat_arr)
+                ->pluck('aLIas_pinyin')
+                ->implode('/');
+        }else{
+            $pinyin = $last_category['aLIas_pinyin'];
+        }
+        if(empty($pinyin) || $pinyin!=$data['all_route']){
+            return Result::error('非法路径!');
+        }else{
+            return Result::success($pinyin);
+        }
+    }
+    
     /**
      * 验证导航名称是否重复
      * @return void

+ 10 - 0
app/JsonRpc/NewsServiceInterface.php

@@ -369,4 +369,14 @@ interface NewsServiceInterface
      * @return array
      */
     public function getWebsiteJobRecruiting(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function checkWebsiteRoute(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getWebsiteJobSelect(array $data):array;
 }

File diff suppressed because it is too large
+ 0 - 0
runtime/container/classes.cache


+ 7 - 7
runtime/container/proxy/App_Controller_AbstractController.proxy.php

@@ -1,13 +1,13 @@
 <?php
 
 declare (strict_types=1);
-/**
- * This file is part of Hyperf.
- *
- * @link     https://www.hyperf.io
- * @document https://hyperf.wiki
- * @contact  group@hyperf.io
- * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
+/**
+ * This file is part of Hyperf.
+ *
+ * @link     https://www.hyperf.io
+ * @document https://hyperf.wiki
+ * @contact  group@hyperf.io
+ * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
  */
 namespace App\Controller;
 

File diff suppressed because it is too large
+ 0 - 0
runtime/container/scan.cache


+ 1 - 1
runtime/hyperf.pid

@@ -1 +1 @@
-97369
+83871

+ 4 - 1
vendor/composer/autoload_classmap.php

@@ -18,18 +18,22 @@ return array(
     'App\\Model\\Article' => $baseDir . '/app/Model/Article.php',
     'App\\Model\\ArticleData' => $baseDir . '/app/Model/ArticleData.php',
     'App\\Model\\ArticleSurvey' => $baseDir . '/app/Model/ArticleSurvey.php',
+    'App\\Model\\Book' => $baseDir . '/app/Model/Book.php',
     'App\\Model\\Category' => $baseDir . '/app/Model/Category.php',
     'App\\Model\\ChatGroups' => $baseDir . '/app/Model/ChatGroups.php',
     'App\\Model\\ChatGroupsMember' => $baseDir . '/app/Model/ChatGroupsMember.php',
     'App\\Model\\ChatRecords' => $baseDir . '/app/Model/ChatRecords.php',
     'App\\Model\\District' => $baseDir . '/app/Model/District.php',
     'App\\Model\\Good' => $baseDir . '/app/Model/Good.php',
+    'App\\Model\\JobApply' => $baseDir . '/app/Model/JobApply.php',
     'App\\Model\\JobCompany' => $baseDir . '/app/Model/JobCompany.php',
     'App\\Model\\JobEnum' => $baseDir . '/app/Model/JobEnum.php',
+    'App\\Model\\JobHunting' => $baseDir . '/app/Model/JobHunting.php',
     'App\\Model\\JobIndustry' => $baseDir . '/app/Model/JobIndustry.php',
     'App\\Model\\JobNature' => $baseDir . '/app/Model/JobNature.php',
     'App\\Model\\JobPosition' => $baseDir . '/app/Model/JobPosition.php',
     'App\\Model\\JobRecruiting' => $baseDir . '/app/Model/JobRecruiting.php',
+    'App\\Model\\JobRemuse' => $baseDir . '/app/Model/JobRemuse.php',
     'App\\Model\\Link' => $baseDir . '/app/Model/Link.php',
     'App\\Model\\Model' => $baseDir . '/app/Model/Model.php',
     'App\\Model\\Notice' => $baseDir . '/app/Model/Notice.php',
@@ -42,7 +46,6 @@ return array(
     'App\\Model\\WebsiteGroup' => $baseDir . '/app/Model/WebsiteGroup.php',
     'App\\Model\\WebsiteRole' => $baseDir . '/app/Model/WebsiteRole.php',
     'App\\Model\\WebsiteRoleUser' => $baseDir . '/app/Model/WebsiteRoleUser.php',
-    'App\\Model\\jobHunting' => $baseDir . '/app/Model/jobHunting.php',
     'App\\Tools\\PublicData' => $baseDir . '/app/Tools/PublicData.php',
     'App\\Tools\\Result' => $baseDir . '/app/Tools/Result.php',
     'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',

+ 4 - 1
vendor/composer/autoload_static.php

@@ -738,18 +738,22 @@ class ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654
         'App\\Model\\Article' => __DIR__ . '/../..' . '/app/Model/Article.php',
         'App\\Model\\ArticleData' => __DIR__ . '/../..' . '/app/Model/ArticleData.php',
         'App\\Model\\ArticleSurvey' => __DIR__ . '/../..' . '/app/Model/ArticleSurvey.php',
+        'App\\Model\\Book' => __DIR__ . '/../..' . '/app/Model/Book.php',
         'App\\Model\\Category' => __DIR__ . '/../..' . '/app/Model/Category.php',
         'App\\Model\\ChatGroups' => __DIR__ . '/../..' . '/app/Model/ChatGroups.php',
         'App\\Model\\ChatGroupsMember' => __DIR__ . '/../..' . '/app/Model/ChatGroupsMember.php',
         'App\\Model\\ChatRecords' => __DIR__ . '/../..' . '/app/Model/ChatRecords.php',
         'App\\Model\\District' => __DIR__ . '/../..' . '/app/Model/District.php',
         'App\\Model\\Good' => __DIR__ . '/../..' . '/app/Model/Good.php',
+        'App\\Model\\JobApply' => __DIR__ . '/../..' . '/app/Model/JobApply.php',
         'App\\Model\\JobCompany' => __DIR__ . '/../..' . '/app/Model/JobCompany.php',
         'App\\Model\\JobEnum' => __DIR__ . '/../..' . '/app/Model/JobEnum.php',
+        'App\\Model\\JobHunting' => __DIR__ . '/../..' . '/app/Model/JobHunting.php',
         'App\\Model\\JobIndustry' => __DIR__ . '/../..' . '/app/Model/JobIndustry.php',
         'App\\Model\\JobNature' => __DIR__ . '/../..' . '/app/Model/JobNature.php',
         'App\\Model\\JobPosition' => __DIR__ . '/../..' . '/app/Model/JobPosition.php',
         'App\\Model\\JobRecruiting' => __DIR__ . '/../..' . '/app/Model/JobRecruiting.php',
+        'App\\Model\\JobRemuse' => __DIR__ . '/../..' . '/app/Model/JobRemuse.php',
         'App\\Model\\Link' => __DIR__ . '/../..' . '/app/Model/Link.php',
         'App\\Model\\Model' => __DIR__ . '/../..' . '/app/Model/Model.php',
         'App\\Model\\Notice' => __DIR__ . '/../..' . '/app/Model/Notice.php',
@@ -762,7 +766,6 @@ class ComposerStaticInit88f2a4d4a4e81dc7d415bcdf39930654
         'App\\Model\\WebsiteGroup' => __DIR__ . '/../..' . '/app/Model/WebsiteGroup.php',
         'App\\Model\\WebsiteRole' => __DIR__ . '/../..' . '/app/Model/WebsiteRole.php',
         'App\\Model\\WebsiteRoleUser' => __DIR__ . '/../..' . '/app/Model/WebsiteRoleUser.php',
-        'App\\Model\\jobHunting' => __DIR__ . '/../..' . '/app/Model/jobHunting.php',
         'App\\Tools\\PublicData' => __DIR__ . '/../..' . '/app/Tools/PublicData.php',
         'App\\Tools\\Result' => __DIR__ . '/../..' . '/app/Tools/Result.php',
         'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',

+ 2 - 2
vendor/composer/installed.php

@@ -3,7 +3,7 @@
         'name' => 'hyperf/hyperf-skeleton',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => '3aaacbc1f89ea4966bdb5b9ed46890ce7735093b',
+        'reference' => '1131810f1743bbec66466a1e449a323135033a21',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
@@ -457,7 +457,7 @@
         'hyperf/hyperf-skeleton' => array(
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => '3aaacbc1f89ea4966bdb5b9ed46890ce7735093b',
+            'reference' => '1131810f1743bbec66466a1e449a323135033a21',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),

Some files were not shown because too many files changed in this diff