Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-activity-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
李奇
7 years ago
Commit
8b1dbc9b6f8e578b12e449004e81b1abc273dbef
1 parent
2a2e2808
master
...
feature/add-verify
feature/change-admin-static-url
feature/coupons-expansion
feature/del-privateIps
feature/new-pro-fes
feature/only-for-test
feature/pressure-test
feature/share-link
feature/timezone
feature/yoluck
hotfix/export
hotfix/fix-appSecret
hotfix/republish
release/0823
release/6.7.9
release/6.8.3
release/6.9.5
release/9.14
release/yohood-lottrey
release0906
zero-buy-two
tag1.0
管理后台上传图片创建时间添加
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
apps/admin/controllers/activity.js
apps/admin/models/activity.js
apps/admin/views/action/activity/create-article.hbs
apps/admin/controllers/activity.js
View file @
8b1dbc9
...
...
@@ -198,14 +198,16 @@ const activity = {
const
userName
=
req
.
body
.
name
;
const
content
=
req
.
body
.
content
;
const
imgUrl
=
req
.
body
.
imgUrl
;
const
createTime
=
req
.
body
.
createTime
||
(
new
Date
());
req
.
ctx
(
ActivityModel
).
createArticle
({
actId
,
userName
,
content
content
,
createTime
})
.
then
(
artId
=>
{
req
.
ctx
(
ActivityModel
).
createArticleImg
(
artId
,
imgUrl
)
req
.
ctx
(
ActivityModel
).
createArticleImg
(
artId
,
imgUrl
,
createTime
)
.
then
(()
=>
{
res
.
json
({
code
:
200
,
...
...
apps/admin/models/activity.js
View file @
8b1dbc9
...
...
@@ -123,13 +123,15 @@ class AdminModel extends global.yoho.BaseModel {
* @param id 文章ID
* @returns {*}
*/
createArticle
({
actId
,
userName
,
content
})
{
createArticle
({
actId
,
userName
,
content
,
createTime
})
{
return
mysqlCli
.
insert
(
`
insert
into
$
{
TB_ACT_ARTICLE
}
(
act_id
,
user_name
,
content
)
values
(
:
actId
,
:
userName
,
:
content
);
`
,
`
insert
into
$
{
TB_ACT_ARTICLE
}
(
act_id
,
user_name
,
content
,
create_time
)
values
(
:
actId
,
:
userName
,
:
content
,
:
createTime
);
`
,
{
actId
,
userName
,
content
content
,
createTime
}
);
}
...
...
@@ -139,12 +141,14 @@ class AdminModel extends global.yoho.BaseModel {
* @param id 文章ID
* @returns {*}
*/
createArticleImg
(
artId
,
imgUrl
)
{
createArticleImg
(
artId
,
imgUrl
,
createTime
)
{
return
mysqlCli
.
insert
(
`
insert
into
$
{
TB_ACT_ARTICLE_IMG
}
(
article_id
,
img_url
)
values
(
:
artId
,
:
imgUrl
);
`
,
`
insert
into
$
{
TB_ACT_ARTICLE_IMG
}
(
article_id
,
img_url
,
create_time
)
values
(
:
artId
,
:
imgUrl
,
:
createTime
);
`
,
{
artId
,
imgUrl
imgUrl
,
createTime
}
);
}
...
...
apps/admin/views/action/activity/create-article.hbs
View file @
8b1dbc9
...
...
@@ -11,7 +11,7 @@
<div
class=
"x_content"
>
<form
id=
"createArticleForm"
class=
"form-horizontal form-label-left"
>
<div
class=
"form-group"
>
<label
class=
"control-label col-md-3 col-sm-3 col-xs-12"
for=
"first-name"
>
姓名
<span
<label
class=
"control-label col-md-3 col-sm-3 col-xs-12"
>
姓名
<span
class=
"required"
>
*
</span>
</label>
<div
class=
"col-md-6 col-sm-6 col-xs-12"
>
...
...
@@ -20,7 +20,7 @@
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-md-3 col-sm-3 col-xs-12"
for=
"last-name"
>
内容
<span
<label
class=
"control-label col-md-3 col-sm-3 col-xs-12"
>
内容
<span
class=
"required"
>
*
</span>
</label>
<div
class=
"col-md-6 col-sm-6 col-xs-12"
>
...
...
@@ -29,7 +29,7 @@
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-md-3 col-sm-3 col-xs-12"
for=
"last-name"
>
图片
<span
<label
class=
"control-label col-md-3 col-sm-3 col-xs-12"
>
图片
<span
class=
"required"
>
*
</span>
</label>
<div
class=
"col-md-6 col-sm-6 col-xs-12"
>
...
...
@@ -45,6 +45,14 @@
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-md-3 col-sm-3 col-xs-12"
>
创建时间
</label>
<div
class=
"col-md-6 col-sm-6 col-xs-12"
>
<input
type=
"text"
name=
"createTime"
required=
"required"
class=
"form-control col-md-7 col-xs-12"
>
</div>
</div>
<div
class=
"ln_solid"
></div>
<div
class=
"form-group"
>
<div
class=
"col-md-6 col-sm-6 col-xs-12 col-md-offset-3"
>
...
...
Please
register
or
login
to post a comment