Commit fb159970 by lujunyi

药店手机验证

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