You've already forked guangan
更改为巡检异常上报
This commit is contained in:
35
plugs/think-plugs-ticket/src/model/TicketInspectionShare.php
Normal file
35
plugs/think-plugs-ticket/src/model/TicketInspectionShare.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace plugin\ticket\model;
|
||||
|
||||
use think\admin\Model;
|
||||
|
||||
class TicketInspectionShare extends Model
|
||||
{
|
||||
protected $append = ['type_name', 'imgs_arr'];
|
||||
public function getImgsArrAttr($value, $data)
|
||||
{
|
||||
return str2arr($data['imgs'] ?: '', '|');
|
||||
}
|
||||
|
||||
public function type()
|
||||
{
|
||||
return $this->belongsTo(TicketType::class, 'type_id', 'id');
|
||||
}
|
||||
|
||||
public function getTypeNameAttr($value, $data)
|
||||
{
|
||||
$type = $this->type()->find();
|
||||
if (!empty($type)) {
|
||||
return $type['name'];
|
||||
} else {
|
||||
return '未知';
|
||||
}
|
||||
}
|
||||
|
||||
public function linkedTicket()
|
||||
{
|
||||
return $this->belongsTo(TicketTicket::class, 'linked_ticket_id', 'id');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user