'增加浏览量:', 'add_praise_count' => '增加点赞数:', 'add_collect_count' => '增加收藏数:', 'add_share_count' => '增加分享数:', 'delete' => '删除内容:', 'update_topic' => '编辑内容话题:', ]; $data = json_decode($postLog['content']); $content = ''; foreach($data as $key => $val){ if(!$val) continue; $content .= $type[$key] . $val .'、'; } $content = rtrim($content, '、'); return [ 'id' => $postLog['id'], 'username' => $postLog['username'], 'log_type' => $postLog['log_type'], 'created_at' => Carbon::parse($postLog['created_at'])->toDateTimeString(), 'content' => $content, ]; } }