|
@@ -432,12 +432,19 @@ class Egame extends Controller
|
|
|
'sort' => 0,
|
|
'sort' => 0,
|
|
|
] : [];
|
|
] : [];
|
|
|
|
|
|
|
|
- foreach (['name', 'description', 'ingress', 'network', 'logo', 'logo_h5'] as $field) {
|
|
|
|
|
|
|
+ foreach (['name', 'description', 'ingress', 'network', 'logo_h5'] as $field) {
|
|
|
if (array_key_exists($field, $input)) {
|
|
if (array_key_exists($field, $input)) {
|
|
|
$data[$field] = trim((string) $input[$field]);
|
|
$data[$field] = trim((string) $input[$field]);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (array_key_exists('logo_pc', $input) && !array_key_exists('logo', $data)) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // logo_pc 是新版后台使用的 PC Logo 字段,数据库仍统一保存到 logo。
|
|
|
|
|
+ // 两个字段同时出现时以 logo_pc 为准,避免列表整行回传的旧 logo
|
|
|
|
|
+ // 覆盖用户刚上传的新 logo_pc;同时修复新增记录只传 logo_pc 无法保存。
|
|
|
|
|
+ if (array_key_exists('logo', $input)) {
|
|
|
|
|
+ $data['logo'] = trim((string) $input['logo']);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (array_key_exists('logo_pc', $input)) {
|
|
|
$data['logo'] = trim((string) $input['logo_pc']);
|
|
$data['logo'] = trim((string) $input['logo_pc']);
|
|
|
}
|
|
}
|
|
|
if (array_key_exists('logo_langs', $input)) {
|
|
if (array_key_exists('logo_langs', $input)) {
|