feat: add note module and route fixes
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\note\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* note 模块实时转写模型
|
||||
*/
|
||||
class NoteTranscript extends Model
|
||||
{
|
||||
protected $connection = 'dbnote';
|
||||
|
||||
protected $name = 'note_transcript';
|
||||
|
||||
protected $pk = 'id';
|
||||
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
/**
|
||||
* 查找某条笔记的指定分片
|
||||
*
|
||||
* @param int $noteId
|
||||
* @param int $segmentNo
|
||||
* @return self|null
|
||||
*/
|
||||
public static function findByNoteAndSegment(int $noteId, int $segmentNo): ?self
|
||||
{
|
||||
return self::where('note_id', $noteId)
|
||||
->where('segment_no', $segmentNo)
|
||||
->find();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user