更新代码
This commit is contained in:
42
app/Models/Withdraw.php
Normal file
42
app/Models/Withdraw.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user