CustomSendMsgsTransformers.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Http\Controllers\Channel\OfficialAccount\Transformers;
  3. class CustomSendMsgsTransformers
  4. {
  5. public function transform($customSendMsgs){
  6. return [
  7. 'id' => $customSendMsgs->id,
  8. 'appid' => $customSendMsgs->appid,
  9. 'name' => $customSendMsgs->name,
  10. 'send_time' => $customSendMsgs->send_time,
  11. 'content' => $customSendMsgs->content,
  12. 'description' => isset($customSendMsgs->description)?$customSendMsgs->description:'',
  13. 'is_activity' => isset($customSendMsgs->is_activity)?$customSendMsgs->is_activity:'0',
  14. 'redirect_url' => $customSendMsgs->redirect_url,
  15. 'status' => $customSendMsgs->status,
  16. 'distribution_channel_id' => $customSendMsgs->distribution_channel_id,
  17. 'subscribe_time' => $customSendMsgs->subscribe_time,
  18. 'sex' => $customSendMsgs->sex,
  19. 'balance' => $customSendMsgs->balance,
  20. 'order_type' => $customSendMsgs->order_type,
  21. 'category_id' => $customSendMsgs->category_id,
  22. 'is_full_send' => $customSendMsgs->is_full_send,
  23. 'user_num' => $customSendMsgs->user_num,
  24. 'uv' => isset($customSendMsgs->uv)?$customSendMsgs->uv:'',
  25. 'pv' => isset($customSendMsgs->pv)?$customSendMsgs->pv:'',
  26. 'register_user_num' => isset($customSendMsgs->register_user_num)?$customSendMsgs->register_user_num:'',
  27. 'pay_user_num' => isset($customSendMsgs->pay_user_num)?$customSendMsgs->pay_user_num:'',
  28. 'charge_amount' => isset($customSendMsgs->charge_amount)?$customSendMsgs->charge_amount:'',
  29. 'book_name' => isset($customSendMsgs->book_name)?$customSendMsgs->book_name:'',
  30. 'chapter_name' => isset($customSendMsgs->chapter_name)?$customSendMsgs->chapter_name:'',
  31. 'user_category' => isset($customSendMsgs->user_category)?$customSendMsgs->user_category:'',
  32. ];
  33. }
  34. }