You've already forked guangan
工单分类
This commit is contained in:
@ -22,4 +22,9 @@ class TicketRepair extends Model
|
||||
{
|
||||
return str2arr($data['imgs'] ?: '', '|');
|
||||
}
|
||||
|
||||
public function scopeNotFinish($query)
|
||||
{
|
||||
$query->where('status', '=', '0');
|
||||
}
|
||||
}
|
@ -125,6 +125,10 @@ class TicketTicket extends Model
|
||||
return $this->hasMany(TicketRepair::class, 'ticket_id')->order('create_at', 'desc');
|
||||
}
|
||||
|
||||
public function views() {
|
||||
return $this->hasMany(TicketView::class, 'ticket_id')->order('create_at', 'desc');
|
||||
}
|
||||
|
||||
public function repair_accept()
|
||||
{
|
||||
return $this->hasMany(TicketRepairAccept::class, 'ticket_id')->order('create_at', 'desc');
|
||||
|
@ -22,4 +22,9 @@ class TicketVerify extends Model
|
||||
{
|
||||
return str2arr($data['imgs'] ?: '', '|');
|
||||
}
|
||||
|
||||
public function scopeNotFinish($query)
|
||||
{
|
||||
$query->where('status', '=', '0');
|
||||
}
|
||||
}
|
30
plugs/think-plugs-ticket/src/model/TicketView.php
Normal file
30
plugs/think-plugs-ticket/src/model/TicketView.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace plugin\ticket\model;
|
||||
|
||||
use plugin\inspection\model\InspectionStaff;
|
||||
use think\admin\Model;
|
||||
|
||||
class TicketView extends Model
|
||||
{
|
||||
protected $append = ['imgs_arr'];
|
||||
public function ticket()
|
||||
{
|
||||
return $this->belongsTo(TicketTicket::class, 'ticket_id');
|
||||
}
|
||||
|
||||
public function staff()
|
||||
{
|
||||
return $this->belongsTo(InspectionStaff::class, 'staff_id');
|
||||
}
|
||||
|
||||
public function getImgsArrAttr($value, $data)
|
||||
{
|
||||
return str2arr($data['imgs'] ?: '', '|');
|
||||
}
|
||||
|
||||
public function scopeNotFinish($query)
|
||||
{
|
||||
$query->where('status', '=', '0');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user