1
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -90,6 +90,16 @@ class PromotionService
|
||||
$body = $logEntry['body_prepared'];
|
||||
} else {
|
||||
$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);
|
||||
$journalVars = $this->buildJournalVars($journal);
|
||||
$vars = array_merge($journalVars, $expertVars);
|
||||
@@ -194,6 +204,17 @@ class PromotionService
|
||||
]);
|
||||
$failed++;
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user