|
|
@@ -63,9 +63,12 @@ class Many extends AuthController
|
|
|
{
|
|
|
$f = [];
|
|
|
$f[] = Form::input('name', '名称')->col(12);
|
|
|
- $f[] = Form::frameImageOne('image', '封面图(305*305px)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')))->icon('image')->width('100%')->height('500px');
|
|
|
+// $f[] = Form::frameImageOne('image', '封面图(305*305px)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')))->icon('image')->width('100%')->height('500px');
|
|
|
$f[] = Form::input('money', '额度');
|
|
|
+ $f[] = Form::input('increase', '自动增长额度', 0);
|
|
|
+ $f[] = Form::input('second', '自动增长时间(秒)', 0);
|
|
|
$f[] = Form::input('upper_limit', '参与上限');
|
|
|
+ $f[] = Form::input('single', '单次上限');
|
|
|
$f[] = Form::dateTime('add_time', '开启时间');
|
|
|
$f[] = Form::dateTime('end_time', '结束时间');
|
|
|
$f[] = Form::input('sort', '排序',0);
|
|
|
@@ -82,28 +85,33 @@ class Many extends AuthController
|
|
|
$model = new \app\admin\model\many\Many();
|
|
|
$data = Util::postMore([
|
|
|
'name',
|
|
|
- 'image',
|
|
|
+// 'image',
|
|
|
'money',
|
|
|
'upper_limit',
|
|
|
'add_time',
|
|
|
'end_time',
|
|
|
'sort',
|
|
|
+ 'increase',
|
|
|
+ 'second',
|
|
|
+ 'single',
|
|
|
]);
|
|
|
$validate = Validate::rule('name', 'require')->rule([
|
|
|
'name' => 'require',
|
|
|
- 'image' => 'require',
|
|
|
+// 'image' => 'require',
|
|
|
'money' => 'require',
|
|
|
'upper_limit' => 'require',
|
|
|
'add_time' => 'require',
|
|
|
'end_time' => 'require',
|
|
|
+ 'single' => 'require',
|
|
|
]);
|
|
|
$validate->message([
|
|
|
'name.require' => '名称不能为空',
|
|
|
- 'image.require' => '图片不能为空',
|
|
|
+// 'image.require' => '图片不能为空',
|
|
|
'money.require' => '额度不能为空',
|
|
|
'upper_limit.require' => '上限不能为空',
|
|
|
'add_time.require' => '请选择进场时间',
|
|
|
'end_time.require' => '请选择结束时间',
|
|
|
+ 'single.require' => '请填写单次上限',
|
|
|
]);
|
|
|
if (!$validate->check($data)) {
|
|
|
return Json::fail($validate->getError());
|
|
|
@@ -126,9 +134,12 @@ class Many extends AuthController
|
|
|
$data = \app\admin\model\many\Many::find($id);
|
|
|
$f = [];
|
|
|
$f[] = Form::input('name', '名称',$data->getData('name'))->col(12);
|
|
|
- $f[] = Form::frameImageOne('image', '封面图(305*305px)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), $data->getData('image'))->icon('image')->width('100%')->height('500px');
|
|
|
+// $f[] = Form::frameImageOne('image', '封面图(305*305px)', Url::buildUrl('admin/widget.images/index', array('fodder' => 'image')), $data->getData('image'))->icon('image')->width('100%')->height('500px');
|
|
|
$f[] = Form::input('money', '额度', $data->getData('money'));
|
|
|
+ $f[] = Form::input('increase', '自动增长额度', $data->getData('increase'));
|
|
|
+ $f[] = Form::input('second', '自动增长时间(秒)', $data->getData('second'));
|
|
|
$f[] = Form::input('upper_limit', '参与上限', $data->getData('upper_limit'));
|
|
|
+ $f[] = Form::input('single', '单次上限', $data->getData('single'));
|
|
|
$f[] = Form::dateTime('add_time', '开启时间', date('Y-m-d H:i:s', $data->getData('add_time')));
|
|
|
$f[] = Form::dateTime('end_time', '结束时间', date('Y-m-d H:i:s', $data->getData('end_time')));
|
|
|
$f[] = Form::input('sort', '排序',$data->getData('sort'));
|
|
|
@@ -152,36 +163,44 @@ class Many extends AuthController
|
|
|
$data = Util::postMore([
|
|
|
'id',
|
|
|
'name',
|
|
|
- 'image',
|
|
|
+// 'image',
|
|
|
'money',
|
|
|
'upper_limit',
|
|
|
'add_time',
|
|
|
'end_time',
|
|
|
'sort',
|
|
|
+ 'increase',
|
|
|
+ 'second',
|
|
|
+ 'single'
|
|
|
]);
|
|
|
$validate = Validate::rule('name', 'require')->rule([
|
|
|
'name' => 'require',
|
|
|
- 'image' => 'require',
|
|
|
+// 'image' => 'require',
|
|
|
'money' => 'require',
|
|
|
'upper_limit' => 'require',
|
|
|
'add_time' => 'require',
|
|
|
'end_time' => 'require',
|
|
|
+ 'single' => 'require',
|
|
|
]);
|
|
|
$validate->message([
|
|
|
'name.require' => '名称不能为空',
|
|
|
- 'image.require' => '图片不能为空',
|
|
|
+// 'image.require' => '图片不能为空',
|
|
|
'money.require' => '额度不能为空',
|
|
|
'upper_limit.require' => '上限不能为空',
|
|
|
'add_time.require' => '请选择进场时间',
|
|
|
'end_time.require' => '请选择结束时间',
|
|
|
+ 'single.require' => '请填写单次上限',
|
|
|
]);
|
|
|
if (!$validate->check($data)) {
|
|
|
return Json::fail($validate->getError());
|
|
|
}
|
|
|
$details = $model->find($data['id']);
|
|
|
$details['name'] = $data['name'];
|
|
|
- $details['image'] = $data['image'];
|
|
|
+ $details['single'] = $data['single'];
|
|
|
+// $details['image'] = $data['image'];
|
|
|
$details['money'] = $data['money'];
|
|
|
+ $details['increase'] = $data['increase'];
|
|
|
+ $details['second'] = $data['second'];
|
|
|
$details['upper_limit'] = $data['upper_limit'];
|
|
|
$details['add_time'] = strtotime($data['add_time']);
|
|
|
$details['end_time'] = strtotime($data['end_time']);
|