mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-14 19:40:53 +08:00
Revert "fix: resolve PHPStan static analysis warnings"
This reverts commit 2d3e4b4a95.
This commit is contained in:
@@ -3,20 +3,7 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* App\Models\TicketMessage
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $ticket_id
|
||||
* @property int $user_id
|
||||
* @property string $message
|
||||
* @property \Illuminate\Support\Carbon $created_at
|
||||
* @property \Illuminate\Support\Carbon $updated_at
|
||||
* @property-read \App\Models\Ticket $ticket 关联的工单
|
||||
* @property-read bool $is_me 当前消息是否由工单发起人发送
|
||||
*/
|
||||
class TicketMessage extends Model
|
||||
{
|
||||
protected $table = 'v2_ticket_message';
|
||||
@@ -26,22 +13,4 @@ class TicketMessage extends Model
|
||||
'created_at' => 'timestamp',
|
||||
'updated_at' => 'timestamp'
|
||||
];
|
||||
|
||||
protected $appends = ['is_me'];
|
||||
|
||||
/**
|
||||
* 关联的工单
|
||||
*/
|
||||
public function ticket(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Ticket::class, 'ticket_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断消息是否由工单发起人发送
|
||||
*/
|
||||
public function getIsMeAttribute(): bool
|
||||
{
|
||||
return $this->ticket->user_id === $this->user_id;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user