Authored by 邱骏

listNoUser 增加limitDate参数

... ... @@ -178,6 +178,7 @@ const article = {
const order = ((query.order || 'desc') + '').toLowerCase();
const orderByFields = ['createTime', 'goodCount'];
const dateTime = query.dateTime || '';
const limitDate = query.limitDate || '';
if (!actId) {
return res.json({
... ... @@ -206,7 +207,8 @@ const article = {
orderBy,
pageNo,
pageSize,
dateTime
dateTime,
limitDate
})
.then(result => {
let list = [];
... ...
... ... @@ -59,13 +59,14 @@ class ArticleModel extends global.yoho.BaseModel {
* 获取文章无用户
* @returns {*}
*/
articleListWithoutUser({actId, pageNo, pageSize, orderBy, order, dateTime}) {
articleListWithoutUser({actId, pageNo, pageSize, orderBy, order, dateTime, limitDate}) {
const orderMapping = {
goodCount: 'good_count',
createTime: 'create_time'
};
const date = dateTime || '';
const limit_date = limitDate || '';
let limitSql;
let orderSql;
... ... @@ -75,6 +76,9 @@ class ArticleModel extends global.yoho.BaseModel {
if (date !== '') {
whereSql += ' AND to_days(AA.create_time) = to_days(\'' + date + '\')';
}
if (limit_date !== '') {
whereSql += ' AND to_days(AA.create_time) <= to_days(\'' + limit_date + '\')';
}
orderSql = `ORDER BY AA.${orderMapping[orderBy]} ${order}`;
limitSql = 'LIMIT :start, :page';
... ...