Paylist.php 810 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Models;
  4. use Illuminate\Database\Query\Builder;
  5. /**
  6. * @property int $id 记录ID
  7. * @property int $userid 用户ID
  8. * @property float $total 总金额
  9. * @property int $status 状态
  10. * @property int $invoice_id 账单ID
  11. * @property string $tradeno 网关单号
  12. * @property string $gateway 支付网关
  13. * @property int $datetime 创建时间
  14. *
  15. * @mixin Builder
  16. */
  17. final class Paylist extends Model
  18. {
  19. protected $connection = 'default';
  20. protected $table = 'paylist';
  21. /**
  22. * 网关记录状态
  23. */
  24. public function status(): string
  25. {
  26. return match ($this->status) {
  27. 0 => '未支付',
  28. 1 => '已支付',
  29. default => '未知',
  30. };
  31. }
  32. }