34 lines
593 B
PHP
34 lines
593 B
PHP
<?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();
|
|
}
|
|
}
|