增加审批时间轴&&调整采购单
This commit is contained in:
@@ -169,4 +169,33 @@ class ApprovalRecordsController extends BaseController
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function approvalTimeline(Request $request)
|
||||
{
|
||||
try {
|
||||
$raw = $this->service->serviceApprovalTimeline($request, $request->all());
|
||||
$data = $this->transformData($raw, method_exists($this, 'timelineFormat')
|
||||
? [$this, 'timelineFormat']
|
||||
: null);
|
||||
return $this->success($data);
|
||||
} catch (\Throwable $e) {
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function timelineFormat($data)
|
||||
{
|
||||
$result = [];
|
||||
foreach ($data as $record) {
|
||||
$result[] = [
|
||||
'id' => $record['id'],
|
||||
'name' => $record['approver']['name'],
|
||||
'comment' => $record['comment'],
|
||||
'time' => $record['updated_at']
|
||||
];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user