1
This commit is contained in:
@@ -38,8 +38,6 @@ class PostFavoriteController extends BaseController
|
|||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
foreach ($raw['records'] as $key => $item) {
|
foreach ($raw['records'] as $key => $item) {
|
||||||
$item['created_at'] = strtotime($item['created_at']);
|
|
||||||
$item['updated_at'] = strtotime($item['updated_at']);
|
|
||||||
$data[$key] = $this->indexFormat($item);
|
$data[$key] = $this->indexFormat($item);
|
||||||
}
|
}
|
||||||
$raw['records'] = $data;
|
$raw['records'] = $data;
|
||||||
@@ -57,10 +55,10 @@ class PostFavoriteController extends BaseController
|
|||||||
*/
|
*/
|
||||||
protected function indexFormat($data)
|
protected function indexFormat($data)
|
||||||
{
|
{
|
||||||
if (isset($data['created_at']))
|
// if (isset($data['created_at']))
|
||||||
$data['created_at'] = date('Y-m-d H:i:s', $data['created_at']);
|
// $created_at = date('Y-m-d H:i:s', $data['created_at']->getTimestamp());
|
||||||
if (isset($data['updated_at']))
|
// if (isset($data['updated_at']))
|
||||||
$data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']);
|
// $data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']->getTimestamp());
|
||||||
if (isset($data['post_id'])){
|
if (isset($data['post_id'])){
|
||||||
$ossservice = new OssService();
|
$ossservice = new OssService();
|
||||||
$post = Post::where('id', $data['post_id'])->first()->toArray();
|
$post = Post::where('id', $data['post_id'])->first()->toArray();
|
||||||
|
|||||||
Reference in New Issue
Block a user