Commit 789e9b60 by lujunyi

营业时间

parent 5535da69
......@@ -38,7 +38,12 @@ protected function grid()
// $grid->column('pre_packaged_food')->image('', 50, 50);
$grid->column('area');
$grid->column('address');
$grid->column('business_hours');
$grid->column('营业时间')->display(function () {
$start = \Carbon\Carbon::parse($this->business_start)->format('H:i');
$end = \Carbon\Carbon::parse($this->business_end)->format('H:i');
return $start.'~'.$end;
});
$grid->column('mobile');
// $grid->column('lng');
// $grid->column('lat');
......@@ -85,7 +90,6 @@ protected function detail($id)
$show->field('area')->width(4);
$show->field('address')->width(4);
$show->field('mobile')->width(4);
$show->field('business_hours')->width(4);
$show->field('lng')->width(4);
$show->field('lat')->width(4);
$show->field('status')->width(4);
......@@ -117,8 +121,8 @@ protected function form()
$form->text('area')->width(4);
$form->text('address')->width(4);
$form->mobile('mobile')->width(4)->required()->help('药店登录账号');
$form->text('business_hours')->width(4);
$form->map('lat', 'lng', '经纬度坐标');
$form->timeRange('business_start', 'business_end', '营业时间')->required();
$form->map('lat', 'lng', '经纬度坐标')->width(4);
$form->select('user_id')->options(User::all()->pluck('openid', 'id'))->width(4)->help('实际后台操作可以不用关联');
$form->switch('status')->width(4);
$form->switch('is_open')->width(4);
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('pharmacy', function (Blueprint $table) {
$table->time('business_start')->comment('营业开始时间');
$table->time('business_end')->comment('营业结束时间');
$table->dropColumn('business_hours');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('pharmacy', function (Blueprint $table) {
//
});
}
};
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