48 lines
1.0 KiB
PHP
48 lines
1.0 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 文件功能:用户反馈补充评论 Model
|
||
|
|
* 对应 feedback_replies 表,记录用户对反馈的补充说明和管理员官方回复
|
||
|
|
* is_admin=1 的回复在前台以特殊「开发者回复」样式高亮展示
|
||
|
|
*
|
||
|
|
* @author ChatRoom Laravel
|
||
|
|
*
|
||
|
|
* @version 1.0.0
|
||
|
|
*/
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
|
||
|
|
class FeedbackReply extends Model
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* 允许批量赋值的字段
|
||
|
|
*/
|
||
|
|
protected $fillable = [
|
||
|
|
'feedback_id',
|
||
|
|
'user_id',
|
||
|
|
'username',
|
||
|
|
'content',
|
||
|
|
'is_admin',
|
||
|
|
];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 字段类型转换
|
||
|
|
*/
|
||
|
|
protected $casts = [
|
||
|
|
'is_admin' => 'boolean',
|
||
|
|
];
|
||
|
|
|
||
|
|
// ═══════════════ 关联关系 ═══════════════
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 关联所属反馈
|
||
|
|
*/
|
||
|
|
public function feedback(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(FeedbackItem::class, 'feedback_id');
|
||
|
|
}
|
||
|
|
}
|