Commit 52ab01b8 by 赵增煜

新增药师药店纠错

parent 2481a2f6
<?php
namespace App\Admin\Controllers;
use App\Admin\Repositories\DoctorCorrection;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Show;
class DoctorCorrectionController extends AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
return Grid::make(new DoctorCorrection(), function (Grid $grid) {
$grid->column('id')->sortable();
$grid->column('doctor_id');
$grid->column('doctor_name');
$grid->column('is_handle');
$grid->column('content');
$grid->column('created_at');
$grid->column('updated_at')->sortable();
$grid->filter(function (Grid\Filter $filter) {
$filter->panel(); // 更改为 panel 布局
$filter->expand(); // 默认展开搜索框
$filter->like('doctor_name')->width(3);
});
// 行按钮控制
$grid->disableDeleteButton(); // 禁用删除按钮
// 工具栏按钮控制
$grid->disableBatchDelete(); // 禁用批量删除
});
}
/**
* Make a show builder.
*
* @param mixed $id
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new DoctorCorrection(), function (Show $show) {
$show->field('id');
$show->field('doctor_id');
$show->field('doctor_name');
$show->field('is_handle');
$show->field('content');
$show->field('created_at');
$show->field('updated_at');
$show->panel()->tools(function ($tools) {
$tools->disableDelete(); // 禁止删除按钮
});
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new DoctorCorrection(), function (Form $form) {
$form->display('id');
$form->text('doctor_id');
$form->text('doctor_name');
$form->text('is_handle');
$form->text('content');
$form->display('created_at');
$form->display('updated_at');
// 右上角按钮控制
$form->disableDeleteButton(); // 去掉删除按钮
});
}
}
<?php
namespace App\Admin\Controllers;
use App\Admin\Repositories\PharmacyCorrection;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Show;
class PharmacyCorrectionController extends AdminController
{
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
return Grid::make(new PharmacyCorrection(), function (Grid $grid) {
$grid->column('id')->sortable();
$grid->column('pharmacy_id');
$grid->column('pharmacy_name');
$grid->column('is_handle');
$grid->column('content');
$grid->column('created_at');
$grid->column('updated_at')->sortable();
$grid->filter(function (Grid\Filter $filter) {
$filter->panel(); // 更改为 panel 布局
$filter->expand(); // 默认展开搜索框
$filter->like('pharmacy_name')->width(3);
});
// 行按钮控制
$grid->disableDeleteButton(); // 禁用删除按钮
// 工具栏按钮控制
$grid->disableBatchDelete(); // 禁用批量删除
});
}
/**
* Make a show builder.
*
* @param mixed $id
* @return Show
*/
protected function detail($id)
{
return Show::make($id, new PharmacyCorrection(), function (Show $show) {
$show->field('id');
$show->field('pharmacy_id');
$show->field('pharmacy_name');
$show->field('is_handle');
$show->field('content');
$show->field('created_at');
$show->field('updated_at');
$show->panel()->tools(function ($tools) {
$tools->disableDelete(); // 禁止删除按钮
});
});
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
return Form::make(new PharmacyCorrection(), function (Form $form) {
$form->display('id');
$form->text('pharmacy_id');
$form->text('pharmacy_name');
$form->text('is_handle');
$form->text('content');
$form->display('created_at');
$form->display('updated_at');
// 右上角按钮控制
$form->disableDeleteButton(); // 去掉删除按钮
});
}
}
<?php
namespace App\Admin\Repositories;
use App\Models\DoctorCorrection as Model;
use Dcat\Admin\Repositories\EloquentRepository;
class DoctorCorrection extends EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected $eloquentClass = Model::class;
}
<?php
namespace App\Admin\Repositories;
use App\Models\PharmacyCorrection as Model;
use Dcat\Admin\Repositories\EloquentRepository;
class PharmacyCorrection extends EloquentRepository
{
/**
* Model.
*
* @var string
*/
protected $eloquentClass = Model::class;
}
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class DoctorCorrection extends Model
{
use HasDateTimeFormatter;
protected $table = 'doctor_correction';
}
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class PharmacyCorrection extends Model
{
use HasDateTimeFormatter;
protected $table = 'pharmacy_correction';
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDoctorCorrectionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('doctor_correction', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('doctor_id')->comment('医师编号');
$table->string('doctor_name')->default('')->comment('医师姓名');
$table->tinyInteger('is_handle')->comment('是否处理 0 待处理 1 已处理');
$table->longText('content')->comment('纠错内容');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('doctor_correction');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePharmacyCorrectionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('pharmacy_correction', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('pharmacy_id')->comment('药店编号');
$table->string('pharmacy_name')->default('')->comment('药店名称');
$table->tinyInteger('is_handle')->comment('是否处理');
$table->string('content')->default('')->comment('纠错内容');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('pharmacy_correction');
}
}
<?php
return [
'labels' => [
'DoctorCorrection' => '医师纠错',
'doctor-correction' => '医师纠错',
],
'fields' => [
'doctor_id' => '医师编号',
'doctor_name' => '医师姓名',
'is_handle' => '是否处理',
'content' => '纠错内容',
],
'options' => [
],
];
<?php
return [
'labels' => [
'PharmacyCorrection' => '药店纠错',
'pharmacy-correction' => '药店纠错',
],
'fields' => [
'pharmacy_id' => '药店编号',
'pharmacy_name' => '药店名称',
'is_handle' => '是否处理',
'content' => '纠错内容',
],
'options' => [
],
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment