提示如下:does not have a primary key. You should either define a primary key for the corresponding table or override the primaryKey() method
我们需要去models进行设置:
/** * 指定主键 * @return array|string[] */ public static function primaryKey() { return ['key']; }
关键字词: