Commit fb159970 by lujunyi

药店手机验证

parent b1a91d40
...@@ -114,29 +114,33 @@ protected function detail($id) ...@@ -114,29 +114,33 @@ protected function detail($id)
protected function form() protected function form()
{ {
return Form::make(new PharmacyRepository(), function (Form $form) { return Form::make(new PharmacyRepository(), function (Form $form) {
$form->display('id')->width(4); $form->column(6, function (Form $form) {
$form->text('name')->width(4)->required()->maxLength(64, '最多输入64个字符'); $form->display('id');
$form->image('business_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required(); $form->text('name')->required()->maxLength(64, '最多输入64个字符');
$form->image('drug_biz_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required(); $form->text('area')->required()->maxLength(64, '最多输入64个字符');
$form->image('food_biz_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required(); $form->text('address')->required()->maxLength(128, '最多输入128个字符');
$form->image('med_device_biz_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required(); $form->mobile('mobile')->required()->help('药店登录账号')->rules(function (Form $form) {
$form->image('drug_info_service_cert')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required(); // 如果不是编辑状态,则添加字段唯一验证
$form->image('pre_packaged_food')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->width(4)->required(); if (! $id = $form->model()->id) {
$form->text('area')->width(4)->required()->maxLength(64, '最多输入64个字符'); return 'unique:App\Models\PharmacyModel,mobile';
$form->text('address')->width(4)->required()->maxLength(128, '最多输入128个字符'); }
$form->mobile('mobile')->width(4)->required()->help('药店登录账号')->rules(function (Form $form) { });
// 如果不是编辑状态,则添加字段唯一验证 $form->timeRange('business_start', 'business_end', '营业时间')->required();
if (! $id = $form->model()->id) { $form->map('lat', 'lng', '经纬度坐标');
return 'unique:App\Models\PharmacyModel,mobile'; // $form->select('user_id')->options(User::all()->pluck('openid', 'id'))->width(6)->help('实际后台操作可以不用关联');
} $form->switch('status');
$form->display('created_at');
$form->display('updated_at');
});
$form->column(6, function (Form $form) {
$form->image('business_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->required();
$form->image('drug_biz_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->required();
$form->image('food_biz_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->required();
$form->image('med_device_biz_license')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->required();
$form->image('drug_info_service_cert')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->required();
$form->image('pre_packaged_food')->accept('jpg,png,jpeg')->uniqueName()->autoUpload()->retainable()->removable(false)->required();
}); });
$form->timeRange('business_start', 'business_end', '营业时间')->required();
$form->map('lat', 'lng', '经纬度坐标');
// $form->select('user_id')->options(User::all()->pluck('openid', 'id'))->width(4)->help('实际后台操作可以不用关联');
$form->switch('status')->width(4);
$form->display('created_at')->width(4);
$form->display('updated_at')->width(4);
$form->saving(function (Form $form) { $form->saving(function (Form $form) {
$status = $form->status; $status = $form->status;
$pharmacistNum = PharmacistModel::where('status', 1)->count(); $pharmacistNum = PharmacistModel::where('status', 1)->count();
......
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