feat: add note module and route fixes
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\note\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* note 模块 AI 总结模型
|
||||
*/
|
||||
class NoteAiSummary extends Model
|
||||
{
|
||||
protected $connection = 'dbnote';
|
||||
|
||||
protected $name = 'note_ai_summary';
|
||||
|
||||
protected $pk = 'id';
|
||||
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
/**
|
||||
* 获取笔记最新总结
|
||||
*
|
||||
* @param int $noteId
|
||||
* @return self|null
|
||||
*/
|
||||
public static function findLatestByNoteId(int $noteId): ?self
|
||||
{
|
||||
return self::where('note_id', $noteId)
|
||||
->order('id', 'desc')
|
||||
->find();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user