Roc 1 年之前
父节点
当前提交
a5a57d0dbe
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      models/data_manage/excel/excel_info.go

+ 4 - 1
models/data_manage/excel/excel_info.go

@@ -135,11 +135,14 @@ func GetNoContentExcelInfoAll(source, userId int) (items []*ExcelClassifyItems,
              unique_code,sys_user_id,sys_user_real_name
             FROM excel_info where is_delete=0 AND source = ?  `
 
+	pars := []interface{}{source}
+
 	if userId > 0 {
 		sql += ` AND sys_user_id = ? `
+		pars = append(pars, userId)
 	}
 	sql += `  ORDER BY sort asc,create_time desc `
-	_, err = o.Raw(sql, source, userId).QueryRows(&items)
+	_, err = o.Raw(sql, pars...).QueryRows(&items)
 	return
 }