|
|
|
@ -869,6 +869,7 @@ class Skill extends Model |
|
|
|
|
$tmp = array(); |
|
|
|
|
$tmp['name'] = $elem['name']; |
|
|
|
|
$tmp['id'] = $elem['id']; |
|
|
|
|
$tmp['isSearched'] = self::isSearched($elem['id']); |
|
|
|
|
|
|
|
|
|
if (is_array($elem['children'])) { |
|
|
|
|
$tmp['children'] = $this->get_skill_json($elem['children'], $depth + 1, $max_depth); |
|
|
|
@ -987,4 +988,37 @@ class Skill extends Model |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static function isSearched($id) |
|
|
|
|
{ |
|
|
|
|
$id = intval($id); |
|
|
|
|
|
|
|
|
|
if (empty($id)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$skillRelProfileTable = Database::get_main_table(TABLE_MAIN_SKILL_REL_PROFILE); |
|
|
|
|
|
|
|
|
|
$result = Database::select( |
|
|
|
|
'COUNT( DISTINCT `skill_id`) AS qty', |
|
|
|
|
$skillRelProfileTable, |
|
|
|
|
array( |
|
|
|
|
'where' => array( |
|
|
|
|
'skill_id = ?' => $id |
|
|
|
|
) |
|
|
|
|
), |
|
|
|
|
'first' |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if ($result === false) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($result['qty'] > 0) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|