43 lines
863 B
PHP
43 lines
863 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\User;
|
|
|
|
class Withdraw extends Model
|
|
{
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
protected function getStateTextAttribute()
|
|
{
|
|
if ($this->state == 0) {
|
|
return '待审核';
|
|
} else if ($this->state == -1) {
|
|
return '提现失败';
|
|
} elseif ($this->state == 1) {
|
|
return '成功';
|
|
} elseif ($this->state == 2) {
|
|
return '驳回';
|
|
}
|
|
}
|
|
|
|
protected function getTypeTextAttribute()
|
|
{
|
|
switch ($this->type) {
|
|
case 'Alipay':
|
|
return '支付宝';
|
|
break;
|
|
case 'Wechat':
|
|
return '微信零钱';
|
|
break;
|
|
|
|
default:
|
|
return '未知';
|
|
break;
|
|
}
|
|
}
|
|
}
|