From aed912cc911feabb8870c3201a105cdf4f3cd4c2 Mon Sep 17 00:00:00 2001 From: liapples Date: Sun, 5 Dec 2021 10:41:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E9=99=90?= =?UTF-8?q?=E5=88=B61~1440=E4=B9=8B=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminAgent/Forms/Setting.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/app/AdminAgent/Forms/Setting.php b/app/AdminAgent/Forms/Setting.php index 06ad22b..aeb39de 100644 --- a/app/AdminAgent/Forms/Setting.php +++ b/app/AdminAgent/Forms/Setting.php @@ -32,22 +32,19 @@ class Setting extends Form */ public function form() { - $this->text('order_timeout')->required()->default(60) + $this->text('order_timeout', '订单超时时间')->required()->default(60) + ->rules('integer|between:1,1440', ['integer' => ':attribute只能是整数', 'between' => ':attribute只能是:min~:max之间']) ->help('订单超时时间,单位:分钟。超过该时间未支付,订单将自动关闭'); - $this->radio('auto_shelves')->when([1], function (Form $form) { + $this->radio('auto_shelves') + ->options(['否', '是']) + ->when([1], function (Form $form) { // 值为1和4时显示文本框 //$form->number('profit','利润(%)')->min(0)->max(100)->help('请填写利润百分比 上架商品会自动根据供应商提供的价格 上调设置值的百分比'); - $form->radio('auto_category','自动添加分类')->options([ - '否', - '是', - ]) - ->default(0) - ->help('选择后 自动上架时会自动匹配分类 如无相同分类 则自动创建分类'); + $form->radio('auto_category','自动添加分类') + ->options(['否', '是']) + ->default(0) + ->help('选择后 自动上架时会自动匹配分类 如无相同分类 则自动创建分类'); }) - ->options([ - '否', - '是', - ]) ->required()->default(0) ->help('是否自动上架合作供应商的产品,如果选是,当合作供应商发布新产品之后,将自动上架供应商的产品'); }