增加添加活到规则自动添加到身份权限里

This commit is contained in:
2020-08-19 13:46:28 +08:00
parent 488ab4f410
commit 156ad845f8
6 changed files with 84 additions and 9 deletions

View File

@@ -47,7 +47,7 @@ class IndexController extends AdminController
$grid->column('code', '活动编号');
$grid->column('rule.code', '卡券规则');
$grid->column('所属')->display(function () {
return $this->user_id ? $this->user->nickname : '系统';
return $this->user_id ? $this->user->nickname : '系统';
});
$grid->column('类型')->display(function () {
@@ -90,7 +90,8 @@ class IndexController extends AdminController
return User::with('info')->whereHas('identity', function ($q) {
$q->where('identity_id', 1);
})->orderBy('id', 'desc')->get()->pluck('nickname', 'id');
});
})
->help('活动是否专属,不选择为所有渠道都可使用。');
$form->select('activity_rule_id', '所属规则')
->options(function ($option, $info) {
@@ -109,7 +110,10 @@ class IndexController extends AdminController
->required();
$form->switch('status', '状态')->default(1);
$form->switch('need_check', '校验')->default(1);
$form->switch('need_check', '多次校验')
->default(1)
->help('同一订单多次核销时校验订单每满100元可核销一笔。');
$form->saving(function (Form $form) {
$request = request();
if ($request->type == Activity::TYPE_EXTEND && empty($request->days)) {