Recharge.php 822 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Models;
  3. use App\Constants\Util;
  4. class Recharge extends BaseModel
  5. {
  6. protected $table = 'recharges';
  7. // protected $fillable = ['member_id', 'confirmations', 'coin', 'txid','block_time','block_height' ,'net' ,'coin' ,'amount' ,'to_address' ,'from_address' ,'status'];
  8. const STATUS_STAY = 0;
  9. const STATUS_SUCCESS = 1;
  10. const STATUS_FAIL = 2;
  11. const STATUS_IGNORE = 3;
  12. public static $STATUS = [
  13. 0 => '待确认',
  14. 1 => '已确认',
  15. 2 => '失败',
  16. 3 => '已忽略',
  17. ];
  18. const TYPE_AUTO = 1; // 自动
  19. const TYPE_HAND = 2; // 手动
  20. protected function getAmountAttribute($value)
  21. {
  22. return floatval($value);
  23. }
  24. protected function getImageAttribute($value)
  25. {
  26. return Util::ensureUrl($value);
  27. }
  28. }