yemeishu пре 4 дана
родитељ
комит
2a24fb7c18
1 измењених фајлова са 0 додато и 24 уклоњено
  1. 0 24
      app/Models/PreQuestionCandidate.php

+ 0 - 24
app/Models/PreQuestionCandidate.php

@@ -130,28 +130,4 @@ class PreQuestionCandidate extends Model
 
         return \Str::limit($this->stem, 100);
     }
-
-    /**
-     * 重写getKey方法,确保返回字符串类型
-     * 解决Filament表格渲染时的TypeError问题
-     */
-    public function getKey(): int|string
-    {
-        $key = parent::getKey();
-
-        // 如果键值为null,返回一个默认值(基于时间戳和随机数)
-        if ($key === null) {
-            return 'temp_' . time() . '_' . mt_rand(1000, 9999);
-        }
-
-        return $key;
-    }
-
-    /**
-     * 重写getKeyName方法,返回主键名称
-     */
-    public function getKeyName(): string
-    {
-        return 'id';
-    }
 }