|
|
|
@ -18,18 +18,24 @@ class LanzuMpWithdrawController extends AdminController |
|
|
|
*/ |
|
|
|
protected function grid() |
|
|
|
{ |
|
|
|
return Grid::make(new LanzuMpWithdraw(), function (Grid $grid) { |
|
|
|
return Grid::make(new LanzuMpWithdraw(['mpInfo']), function (Grid $grid) { |
|
|
|
$grid->id->sortable(); |
|
|
|
$grid->mp_id; |
|
|
|
$grid->column('mpInfo.name','服务商名字'); |
|
|
|
$grid->money; |
|
|
|
$grid->status; |
|
|
|
$grid->status('提现状态')->using([-1=>'拒绝',0=>'审核中',1=>'通过']) |
|
|
|
->label([-1=>'danger',0=>'default',1=>'success']); |
|
|
|
$grid->created_at; |
|
|
|
$grid->updated_at->sortable(); |
|
|
|
|
|
|
|
$grid->filter(function (Grid\Filter $filter) { |
|
|
|
$filter->equal('id'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
$grid->actions(function (Grid\Displayers\Actions $actions) { |
|
|
|
$actions->disableDelete(); |
|
|
|
// $actions->disableEdit();
|
|
|
|
$actions->disableQuickEdit(); |
|
|
|
$actions->disableView(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
@ -42,9 +48,10 @@ class LanzuMpWithdrawController extends AdminController |
|
|
|
*/ |
|
|
|
protected function detail($id) |
|
|
|
{ |
|
|
|
return Show::make($id, new LanzuMpWithdraw(), function (Show $show) { |
|
|
|
return Show::make($id, new LanzuMpWithdraw(['mpInfo']), function (Show $show) { |
|
|
|
$show->id; |
|
|
|
$show->mp_id; |
|
|
|
$show->column('服务商名称','mpInfo.name'); |
|
|
|
$show->money; |
|
|
|
$show->status; |
|
|
|
$show->created_at; |
|
|
|
@ -58,21 +65,74 @@ class LanzuMpWithdrawController extends AdminController |
|
|
|
* @return Form |
|
|
|
*/ |
|
|
|
|
|
|
|
public function mpForm(){ |
|
|
|
|
|
|
|
protected function lanzu_bis_form(){ |
|
|
|
//管理员或者lanzu_bis操作
|
|
|
|
return Form::make(new LanzuMpWithdraw(['mpInfo']), function (Form $form) { |
|
|
|
|
|
|
|
$form->footer(function ($footer) { |
|
|
|
// 去掉`查看`checkbox
|
|
|
|
$footer->disableViewCheck(); |
|
|
|
// 去掉`继续编辑`checkbox
|
|
|
|
$footer->disableEditingCheck(); |
|
|
|
// 去掉`继续创建`checkbox
|
|
|
|
$footer->disableCreatingCheck(); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$form->tools(function (Form\Tools $tools) { |
|
|
|
// 去掉跳转详情页按钮
|
|
|
|
$tools->disableView(); |
|
|
|
// 去掉删除按钮
|
|
|
|
$tools->disableDelete(); |
|
|
|
$tools->disableList(); |
|
|
|
}); |
|
|
|
|
|
|
|
// dd($form->model()->mp_info['name']);
|
|
|
|
$mpName = $form->model()->mp_info['name']; |
|
|
|
//dd( $mpName);
|
|
|
|
$form->display('id'); |
|
|
|
$form->text('mp_id','服务商ID')->disable(); |
|
|
|
$form->display('','服务商名')->value($mpName); |
|
|
|
$form->text('money','提现金额')->disable()->required(); |
|
|
|
$form->hidden('is_operated'); |
|
|
|
$form->saving(function (Form $form) { |
|
|
|
$form->is_operated = 1; |
|
|
|
}); |
|
|
|
|
|
|
|
if($form->model()->is_operated){ |
|
|
|
$status = ''; |
|
|
|
if($form->model()->status==1){ |
|
|
|
$status = '审核通过'; |
|
|
|
} |
|
|
|
if($form->model()->status==-1){ |
|
|
|
$status = '拒绝'; |
|
|
|
} |
|
|
|
$form->display('','审核状态')->value($status); |
|
|
|
$form->disableSubmitButton(); |
|
|
|
$form->disableResetButton(); |
|
|
|
}else{ |
|
|
|
$form->radio('status')->options([1 => '通过审核', -1=> '拒绝'])->default(-1);; |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
protected function form() |
|
|
|
{ |
|
|
|
$current_user = Admin::user(); |
|
|
|
|
|
|
|
if(!$current_user->isRole('lanzu_mp')){ |
|
|
|
return $this->lanzu_bis_form(); |
|
|
|
} |
|
|
|
|
|
|
|
//如果是服务商角色
|
|
|
|
$mp = MpBalance::where('user_id',$current_user->id) |
|
|
|
->where('user_type',1)->first(); |
|
|
|
|
|
|
|
$balance = 0; |
|
|
|
|
|
|
|
if($mp){ |
|
|
|
$balance = $mp->balance; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return Form::make(new LanzuMpWithdraw(), function (Form $form) use($current_user,$balance) { |
|
|
|
|
|
|
|
$form->footer(function ($footer) { |
|
|
|
@ -101,16 +161,4 @@ class LanzuMpWithdrawController extends AdminController |
|
|
|
//$form->text('status');
|
|
|
|
}); |
|
|
|
} |
|
|
|
protected function form() |
|
|
|
{ |
|
|
|
return Form::make(new LanzuMpWithdraw(), function (Form $form) { |
|
|
|
$form->display('id'); |
|
|
|
$form->text('mp_id'); |
|
|
|
$form->text('money'); |
|
|
|
$form->text('status'); |
|
|
|
|
|
|
|
$form->display('created_at'); |
|
|
|
$form->display('updated_at'); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |