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');
// 提现总额
$withdrawAmount = WalletToBankLog::where('status', WalletToBankLogStatus::Completed)
$withdrawAmount = WalletToBankLog::where('status', WalletToBankLogStatus::Success)
->whereBetween('updated_at', [$start, $end])
->sum('amount');

View File

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

View File

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