소스 검색

新账号登录后bug

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];