修复留言问题
This commit is contained in:
parent
f889ba70aa
commit
9121d5da62
|
|
@ -522,7 +522,7 @@ module.exports = class extends Base {
|
|||
// 获取所有留言
|
||||
async advicesAction() {
|
||||
try {
|
||||
let data = await this.model("advices").order("createdAt DESC").select();
|
||||
let data = await this.model("advices").join('users ON users.id = advices.userId').order("createdAt DESC").field('advices.*,users.username').select();
|
||||
this.json({ code: 0, data });
|
||||
} catch (error) {
|
||||
this.json({ code: 1, data: '', msg: error.toString() });
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ app.controller('adviceCtr', ['$scope', '$state', '$timeout', 'pubSubService', 'd
|
|||
async function getAdvices() {
|
||||
let data = await get("advices");
|
||||
data.forEach(element => {
|
||||
element.imgData = new Identicon(md5(element.username)).toString();
|
||||
element.imgData = new Identicon(md5(element.userId)).toString();
|
||||
});
|
||||
$scope.comment = "";
|
||||
$timeout(function () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue