常用回复和直接回复功能

This commit is contained in:
2025-03-12 14:51:19 +08:00
parent 5ad1a04a98
commit b5a515b0ac
9 changed files with 311 additions and 23 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace plugin\ticket\model;
use think\admin\Model;
class TicketCommonReply extends Model
{
protected $table = 'ticket_common_reply';
protected $autoWriteTimestamp = true;
protected $createTime = 'create_at';
protected $updateTime = 'update_at';
public function getStatusTextAttr($value, $data)
{
return $data['status'] ? '启用' : '禁用';
}
public function scopeAvail($query)
{
return $query->where('status', '=', 1);
}
}

View File

@ -31,4 +31,9 @@ class TicketUserShare extends Model
{
return $this->belongsTo(TicketTicket::class, 'linked_ticket_id', 'id');
}
public function logs()
{
return $this->hasMany(TicketUserShareLog::class, 'us_id', 'id');
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace plugin\ticket\model;
use think\admin\Model;
class TicketUserShareLog extends Model
{
protected $table = 'ticket_user_share_log';
protected $append = ['op_name_with_result'];
public function getOpNameWithResultAttr($value, $data)
{
return $data['op_name'] . ($data['result'] ? " - {$data['result']}" : '');
}
public function userShare()
{
return $this->belongsTo(TicketUserShare::class, 'us_id', 'id');
}
}