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(); $expert = Db::name('expert')->where('expert_id', $expertId)->find();
if (!$expert) { if (!$expert) {
return jsonError('expert not found'); return jsonError('expert not found');
} }else{
if (empty($expert['field'])) { $expert_fields = Db::name('expert_fields')->where('expert_id', $expert['expert_id'])->select();
$fieldRow = Db::name('expert_field') $field_str = '';
->where('expert_id', $expertId) foreach ($expert_fields as $field){
->where('state', 0) if($field_str != ''){
->order('expert_field_id asc') $field_str .= ','.$field['field_name'];
->find(); }else{
if ($fieldRow) { $field_str = $field['field_name'];
$expert['field'] = $fieldRow['field']; }
} }
$expert['fields'] = $field_str;
} }
$expertVars = $service->buildExpertVars($expert); $expertVars = $service->buildExpertVars($expert);
} else { } else {

View File

@@ -90,6 +90,16 @@ class PromotionService
$body = $logEntry['body_prepared']; $body = $logEntry['body_prepared'];
} else { } else {
$journal = Db::name('journal')->where('journal_id', $task['journal_id'])->find(); $journal = Db::name('journal')->where('journal_id', $task['journal_id'])->find();
$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 = $this->buildExpertVars($expert); $expertVars = $this->buildExpertVars($expert);
$journalVars = $this->buildJournalVars($journal); $journalVars = $this->buildJournalVars($journal);
$vars = array_merge($journalVars, $expertVars); $vars = array_merge($journalVars, $expertVars);
@@ -194,6 +204,17 @@ class PromotionService
]); ]);
$failed++; $failed++;
continue; continue;
}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 = $this->buildExpertVars($expert); $expertVars = $this->buildExpertVars($expert);