|
@@ -42,6 +42,7 @@ class UserLevel extends AuthController
|
|
|
$field[] = Form::number('integral', '赠送积分', isset($vipinfo) ? $vipinfo->integral : 0)->min(0)->col(8);
|
|
$field[] = Form::number('integral', '赠送积分', isset($vipinfo) ? $vipinfo->integral : 0)->min(0)->col(8);
|
|
|
$field[] = Form::radio('is_spread', '是否限定邀请', isset($vipinfo) ? $vipinfo->is_spread : 0)->options([['label' => '限定邀请', 'value' => 1], ['label' => '非限定', 'value' => 0]])->col(24);
|
|
$field[] = Form::radio('is_spread', '是否限定邀请', isset($vipinfo) ? $vipinfo->is_spread : 0)->options([['label' => '限定邀请', 'value' => 1], ['label' => '非限定', 'value' => 0]])->col(24);
|
|
|
$field[] = Form::number('rebates', '邀请返利(%)', isset($vipinfo) ? $vipinfo->rebates : 0)->min(0)->col(8);
|
|
$field[] = Form::number('rebates', '邀请返利(%)', isset($vipinfo) ? $vipinfo->rebates : 0)->min(0)->col(8);
|
|
|
|
|
+ $field[] = Form::number('rebate_ratio', '返利点数(%)', isset($vipinfo) ? $vipinfo->rebate_ratio : 0)->min(0)->col(8);
|
|
|
$field[] = Form::frameImageOne('icon', '图标', Url::buildUrl('admin/widget.images/index', array('fodder' => 'icon')), isset($vipinfo) ? $vipinfo->icon : '')->icon('image')->width('100%')->height('500px');
|
|
$field[] = Form::frameImageOne('icon', '图标', Url::buildUrl('admin/widget.images/index', array('fodder' => 'icon')), isset($vipinfo) ? $vipinfo->icon : '')->icon('image')->width('100%')->height('500px');
|
|
|
$field[] = Form::frameImageOne('image', '会员背景', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), isset($vipinfo) ? $vipinfo->image : '')->icon('image')->width('100%')->height('500px');
|
|
$field[] = Form::frameImageOne('image', '会员背景', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), isset($vipinfo) ? $vipinfo->image : '')->icon('image')->width('100%')->height('500px');
|
|
|
$field[] = Form::radio('is_show', '是否显示', isset($vipinfo) ? $vipinfo->is_show : 0)->options([['label' => '显示', 'value' => 1], ['label' => '隐藏', 'value' => 0]])->col(8);
|
|
$field[] = Form::radio('is_show', '是否显示', isset($vipinfo) ? $vipinfo->is_show : 0)->options([['label' => '显示', 'value' => 1], ['label' => '隐藏', 'value' => 0]])->col(8);
|
|
@@ -67,6 +68,7 @@ class UserLevel extends AuthController
|
|
|
['grade', 0],
|
|
['grade', 0],
|
|
|
['discount', 0],
|
|
['discount', 0],
|
|
|
['rebates', 0],
|
|
['rebates', 0],
|
|
|
|
|
+ ['rebate_ratio', 0],
|
|
|
['integral', 0],
|
|
['integral', 0],
|
|
|
['is_spread', 0],
|
|
['is_spread', 0],
|
|
|
['icon', ''],
|
|
['icon', ''],
|
|
@@ -85,6 +87,7 @@ class UserLevel extends AuthController
|
|
|
if (!$data['money']) return JsonService::fail('请输入购买金额');
|
|
if (!$data['money']) return JsonService::fail('请输入购买金额');
|
|
|
if (!$data['icon']) return JsonService::fail('请上传等级图标');
|
|
if (!$data['icon']) return JsonService::fail('请上传等级图标');
|
|
|
if (!$data['image']) return JsonService::fail('请上传等级背景图标');
|
|
if (!$data['image']) return JsonService::fail('请上传等级背景图标');
|
|
|
|
|
+ if ($data['rebate_ratio']>20) return JsonService::fail('返利点数不能大于20%');
|
|
|
if (!$id && SystemUserLevel::be(['is_del' => 0, 'grade' => $data['grade']])) return JsonService::fail('已检测到您设置过的会员等级,此等级不可重复');
|
|
if (!$id && SystemUserLevel::be(['is_del' => 0, 'grade' => $data['grade']])) return JsonService::fail('已检测到您设置过的会员等级,此等级不可重复');
|
|
|
SystemUserLevel::beginTrans();
|
|
SystemUserLevel::beginTrans();
|
|
|
try {
|
|
try {
|