增加时间轴内容
This commit is contained in:
@@ -186,14 +186,15 @@ class ApprovalRecordsController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
protected function timelineFormat($data)
|
protected function timelineFormat($data)
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach ($data as $record) {
|
foreach ($data as $record) {
|
||||||
$result[] = [
|
$result[] = [
|
||||||
'id' => $record['id'],
|
'id' => $record['id'],
|
||||||
'name' => $record['approver']['name'],
|
'name' => $record['approver']['name'],
|
||||||
'comment' => $record['comment'],
|
'comment' => $record['comment'] ?? '',
|
||||||
'time' => $record['updated_at']
|
'time' => $record['updated_at'],
|
||||||
|
'status_desc' => SysDictItem::where('item_value', $record['status'])->where('status', 1)->value('item_label'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ class ApprovalRecordsService
|
|||||||
public function serviceApprovalTimeline(Request $request, array $data = [])
|
public function serviceApprovalTimeline(Request $request, array $data = [])
|
||||||
{
|
{
|
||||||
$instance = \app\common\model\ApprovalInstances::where('biz_id', $data['id'])->where('flow_type', $data['flow_type'])->first();
|
$instance = \app\common\model\ApprovalInstances::where('biz_id', $data['id'])->where('flow_type', $data['flow_type'])->first();
|
||||||
|
if (!$instance) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
$result = \app\common\model\ApprovalRecords::where('instance_id', $instance->id)->with('approver')->orderBy('id', 'desc')->get();
|
$result = \app\common\model\ApprovalRecords::where('instance_id', $instance->id)->with('approver')->orderBy('id', 'desc')->get();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user