芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/rentandbuyrealty.com/pennysave/application/app/Models/Deposit.php
'object' ]; public function user() { return $this->belongsTo(User::class); } public function gateway() { return $this->belongsTo(Gateway::class, 'method_code', 'code'); } public function statusBadge(): Attribute { return new Attribute( get:fn () => $this->badgeData(), ); } public function badgeData(){ $html = ''; if($this->status == 2){ $html = '
'.trans('Pending').'
'; } elseif($this->status == 1 && $this->method_code >= 1000){ $html = '
'.trans('Approved').'
'; } elseif($this->status == 1 && $this->method_code < 1000){ $html = '
'.trans('Succeed').'
'; } elseif($this->status == 3){ $html = '
'.trans('Rejected').'
'; }else{ $html = '
'.trans('Initiated').'
'; } return $html; } // scope public function scopeGatewayCurrency() { return GatewayCurrency::where('method_code', $this->method_code)->where('currency', $this->method_currency)->first(); } public function scopeBaseCurrency() { return @$this->gateway->crypto == 1 ? 'USD' : $this->method_currency; } public function scopePending() { return $this->where('method_code','>=',1000)->where('status', 2); } public function scopeRejected() { return $this->where('method_code','>=',1000)->where('status', 3); } public function scopeApproved() { return $this->where('method_code','>=',1000)->where('status', 1); } public function scopeSuccessful() { return $this->where('status', 1); } public function scopeInitiated() { return $this->where('status', 0); } }