95 lines
2.8 KiB
PHP
95 lines
2.8 KiB
PHP
<?php
|
|
|
|
namespace App\Admin\Controllers;
|
|
|
|
use App\Models\Oldman;
|
|
use Dcat\Admin\Form;
|
|
use Dcat\Admin\Grid;
|
|
use Dcat\Admin\Show;
|
|
use Dcat\Admin\Layout\Content;
|
|
use Dcat\Admin\Http\Controllers\AdminController;
|
|
use App\Admin\Pages\LiveIn;
|
|
use Illuminate\Http\Request;
|
|
|
|
class LiveInController extends AdminController
|
|
{
|
|
/**
|
|
* Make a grid builder.
|
|
*
|
|
* @return Grid
|
|
*/
|
|
protected function grid()
|
|
{
|
|
// $builder = Oldman::where();
|
|
return Grid::make(new Oldman(), function (Grid $grid) {
|
|
$grid->column('name');
|
|
$grid->column('card_no');
|
|
$grid->column('client_name');
|
|
$grid->column('nurse_lv')->sortable();
|
|
$grid->column('live_in_at')->sortable();
|
|
$grid->column('avliable_at')->sortable();
|
|
// $grid->column('created_at')->sortable();
|
|
|
|
$grid->disableCreateButton();
|
|
$grid->tools("
|
|
<div class='pull-right' data-responsive-table-toolbar='grid-table'>
|
|
<a href='".admin_route('live_in.create')."' class='btn btn-primary dialog-create btn-outline' target='_blank'>
|
|
<i class='feather icon-plus'></i><span class='d-none d-sm-inline'> 入住</span>
|
|
</a>
|
|
</div>");
|
|
|
|
$grid->filter(function (Grid\Filter $filter) {
|
|
$filter->equal('name')->width(3);
|
|
$filter->equal('card_no')->width(3);
|
|
$filter->equal('nurse_lv')->select()->width(3);
|
|
});
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Make a show builder.
|
|
*
|
|
* @param mixed $id
|
|
*
|
|
* @return Show
|
|
*/
|
|
protected function detail($id)
|
|
{
|
|
return Show::make($id, new Oldman(), function (Show $show) {
|
|
$show->field('id');
|
|
$show->field('floor_name');
|
|
$show->field('agreement_no');
|
|
$show->field('name');
|
|
$show->field('sex');
|
|
$show->field('birthday');
|
|
$show->field('card_no');
|
|
$show->field('card_province_id');
|
|
$show->field('card_city_id');
|
|
$show->field('card_area_id');
|
|
$show->field('card_address');
|
|
$show->field('client_name');
|
|
$show->field('client_province_id');
|
|
$show->field('client_city_id');
|
|
$show->field('client_area_id');
|
|
$show->field('client_address');
|
|
$show->field('client_phone');
|
|
$show->field('nurse_lv');
|
|
$show->field('created_at');
|
|
$show->field('updated_at');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 入住
|
|
*/
|
|
public function create(Content $content){
|
|
return $content->header('客人入住')
|
|
->description('表单')
|
|
->body(new LiveIn());
|
|
}
|
|
|
|
public function toStore(Request $request){
|
|
|
|
}
|
|
}
|