This commit is contained in:
wangjinlei
2026-04-13 13:09:02 +08:00
parent 717c662d81
commit a2338340f6
2 changed files with 31 additions and 9 deletions

View File

@@ -299,16 +299,17 @@ class EmailClient extends Base
$expert = Db::name('expert')->where('expert_id', $expertId)->find();
if (!$expert) {
return jsonError('expert not found');
}
if (empty($expert['field'])) {
$fieldRow = Db::name('expert_field')
->where('expert_id', $expertId)
->where('state', 0)
->order('expert_field_id asc')
->find();
if ($fieldRow) {
$expert['field'] = $fieldRow['field'];
}else{
$expert_fields = Db::name('expert_fields')->where('expert_id', $expert['expert_id'])->select();
$field_str = '';
foreach ($expert_fields as $field){
if($field_str != ''){
$field_str .= ','.$field['field_name'];
}else{
$field_str = $field['field_name'];
}
}
$expert['fields'] = $field_str;
}
$expertVars = $service->buildExpertVars($expert);
} else {