You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
2.2 KiB
87 lines
2.2 KiB
<?php
|
|
|
|
namespace App\Admin\Controllers;
|
|
|
|
use App\Admin\Repositories\LanzuMmInfo;
|
|
use Dcat\Admin\Form;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Show;
|
|
use Dcat\Admin\Controllers\AdminController;
|
|
|
|
class LanzuMmInfoController extends AdminController
|
|
{
|
|
/**
|
|
* Make a grid builder.
|
|
*
|
|
* @return Grid
|
|
*/
|
|
protected function grid()
|
|
{
|
|
return Grid::make(new LanzuMmInfo(), function (Grid $grid) {
|
|
$grid->id->sortable();
|
|
$grid->name;
|
|
$grid->phone;
|
|
$grid->id_frond->image('',50,50);
|
|
$grid->id_back->image('',50,50);
|
|
$grid->id_number;
|
|
$grid->column('status','状态')->display(function ($status){
|
|
if ($status==1){
|
|
return '正常';
|
|
}else{
|
|
return '禁用';
|
|
}
|
|
});
|
|
$grid->created_at->display(function ($time){
|
|
return date('Y-m-d H:i:s',$time);
|
|
});
|
|
$grid->filter(function (Grid\Filter $filter) {
|
|
$filter->equal('id');
|
|
|
|
});
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Make a show builder.
|
|
*
|
|
* @param mixed $id
|
|
*
|
|
* @return Show
|
|
*/
|
|
protected function detail($id)
|
|
{
|
|
return Show::make($id, new LanzuMmInfo(), function (Show $show) {
|
|
$show->id;
|
|
$show->name;
|
|
$show->phone;
|
|
$show->id_frond->image();
|
|
$show->id_back->image();
|
|
$show->id_number;
|
|
$show->admin_user_id;
|
|
$show->status;
|
|
$show->is_del;
|
|
$show->created_at;
|
|
$show->updated_at;
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Make a form builder.
|
|
*
|
|
* @return Form
|
|
*/
|
|
protected function form()
|
|
{
|
|
return Form::make(new LanzuMmInfo(), function (Form $form) {
|
|
$form->display('id');
|
|
$form->text('name');
|
|
$form->text('phone');
|
|
$form->image('id_frond')->uniqueName();
|
|
$form->image('id_back')->uniqueName();
|
|
$form->text('id_number');
|
|
$form->text('status','状态');
|
|
$form->display('created_at');
|
|
$form->display('updated_at');
|
|
});
|
|
}
|
|
}
|