WithdrawCashTransformer.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: tandunzhao
  5. * Date: 2017/11/17
  6. * Time: 下午4:40
  7. */
  8. namespace App\Http\Controllers\Channel\Finance\Transformers;
  9. class WithdrawCashTransformer
  10. {
  11. public function transform($withdrawCash){
  12. return [
  13. // 'channel_id' => $withdrawCash->distribution_channel_id,
  14. // 'channel_name' => $withdrawCash->distribution_channel_name,
  15. 'amount' => (float)($withdrawCash->amount),
  16. 'pay_amount' => (float)($withdrawCash->amount - $withdrawCash->tallage),
  17. 'tallage' => (float)($withdrawCash->tallage),
  18. 'status' => $withdrawCash->status,
  19. 'remark' => $withdrawCash->remark,
  20. // 'serial_number' => $withdrawCash->serial_number,
  21. // 'is_company' => (float)$withdrawCash->is_company,
  22. 'check_user_id' => $withdrawCash->check_user_id,
  23. 'check_user_name' => $withdrawCash->check_user_name,
  24. 'created_time' => date('Y-m-d H:i:s',strtotime($withdrawCash->created_at)),
  25. 'updated_time' => date('Y-m-d H:i:s',strtotime($withdrawCash->updated_at)),
  26. ];
  27. }
  28. }