Skip to content

Commit

Permalink
fix 修复评论日期不能正确显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tumobi committed Jul 30, 2017
1 parent 782fc7f commit 0597c41
Show file tree
Hide file tree
Showing 3 changed files with 294 additions and 298 deletions.
8 changes: 4 additions & 4 deletions nideshop.sql → database/nideshop.sql

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/api/controller/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ export default class extends Base {
let commentList = [];
for (let commentItem of comments.data) {
let comment = {};
let addTime = new Date(commentItem.add_time);
comment.content = new Buffer(commentItem.content, 'base64').toString();
comment.type_id = commentItem.type_id;
comment.value_id = commentItem.value_id;
comment.id = commentItem.id;
comment.add_time = addTime.getFullYear() + '-' + addTime.getMonth() + '-' + addTime.getDay() + ' ' + addTime.getHours() + ':' + addTime.getMinutes() + ':' + addTime.getSeconds();
comment.add_time = think.datetime(new Date(commentItem.add_time * 1000));
comment.user_info = await this.model('user').field(['username', 'avatar', 'nickname']).where({id: commentItem.user_id}).find();
comment.pic_list = await this.model('comment_picture').where({comment_id: commentItem.id}).select();
commentList.push(comment);
Expand Down
Loading

0 comments on commit 0597c41

Please sign in to comment.