12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App\Transformers\Behavior;
- /**
- * Created by PhpStorm.
- * User: durong
- * Date: 2019/6/14
- * Time: 下午18:34
- */
- use App\Models\CommentRecord;
- use League\Fractal\TransformerAbstract;
- class CommentRecordTransformer extends TransformerAbstract
- {
- public function transform(CommentRecord $commentList)
- {
- return [
- 'id' => $commentList['id'],
- 'created_at' => date($commentList['created_at']),
- 'virus_behavior_id' => $commentList['virus_behavior_id'],
- 'uid' => $commentList['uid'],
- 'upper_trigger_time' => $commentList['upper_trigger_time'],
- 'related_content_id' => $commentList['related_content_id'],
- 'content_author_id' => $commentList['content_author_id'],
- 'superior_commentator_id' => $commentList['superior_commentator_id'],
- 'physical_exertion' => $commentList['physical_exertion'],
- 'trigger_type' => $commentList['trigger_type'],
- 'generation_type' => $commentList['generation_type'],
- 'release_status' => $commentList['release_status'],
- 'generation_quantity' => $commentList['generation_quantity'],
- 'quantity_issued' => $commentList['quantity_issued'],
- 'current_comment_id' => $commentList['current_comment_id'],
- 'superior_comment_id' => $commentList['superior_comment_id'],
- 'behavior_cycle_type' => $commentList->Behavior->behavior_cycle_type,
- 'name' => $commentList->Behavior->name,
- 'relative_series' => $commentList->Behavior->relative_series,
- 'is_open' => $commentList->Behavior->is_open,
- 'bahavior_created_at' => date($commentList->Behavior->created_at),
- ];
- }
- }
|