From 36cb024bf32ea8420f597cb1761c5c9d13cc44c6 Mon Sep 17 00:00:00 2001
From: heshupeng <hsp@bronet.cn>
Date: Mon, 21 Dec 2020 13:33:36 +0800
Subject: [PATCH] 能力筛选

---
 application/mobile/controller/CompanyJob.php | 13 ++++++++++++-
 public/mobile.html                           |  2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/application/mobile/controller/CompanyJob.php b/application/mobile/controller/CompanyJob.php
index bfff2fa..7bba72d 100644
--- a/application/mobile/controller/CompanyJob.php
+++ b/application/mobile/controller/CompanyJob.php
@@ -1,6 +1,7 @@
 <?php
 namespace app\mobile\controller;
 
+use app\mobile\model\UserJobAbility;
 use think\Db;
 use app\common\controller\Api;
 use app\mobile\model\UserJob;
@@ -87,7 +88,17 @@ class CompanyJob extends Api
         }
         // 资质能力
         if(!empty($user_job_ability_id)){
-            $where[] = "FIND_IN_SET('{$user_job_ability_id}',user_job_ability_ids)";
+            $ability = UserJobAbility::get($user_job_ability_id);
+            if($ability['pid'] == 0){
+                $ability_list = UserJobAbility::where('pid',$user_job_ability_id)->select();
+                $ability_arr = [];
+                foreach ($ability_list as $v){
+                    $ability_arr[] = "FIND_IN_SET({$v['id']},user_job_ability_ids)";
+                }
+                $where[] = implode(' OR ',$ability_arr);
+            }else{
+                $where[] = "FIND_IN_SET('{$user_job_ability_id}',user_job_ability_ids)";
+            }
         }
         // 整合where
         $where = function ($query) use ($where) {
diff --git a/public/mobile.html b/public/mobile.html
index 1028d04..5b11404 100644
--- a/public/mobile.html
+++ b/public/mobile.html
@@ -22621,7 +22621,7 @@
 
             <div class="row mt0 footer">
                 <div class="col-md-6" align="left">
-                    Generated on 2020-12-20 20:06:22                </div>
+                    Generated on 2020-12-21 11:33:56                </div>
                 <div class="col-md-6" align="right">
                     <a href="./" target="_blank">企智帮</a>
                 </div>
--
libgit2 0.24.0