Fix
parent
a759b7c8ee
commit
3cd5161b94
|
|
@ -26,7 +26,7 @@ class DealerWalletToBankLogController extends AdminController
|
||||||
*/
|
*/
|
||||||
protected function grid()
|
protected function grid()
|
||||||
{
|
{
|
||||||
$builder = DealerWalletToBankLog::with(['user', 'managerUserInfo']);
|
$builder = DealerWalletToBankLog::with(['user', 'manager.userInfo']);
|
||||||
return Grid::make($builder, function (Grid $grid) {
|
return Grid::make($builder, function (Grid $grid) {
|
||||||
$grid->tools(function (Grid\Tools $tools) {
|
$grid->tools(function (Grid\Tools $tools) {
|
||||||
$tools->append(new DealerWalletWithdraw());
|
$tools->append(new DealerWalletWithdraw());
|
||||||
|
|
@ -38,10 +38,10 @@ class DealerWalletToBankLogController extends AdminController
|
||||||
$grid->column('service_amount')->prepend('¥');
|
$grid->column('service_amount')->prepend('¥');
|
||||||
$grid->column('account_amount')->prepend('¥');
|
$grid->column('account_amount')->prepend('¥');
|
||||||
$grid->column('manager_id')->display(function () {
|
$grid->column('manager_id')->display(function () {
|
||||||
if ($this->managerUserInfo) {
|
if ($this->manager) {
|
||||||
$href = admin_route('dealers.show', ['dealer_user' => $this->manager_id]);
|
$href = admin_route('dealers.show', ['dealer_user' => $this->manager->id]);
|
||||||
|
|
||||||
return "<a href=\"{$href}\" target=\"_blank\">{$this->managerUserInfo->nickname}</a>";
|
return "<a href=\"{$href}\" target=\"_blank\">{$this->manager->userInfo->nickname}</a>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$grid->column('status')->display(function ($v) {
|
$grid->column('status')->display(function ($v) {
|
||||||
|
|
@ -83,7 +83,7 @@ class DealerWalletToBankLogController extends AdminController
|
||||||
*/
|
*/
|
||||||
protected function detail($id)
|
protected function detail($id)
|
||||||
{
|
{
|
||||||
$builder = DealerWalletToBankLog::with(['user', 'managerUserInfo']);
|
$builder = DealerWalletToBankLog::with(['user', 'manager.userInfo']);
|
||||||
return Show::make($id, $builder, function (Show $show) {
|
return Show::make($id, $builder, function (Show $show) {
|
||||||
$show->field('id');
|
$show->field('id');
|
||||||
$show->field('user.phone');
|
$show->field('user.phone');
|
||||||
|
|
@ -92,10 +92,10 @@ class DealerWalletToBankLogController extends AdminController
|
||||||
$show->field('service_amount')->prepend('¥');
|
$show->field('service_amount')->prepend('¥');
|
||||||
$show->field('account_amount')->prepend('¥');
|
$show->field('account_amount')->prepend('¥');
|
||||||
$show->field('manager_id')->unescape()->as(function () {
|
$show->field('manager_id')->unescape()->as(function () {
|
||||||
if ($this->managerUserInfo) {
|
if ($this->manager) {
|
||||||
$href = admin_route('dealers.show', ['dealer_user' => $this->manager_id]);
|
$href = admin_route('dealers.show', ['dealer_user' => $this->manager->id]);
|
||||||
|
|
||||||
return "<a href=\"{$href}\" target=\"_blank\">{$this->managerUserInfo->nickname}</a>";
|
return "<a href=\"{$href}\" target=\"_blank\">{$this->manager->userInfo->nickname}</a>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$show->field('status')->unescape()->as(function ($v) {
|
$show->field('status')->unescape()->as(function ($v) {
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,9 @@ class DealerWalletToBankLog extends Model
|
||||||
return $this->belongsTo(Dealer::class, 'user_id', 'user_id');
|
return $this->belongsTo(Dealer::class, 'user_id', 'user_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function managerUserInfo()
|
public function manager()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(UserInfo::class, 'manager_id', 'user_id');
|
return $this->belongsTo(Dealer::class, 'manager_id', 'user_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue