This commit is contained in:
mkm 2024-01-13 17:32:35 +08:00
parent 6848217f4d
commit 72cd3e5054
2 changed files with 7 additions and 4 deletions

View File

@ -155,8 +155,11 @@ class ProjectValidate extends BaseValidate
public function checkProjectContent($value): bool|string
{
$dictData = DictData::where('type_value','project_content')->column('value');
if(!in_array($value,$dictData)){
return '项目内容无效';
$value=explode(',',$value);
foreach($value as $v){
if(!in_array($v,$dictData)){
return '项目内容无效';
}
}
return true;
}

View File

@ -39,8 +39,8 @@ class Project extends BaseModel
public function getProjectContentTextAttr($value,$data)
{
$dictData = DictData::where('type_value','project_content')->column('name','value');
return empty($data['project_content']) ? '' : $dictData[$data['project_content']];
$dictData = DictData::where('type_value','project_content')->whereIn('value',$data['project_content'])->column('name');
return $data['project_content']?implode(',',$dictData):'';
}
public function getBiddingMethodTextAttr($value,$data)