PaymentCallback.php 901 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. */
  10. class PaymentCallback extends Model
  11. {
  12. protected $table = 'payment_callback';
  13. protected $primaryKey = 'id';
  14. public function getStatusLabelAttribute()
  15. {
  16. $status_label = '';
  17. switch ($this->attributes['status']) {
  18. case 'WAIT_BUYER_PAY':
  19. $status_label = '等待买家付款';
  20. break;
  21. case 'WAIT_SELLER_SEND_GOODS':
  22. $status_label = '等待卖家发货';
  23. break;
  24. case 'TRADE_SUCCESS':
  25. $status_label = '交易成功';
  26. break;
  27. case 'PAID':
  28. $status_label = '支付完成';
  29. break;
  30. }
  31. return $status_label;
  32. }
  33. }