时间处理
This commit is contained in:
@@ -33,7 +33,7 @@ class InvRequisitionController extends BaseController
|
|||||||
$data = $this->service->serviceApprove($request);
|
$data = $this->service->serviceApprove($request);
|
||||||
return $this->success($data);
|
return $this->success($data);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return $this->error($e->getMessage().$e->getFile().$e->getLine().$e->getTraceAsString());
|
return $this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,6 +87,16 @@ class InvRequisitionController extends BaseController
|
|||||||
{
|
{
|
||||||
if (isset($data['id'])){
|
if (isset($data['id'])){
|
||||||
$data['approve'] = InvRequisitionApprove::where('requisition_id', $data['id'])->get()->toArray();
|
$data['approve'] = InvRequisitionApprove::where('requisition_id', $data['id'])->get()->toArray();
|
||||||
|
foreach ($data['approve'] as $key => $value) {
|
||||||
|
if (isset($value['created_at'])){
|
||||||
|
$value['created_at'] = is_int($value['created_at'])?$value['created_at']:strtotime($value['created_at']);
|
||||||
|
$data['approve'][$key]['created_at'] = date('Y-m-d H:i:s', $value['created_at']);
|
||||||
|
}
|
||||||
|
if (isset($value['updated_at'])){
|
||||||
|
$value['updated_at'] = is_int($value['updated_at'])?$value['updated_at']:strtotime($value['updated_at']);
|
||||||
|
$data['approve'][$key] = date('Y-m-d H:i:s', $value['updated_at']);
|
||||||
|
}
|
||||||
|
}
|
||||||
$approve_id = !empty($data['approve'])?array_pop($data['approve'])['id']:null;
|
$approve_id = !empty($data['approve'])?array_pop($data['approve'])['id']:null;
|
||||||
$data['approve_id'] = $approve_id;
|
$data['approve_id'] = $approve_id;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user