diff --git a/app/adminapi/controller/finance/WithdrawController.php b/app/adminapi/controller/finance/WithdrawController.php index 56e6b7a6d..bb70631a8 100644 --- a/app/adminapi/controller/finance/WithdrawController.php +++ b/app/adminapi/controller/finance/WithdrawController.php @@ -12,7 +12,7 @@ class WithdrawController extends BaseAdminController { [$page, $limit] = $this->getPage(); $status = $this->request->param('status'); - $query = Withdraw::where('status', '<>', -1); + $query = Withdraw::with('user'); if ($status !== '') { $query->where('status', $status); } diff --git a/app/common/model/user/Withdraw.php b/app/common/model/user/Withdraw.php index 990c74957..790a7d9ab 100644 --- a/app/common/model/user/Withdraw.php +++ b/app/common/model/user/Withdraw.php @@ -12,5 +12,10 @@ class Withdraw extends Model return 'TX' . date('YmdHis') . rand(10000, 99999); } + public function user() + { + return $this->belongsTo(User::class, 'user_id', 'id')->bind(['account', 'nickname', 'avatar']); + } + }