SmartPushMsgTransformer.php 1.5 KB

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Http\Controllers\Channel\OfficialAccount\Transformers;
  3. class SmartPushMsgTransformer
  4. {
  5. public function transform($smartPushsMsg){
  6. return [
  7. 'id' => isset($smartPushsMsg->id)?$smartPushsMsg->id:'',
  8. 'distribution_channel_id' => isset($smartPushsMsg->distribution_channel_id)?$smartPushsMsg->distribution_channel_id:'',
  9. 'name' => isset($smartPushsMsg->name)?$smartPushsMsg->name:'',
  10. 'category_type' => isset($smartPushsMsg->category_type)?$smartPushsMsg->category_type:'',
  11. 'content' => isset($smartPushsMsg->content)?$smartPushsMsg->content:'',
  12. 'description' => isset($smartPushsMsg->description)?$smartPushsMsg->description:'',
  13. 'book_name' => isset($smartPushsMsg->book_name)?$smartPushsMsg->book_name:'',
  14. 'chapter_name' => isset($smartPushsMsg->chapter_name)?$smartPushsMsg->chapter_name:'',
  15. 'sex' => isset($smartPushsMsg->sex)?$smartPushsMsg->sex:'',
  16. 'appid' => isset($smartPushsMsg->appid)?$smartPushsMsg->appid:'',
  17. 'status' => isset($smartPushsMsg->status)?$smartPushsMsg->status:'',
  18. 'user_num' => isset($smartPushsMsg->user_num)?$smartPushsMsg->user_num:'',
  19. 'created_at' => isset($smartPushsMsg->created_at)?$smartPushsMsg->created_at:'',
  20. 'updated_at' => isset($smartPushsMsg->updated_at)?$smartPushsMsg->updated_at:'',
  21. ];
  22. }
  23. }