链街Dcat后台
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.
 
 
 
 

108 lines
2.8 KiB

<?php
namespace App\Admin\Controllers;
use App\Admin\Repositories\ImsCjdcMarket;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Controllers\AdminController;
class ImsCjdcMarketController extends AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
return Grid::make(new ImsCjdcMarket(), function (Grid $grid) {
$grid->id->sortable();
$grid->logo->image('',50,50);
$grid->name;
$grid->column('status','状态')->display(function ($status){
if ($status==0){
return '禁用';
}else{
return '正常';
}
});
$grid->address;
$grid->column('addtime','创建时间');
$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 ImsCjdcMarket(), function (Show $show) {
$show->id;
$show->name;
$show->logo;
$show->introduce;
$show->imgs;
$show->addtime;
$show->sort;
$show->status;
$show->coordinates;
$show->remark;
$show->address;
$show->poundage;
$show->dn_poundage;
$show->dm_poundage;
$show->yd_poundage;
$show->dada_number;
$show->is_open_dada;
$show->loudspeaker_imei;
$show->dishes_menu_intro;
$show->create_time;
$show->created_at;
$show->updated_at;
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new ImsCjdcMarket(), function (Form $form) {
$form->display('id');
$form->text('name');
$form->text('logo');
$form->text('introduce');
$form->text('imgs');
$form->text('addtime');
$form->text('sort');
$form->text('status');
$form->text('coordinates');
$form->text('remark');
$form->text('address');
$form->text('poundage');
$form->text('dn_poundage');
$form->text('dm_poundage');
$form->text('yd_poundage');
$form->text('dada_number');
$form->text('is_open_dada');
$form->text('loudspeaker_imei');
$form->text('dishes_menu_intro');
$form->text('create_time');
$form->display('created_at');
$form->display('updated_at');
});
}
}