PaymentCallback.php 957 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Http\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. /**
  5. * 支付回调(有赞云支付)
  6. * Class PaymentCallback
  7. *
  8. * @package App\Http\Models
  9. * @mixin \Eloquent
  10. */
  11. class PaymentCallback extends Model
  12. {
  13. protected $table = 'payment_callback';
  14. protected $primaryKey = 'id';
  15. protected $appends = ['status_label'];
  16. function getStatusLabelAttribute()
  17. {
  18. $status_label = '';
  19. switch ($this->attributes['status']) {
  20. case 'WAIT_BUYER_PAY':
  21. $status_label = '等待买家付款';
  22. break;
  23. case 'WAIT_SELLER_SEND_GOODS':
  24. $status_label = '等待卖家发货';
  25. break;
  26. case 'TRADE_SUCCESS':
  27. $status_label = '交易成功';
  28. break;
  29. case 'PAID':
  30. $status_label = '支付完成';
  31. break;
  32. }
  33. return $status_label;
  34. }
  35. }