ellisran преди 2 месеца
родител
ревизия
2ddf98be1c
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      app/service/message.js

+ 2 - 2
app/service/message.js

@@ -148,8 +148,8 @@ module.exports = app => {
          * @return {Boolean} - 返回修改结果
          */
         async getMsgList(projectId, spid = '', limit = 5, offset = 0, type = 1) {
-            const spids = spid ? (spid instanceof Array ? spid : [spid]) : '';
-            const sqSql = spids ? ' AND (`spid` in (' + this.ctx.helper.getInArrStrSqlFilter(spids) + ') OR `spid` = "")' : '';
+            const spids = spid && spid.length > 0 ? (spid instanceof Array ? spid : [spid]) : '';
+            const sqSql = spids ? ' AND (`spid` in (' + this.ctx.helper.getInArrStrSqlFilter(spids) + ') OR `spid` = "")' : ' AND `spid` = ""';
             if (type === 1) {
                 const sql = 'SELECT * FROM ?? WHERE `project_id` = ?' + sqSql + ' AND `type` = ? ORDER BY CONCAT(`istop`,`release_time`) DESC LIMIT ?,?';
                 const sqlParam = [this.tableName, projectId, type, offset, limit];