You've already forked guangan
工单类型调整,状态文字调整
This commit is contained in:
@ -41,7 +41,7 @@ class Ticket extends Controller
|
||||
$query->like(['title|content|contact_name|ticket_address|contact_phone#keyword'])
|
||||
->dateBetween(['create_at'])
|
||||
->equal(['status', 'type_id']);
|
||||
$query->append(['imgs_arr', 'source_type_name', 'status_text', 'type_name', 'last_reply'])->with('approval');
|
||||
$query->append(['imgs_arr', 'source_type_name', 'type_name', 'last_reply'])->with('approval');
|
||||
});
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ class Ticket extends Controller
|
||||
{
|
||||
$this->title = '工单详情';
|
||||
['id' => $id] = $this->_vali(['id.require' => '请指定工单ID!']);
|
||||
$this->vo = TicketTicket::mk()->with(['user', 'type', 'reply'])->append(['imgs_arr', 'status_text', 'type_name', 'last_reply'])->find($id);
|
||||
$this->vo = TicketTicket::mk()->with(['user', 'type', 'reply'])->append(['imgs_arr', 'type_name', 'last_reply'])->find($id);
|
||||
$process = ApprovalProcess::where('type', '=', 'GDSH')->order('id', 'asc')->findOrEmpty();
|
||||
$instance = ApprovalInstance::query()->with(['steps.approver', 'logs'])->where('process_id', '=', $process->id)->where('oid', '=', $id)->findOrEmpty();
|
||||
$this->instance = $instance;
|
||||
@ -130,7 +130,7 @@ class Ticket extends Controller
|
||||
'ticket_id.require'=>'请指定工单ID!',
|
||||
'id.require'=>'请指定回复ID!'
|
||||
]);
|
||||
$this->vo = TicketTicket::mk()->with(['user', 'type'])->append(['imgs_arr', 'status_text', 'type_name'])->find($ticket_id);
|
||||
$this->vo = TicketTicket::mk()->with(['user', 'type'])->append(['imgs_arr', 'type_name'])->find($ticket_id);
|
||||
TicketReply::mForm('reply');
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ class Ticket extends Controller
|
||||
] = $this->_vali([
|
||||
'id.require'=>'请指定回复ID!'
|
||||
]);
|
||||
$this->vo = TicketTicket::query()->with(['user', 'type'])->append(['imgs_arr', 'status_text', 'type_name'])->find($id);
|
||||
$this->vo = TicketTicket::query()->with(['user', 'type'])->append(['imgs_arr', 'type_name'])->find($id);
|
||||
$process = ApprovalProcess::where('type', '=', 'GDSH')->order('id', 'asc')->findOrEmpty();
|
||||
if ($process->isEmpty()) {
|
||||
$this->error('未找到可用的审核流程');
|
||||
@ -368,7 +368,7 @@ class Ticket extends Controller
|
||||
->dateBetween(['create_at'])
|
||||
->equal(['status', 'type_id']);
|
||||
$query->whereIn("id", ApprovalStep::query()->where(['approver_id' => $this->user_id, 'status' => 0, 'approver_type' => 1, 'instance.status' => 0])->field("oid")->select())
|
||||
->append(['imgs_arr', 'source_type_name', 'status_text', 'type_name', 'last_reply'])->with('approval');
|
||||
->append(['imgs_arr', 'source_type_name', 'type_name', 'last_reply'])->with('approval');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ namespace plugin\ticket\model;
|
||||
|
||||
use plugin\inspection\model\InspectionStaff;
|
||||
use think\admin\Model;
|
||||
use think\admin\model\SystemUser;
|
||||
|
||||
class TicketTicket extends Model
|
||||
{
|
||||
@ -51,9 +52,9 @@ class TicketTicket extends Model
|
||||
public function getSourceTypeList()
|
||||
{
|
||||
return [
|
||||
0 => '其他',
|
||||
0 => '管理人员创建',
|
||||
1 => '用户随手拍',
|
||||
2 => '工单',
|
||||
2 => '维修人员上报',
|
||||
];
|
||||
}
|
||||
|
||||
@ -67,14 +68,6 @@ class TicketTicket extends Model
|
||||
}
|
||||
}
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
if (!empty($this->getStatusList()[$data['status']])) {
|
||||
return $this->getStatusList()[$data['status']];
|
||||
} else {
|
||||
return '未知';
|
||||
}
|
||||
}
|
||||
|
||||
public function getDeptNameAttr($value, $data)
|
||||
{
|
||||
@ -86,15 +79,6 @@ class TicketTicket extends Model
|
||||
}
|
||||
}
|
||||
|
||||
private function getStatusList()
|
||||
{
|
||||
return [
|
||||
-1 => '待审核',
|
||||
0 => '待处理',
|
||||
1 => '已作处理',
|
||||
];
|
||||
}
|
||||
|
||||
public function scopeAvail($query)
|
||||
{
|
||||
return $query->where('status', '>=', '0');
|
||||
@ -112,7 +96,7 @@ class TicketTicket extends Model
|
||||
|
||||
public function fzUser()
|
||||
{
|
||||
return $this->belongsTo(InspectionStaff::class, 'fz_user_id');
|
||||
return $this->belongsTo(SystemUser::class, 'fz_user_id');
|
||||
}
|
||||
|
||||
public function verify()
|
||||
|
Reference in New Issue
Block a user