添加其它技术分类

This commit is contained in:
Dev
2026-09-23 18:05:15 +08:00
parent a07c495fe0
commit bde6edd76a
5 changed files with 45 additions and 11 deletions
@@ -20,6 +20,10 @@ class Developer extends Api
* @param array $images 图片数组
* @param array $files 文件数组
* @param string $contact 联系方式
* @param array $languageSelected 选中的编程语言
* @param array $frontSelected 选中的前端技术
* @param array $backendSelected 选中的后端技术
* @param array $otherSelected 选中的其它技术
*/
public function submit()
{
@@ -46,7 +50,16 @@ class Developer extends Api
if (DeveloperService::getOne(['user_id' => $userId])) {
exception('您已经申请入驻,请勿重复申请!');
}
$params['tags'] = array_filter(array_merge($params['languageSelected'], $params['frontSelected'], $params['backendSelected']));
// 合并各技术分类选中的标签(编程语言/前端技术/后端技术/其它技术)
$params['tags'] = array_values(array_unique(array_filter(array_merge(
(array)($params['languageSelected'] ?? []),
(array)($params['frontSelected'] ?? []),
(array)($params['backendSelected'] ?? []),
(array)($params['otherSelected'] ?? [])
))));
if (empty($params['tags'])) {
$this->error('技能标签不能为空');
}
DeveloperService::instance()->create($params, $userId);
$this->success('申请已提交,等待审核通过即可接单');
} catch (\Exception $e) {