Commit c588375e by 杨树贤

红包活动添加描述(description)字段

parent 3980aed2
...@@ -45,14 +45,28 @@ class IntegralsApiController extends Controller ...@@ -45,14 +45,28 @@ class IntegralsApiController extends Controller
public function storeIntegralApi(IntegralApiRequest $request, IntegralService $service) public function storeIntegralApi(IntegralApiRequest $request, IntegralService $service)
{ {
$result = $service->storeIntegral('/integrals/add', $request->all()); $data = [
'name' => $request->name,
'description' => $request->description,
'amount' => $request->amount,
'status' => $request->status,
'daily_limit' => $request->daily_limit,
];
$result = $service->storeIntegral('/integrals/add', $data);
return $result; return $result;
} }
public function updateIntegralApi(IntegralApiRequest $request, IntegralService $service) public function updateIntegralApi(IntegralApiRequest $request, IntegralService $service)
{ {
$result = $service->updateIntegral('/integrals/update?id=' . $request->id, $request->all()); $data = [
'name' => $request->name,
'description' => $request->description,
'amount' => $request->amount,
'status' => $request->status,
'daily_limit' => $request->daily_limit,
];
$result = $service->updateIntegral('/integrals/update?id=' . $request->id, $data);
return $result; return $result;
} }
......
...@@ -5,7 +5,6 @@ layui.use('form', function () { ...@@ -5,7 +5,6 @@ layui.use('form', function () {
}); });
form.on('submit(creat_integral)', function (data) { form.on('submit(creat_integral)', function (data) {
// console.log(data.field); //当前容器的全部表单字段,名值对形式:{name: value}
let url = '/integrals/api/storeIntegralApi'; let url = '/integrals/api/storeIntegralApi';
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
...@@ -16,6 +15,9 @@ layui.use('form', function () { ...@@ -16,6 +15,9 @@ layui.use('form', function () {
layer.msg('新增成功'); layer.msg('新增成功');
window.location = '/integrals/integralList'; window.location = '/integrals/integralList';
} }
},
error: function () {
} }
}); });
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
......
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
class="layui-input"> class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">红包描述</label>
<div class="layui-input-block">
<textarea name="description" placeholder="请输入描述" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">奖励金额</label> <label class="layui-form-label">奖励金额</label>
<div class="layui-input-block"> <div class="layui-input-block">
......
...@@ -10,6 +10,13 @@ ...@@ -10,6 +10,13 @@
class="layui-input"> class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">红包描述</label>
<div class="layui-input-block">
<textarea name="description" value="{{$integral['description']}}"
placeholder="请输入描述" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">奖励金额</label> <label class="layui-form-label">奖励金额</label>
<div class="layui-input-block"> <div class="layui-input-block">
......
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