From d9e77e162cf41fd76f01e711006d273900665510 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Mon, 14 Sep 2020 14:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=AB=99=E4=B8=93=E5=91=98-?= =?UTF-8?q?=E5=88=9D=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ServicePersonnelController.php | 86 +++++++++++++++++++ app/Admin/Repositories/ServicePersonnel.php | 16 ++++ app/Models/ServicePersonnel.php | 16 ++++ ...3_create_lanzu_service_personnel_table.php | 40 +++++++++ dcat_admin_ide_helper.php | 4 + resources/lang/zh-CN/service-personnel.php | 18 ++++ 6 files changed, 180 insertions(+) create mode 100644 app/Admin/Controllers/ServicePersonnelController.php create mode 100644 app/Admin/Repositories/ServicePersonnel.php create mode 100644 app/Models/ServicePersonnel.php create mode 100644 database/migrations/2020_09_14_120733_create_lanzu_service_personnel_table.php create mode 100644 resources/lang/zh-CN/service-personnel.php diff --git a/app/Admin/Controllers/ServicePersonnelController.php b/app/Admin/Controllers/ServicePersonnelController.php new file mode 100644 index 0000000..2476b7a --- /dev/null +++ b/app/Admin/Controllers/ServicePersonnelController.php @@ -0,0 +1,86 @@ +column('id')->sortable(); + $grid->column('user_id'); + $grid->column('name'); + $grid->column('tel'); + $grid->column('market_id'); + $grid->column('type'); + $grid->column('status'); + $grid->column('qr_url'); + $grid->column('head_url'); + $grid->column('created_at'); + $grid->column('updated_at')->sortable(); + + $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 ServicePersonnel(), function (Show $show) { + $show->field('id'); + $show->field('user_id'); + $show->field('name'); + $show->field('tel'); + $show->field('market_id'); + $show->field('type'); + $show->field('status'); + $show->field('qr_url'); + $show->field('head_url'); + $show->field('created_at'); + $show->field('updated_at'); + }); + } + + /** + * Make a form builder. + * + * @return Form + */ + protected function form() + { + return Form::make(new ServicePersonnel(), function (Form $form) { + $form->display('id'); + $form->text('user_id'); + $form->text('name'); + $form->text('tel'); + $form->text('market_id'); + $form->text('type'); + $form->text('status'); + $form->text('qr_url'); + $form->text('head_url'); + + $form->display('created_at'); + $form->display('updated_at'); + }); + } +} diff --git a/app/Admin/Repositories/ServicePersonnel.php b/app/Admin/Repositories/ServicePersonnel.php new file mode 100644 index 0000000..a1bee24 --- /dev/null +++ b/app/Admin/Repositories/ServicePersonnel.php @@ -0,0 +1,16 @@ +increments('id'); + $table->unsignedInteger('user_id')->default('0')->comment('服务员懒ID'); + $table->string('name')->default('')->comment('姓名'); + $table->char('tel')->comment('电话'); + $table->tinyInteger('market_id')->default('0')->comment('所属市场'); + $table->tinyInteger('type')->default('0')->comment('类型'); + $table->tinyInteger('status')->default('0')->comment('状态'); + $table->string('qr_url')->default('0')->comment('专员二维码'); + $table->string('head_url')->default('0')->comment('头像'); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('lanzu_service_personnel'); + } +} diff --git a/dcat_admin_ide_helper.php b/dcat_admin_ide_helper.php index 775fa42..090bc50 100644 --- a/dcat_admin_ide_helper.php +++ b/dcat_admin_ide_helper.php @@ -1205,6 +1205,7 @@ namespace Dcat\Admin { * @property Grid\Column|Collection services_money * @property Grid\Column|Collection coupon_money * @property Grid\Column|Collection delivery_money + * @property Grid\Column|Collection delivery_distance * @property Grid\Column|Collection horseman_id * @property Grid\Column|Collection delivery_time_note * @property Grid\Column|Collection total_refund_note @@ -2432,6 +2433,7 @@ namespace Dcat\Admin { * @method Grid\Column|Collection services_money(string $label = null) * @method Grid\Column|Collection coupon_money(string $label = null) * @method Grid\Column|Collection delivery_money(string $label = null) + * @method Grid\Column|Collection delivery_distance(string $label = null) * @method Grid\Column|Collection horseman_id(string $label = null) * @method Grid\Column|Collection delivery_time_note(string $label = null) * @method Grid\Column|Collection total_refund_note(string $label = null) @@ -3664,6 +3666,7 @@ namespace Dcat\Admin { * @property Show\Field|Collection services_money * @property Show\Field|Collection coupon_money * @property Show\Field|Collection delivery_money + * @property Show\Field|Collection delivery_distance * @property Show\Field|Collection horseman_id * @property Show\Field|Collection delivery_time_note * @property Show\Field|Collection total_refund_note @@ -4891,6 +4894,7 @@ namespace Dcat\Admin { * @method Show\Field|Collection services_money(string $label = null) * @method Show\Field|Collection coupon_money(string $label = null) * @method Show\Field|Collection delivery_money(string $label = null) + * @method Show\Field|Collection delivery_distance(string $label = null) * @method Show\Field|Collection horseman_id(string $label = null) * @method Show\Field|Collection delivery_time_note(string $label = null) * @method Show\Field|Collection total_refund_note(string $label = null) diff --git a/resources/lang/zh-CN/service-personnel.php b/resources/lang/zh-CN/service-personnel.php new file mode 100644 index 0000000..a17a0fa --- /dev/null +++ b/resources/lang/zh-CN/service-personnel.php @@ -0,0 +1,18 @@ + [ + 'ServicePersonnel' => 'ServicePersonnel', + ], + 'fields' => [ + 'user_id' => '服务员懒ID', + 'name' => '姓名', + 'tel' => '电话', + 'market_id' => '所属市场', + 'type' => '类型', + 'status' => '状态', + 'qr_url' => '专员二维码', + 'head_url' => '头像', + ], + 'options' => [ + ], +];