guochao.js
525 Bytes
/* eslint-disable array-callback-return */
const { actGuochaoShop } = require('../../../db');
class GuochaoModel extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
list() {
return actGuochaoShop.findAll({order: [['sort', 'desc']]});
}
update(obj) {
return actGuochaoShop.update({ url: obj.url, sort: obj.sort, place: obj.place }, {where: {id: obj.id}});
}
findById(id) {
return actGuochaoShop.findById(id);
}
}
module.exports = GuochaoModel;