cqp hai 1 mes
pai
achega
d1539579c2

+ 2 - 0
app/Service/CustomFieldSettingService.php

@@ -289,6 +289,7 @@ class CustomFieldSettingService extends Service
                 $label  = trim((string)($field['field_label'] ?? ''));
                 $newVal = (string)($field['field_value'] ?? '');
                 $type   = (int)($field['field_type'] ?? 1);
+                $field_name   = (string)($field['field_name'] ?? '');
 
                 if ($label === '') continue; // 标签为空的直接跳过,不保存
 
@@ -310,6 +311,7 @@ class CustomFieldSettingService extends Service
                     'field_label'   => $label,
                     'field_value'   => $newVal,
                     'field_type'    => $type,
+                    'field_name'    => $field_name,
                 ];
 
                 if ($fId > 0) {

+ 1 - 1
app/Traits/HasCustomFields.php

@@ -17,7 +17,7 @@ trait HasCustomFields
         return $this->hasMany(CustomFieldValue::class, 'model_id')
             ->where('table_name', $this->getTable())
             ->where('del_time', 0)
-            ->select('id','field_label','field_value','field_type','model_id');
+            ->select('id','field_label','field_value','field_type','model_id', 'field_name');
     }
 
     /**