6
0
Fork 0
release
李静 2022-04-12 10:24:49 +08:00
parent f78debbb37
commit 8a4cc82456
3 changed files with 5 additions and 9 deletions

View File

@ -66,7 +66,7 @@ class MonthlyStatisticsController extends Controller
->sum('change_balance'); ->sum('change_balance');
// 提现总额 // 提现总额
$withdrawAmount = WalletToBankLog::where('status', WalletToBankLogStatus::Completed) $withdrawAmount = WalletToBankLog::where('status', WalletToBankLogStatus::Success)
->whereBetween('updated_at', [$start, $end]) ->whereBetween('updated_at', [$start, $end])
->sum('amount'); ->sum('amount');

View File

@ -4,7 +4,7 @@ namespace App\Enums;
enum WalletToBankLogStatus: int { enum WalletToBankLogStatus: int {
case Pending = 0; case Pending = 0;
case Completed = 1; case Success = 1;
case Refused = 2; case Refused = 2;
/** /**
@ -14,7 +14,7 @@ enum WalletToBankLogStatus: int {
{ {
return match ($this) { return match ($this) {
static::Pending => '#5b69bc', static::Pending => '#5b69bc',
static::Completed => '#21b978', static::Success => '#21b978',
static::Refused => '#b3b9bf', static::Refused => '#b3b9bf',
}; };
} }
@ -34,8 +34,8 @@ enum WalletToBankLogStatus: int {
{ {
return [ return [
static::Pending->value => '待处理', static::Pending->value => '待处理',
static::Completed->value => '已完成', static::Success->value => '',
static::Refused->value => '拒绝', static::Refused->value => '拒绝',
]; ];
} }
} }

View File

@ -12,10 +12,6 @@ class WalletToBankLog extends Model
use HasFactory; use HasFactory;
use HasDateTimeFormatter; use HasDateTimeFormatter;
public const STATUS_PENDING = 0; // 待审核
public const STATUS_AGREE = 1; // 已完成
public const STATUS_REFUSE = 2; // 已拒绝
protected $casts = [ protected $casts = [
'status' => WalletToBankLogStatus::class, 'status' => WalletToBankLogStatus::class,
]; ];