CustomSendMsgsTransformers.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Http\Controllers\Manage\OfficialAccount\Transformers;
  3. class CustomSendMsgsTransformers
  4. {
  5. public function transform($customSendMsgs){
  6. return [
  7. 'id' => $customSendMsgs->id,
  8. 'appid' => $customSendMsgs->appid,
  9. 'official_account_name' => isset($customSendMsgs->official_account_name)?$customSendMsgs->official_account_name:'',
  10. 'name' => $customSendMsgs->name,
  11. 'send_time' => $customSendMsgs->send_time,
  12. 'content' => $customSendMsgs->content,
  13. 'redirect_url' => $customSendMsgs->redirect_url,
  14. 'status' => $customSendMsgs->status,
  15. 'distribution_channel_id' => $customSendMsgs->distribution_channel_id,
  16. 'subscribe_time' => $customSendMsgs->subscribe_time,
  17. 'sex' => $customSendMsgs->sex,
  18. 'balance' => $customSendMsgs->balance,
  19. 'order_type' => $customSendMsgs->order_type,
  20. 'category_id' => $customSendMsgs->category_id,
  21. 'user_num' => $customSendMsgs->user_num,
  22. 'is_full_send' => $customSendMsgs->is_full_send,
  23. 'trusteeship' => $customSendMsgs->trusteeship,
  24. 'batch_no' => isset($customSendMsgs->batch_no)?$customSendMsgs->batch_no:'',
  25. 'position' => isset($customSendMsgs->position)?$customSendMsgs->position:'',
  26. 'book_names' => isset($customSendMsgs->book_names)?$customSendMsgs->book_names:'',
  27. 'bids' => isset($customSendMsgs->bids)?$customSendMsgs->bids:'',
  28. 'suc_order_num' => isset($customSendMsgs->suc_order_num)?$customSendMsgs->suc_order_num:'',
  29. 'total_order_num' => isset($customSendMsgs->total_order_num)?$customSendMsgs->total_order_num:'',
  30. 'order_suc_rate' => isset($customSendMsgs->order_suc_rate)?$customSendMsgs->order_suc_rate:'',
  31. 'success_order_sum' => isset($customSendMsgs->success_order_sum)?$customSendMsgs->success_order_sum:'',
  32. 'pv' => isset($customSendMsgs->pv)?$customSendMsgs->pv:'0',
  33. 'uv' => isset($customSendMsgs->uv)?$customSendMsgs->uv:'0',
  34. ];
  35. }
  36. }