You've already forked guangan
常用回复和直接回复功能
This commit is contained in:
23
plugs/think-plugs-ticket/src/model/TicketCommonReply.php
Normal file
23
plugs/think-plugs-ticket/src/model/TicketCommonReply.php
Normal 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);
|
||||
}
|
||||
}
|
@ -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');
|
||||
}
|
||||
}
|
21
plugs/think-plugs-ticket/src/model/TicketUserShareLog.php
Normal file
21
plugs/think-plugs-ticket/src/model/TicketUserShareLog.php
Normal 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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user