Commit 11c26861 by lujunyi

本位码唯一

parent 62633ca7
...@@ -132,7 +132,12 @@ protected function form() ...@@ -132,7 +132,12 @@ protected function form()
$limitOption = array_combine($array, $array); $limitOption = array_combine($array, $array);
$form->select('limit_buy_7')->placeholder('请选择限购数量')->width(4)->options($limitOption)->help('限购数量'); $form->select('limit_buy_7')->placeholder('请选择限购数量')->width(4)->options($limitOption)->help('限购数量');
$form->switch('is_rx')->width(4); $form->switch('is_rx')->width(4);
$form->text('standard_code')->width(4)->required(); $form->text('standard_code')->width(4)->required()->rules(function (Form $form) {
// 如果不是编辑状态,则添加字段唯一验证
if (! $id = $form->model()->id) {
return 'unique:App\Models\DrugModel,standard_code';
}
});
$form->multipleSelect('tag', '标签') $form->multipleSelect('tag', '标签')
->options(function () { ->options(function () {
return DrugTagModel::all()->pluck('tag_name', 'id'); return DrugTagModel::all()->pluck('tag_name', 'id');
......
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