Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ic_welfare
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c588375e
authored
Aug 22, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
红包活动添加描述(description)字段
parent
3980aed2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
3 deletions
app/Http/Controllers/Api/IntegralsApiController.php
public/js/web/createIntegral.js
resources/views/web/createIntegral.blade.php
resources/views/web/updateIntegral.blade.php
app/Http/Controllers/Api/IntegralsApiController.php
View file @
c588375e
...
...
@@ -45,14 +45,28 @@ class IntegralsApiController extends Controller
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
;
}
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
;
}
...
...
public/js/web/createIntegral.js
View file @
c588375e
...
...
@@ -5,7 +5,6 @@ layui.use('form', function () {
});
form
.
on
(
'submit(creat_integral)'
,
function
(
data
)
{
// console.log(data.field); //当前容器的全部表单字段,名值对形式:{name: value}
let
url
=
'/integrals/api/storeIntegralApi'
;
$
.
ajax
({
type
:
'POST'
,
...
...
@@ -16,6 +15,9 @@ layui.use('form', function () {
layer
.
msg
(
'新增成功'
);
window
.
location
=
'/integrals/integralList'
;
}
},
error
:
function
()
{
}
});
return
false
;
//阻止表单跳转。如果需要表单跳转,去掉这段即可。
...
...
resources/views/web/createIntegral.blade.php
View file @
c588375e
...
...
@@ -8,6 +8,12 @@
class=
"layui-input"
>
</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"
>
<label
class=
"layui-form-label"
>
奖励金额
</label>
<div
class=
"layui-input-block"
>
...
...
resources/views/web/updateIntegral.blade.php
View file @
c588375e
...
...
@@ -10,6 +10,13 @@
class=
"layui-input"
>
</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"
>
<label
class=
"layui-form-label"
>
奖励金额
</label>
<div
class=
"layui-input-block"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment