|
@@ -148,16 +148,23 @@ func GetEdbInspectionMessageByAdminId(adminId int) (items []*EdbInspectionMessag
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetEdbInspectionMessageCountByAdminId(adminId int) (count int, err error) {
|
|
|
+func GetEdbInspectionMessageUnreadCountByAdminId(adminId int) (count int, err error) {
|
|
|
o := global.DbMap[utils.DbNameIndex]
|
|
|
sql := "SELECT COUNT(*) FROM edb_inspection_message WHERE admin_id =? AND is_read = 0 ORDER BY is_read ASC, create_time DESC"
|
|
|
err = o.Raw(sql, adminId).Scan(&count).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func GetEdbInspectionMessageCountByAdminId(adminId int) (count int, err error) {
|
|
|
+ o := global.DbMap[utils.DbNameIndex]
|
|
|
+ sql := "SELECT COUNT(*) FROM edb_inspection_message WHERE admin_id =? ORDER BY is_read ASC, create_time DESC"
|
|
|
+ err = o.Raw(sql, adminId).Scan(&count).Error
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func GetEdbInspectionMessagePageByAdminId(adminId, startSize, pageSize int) (items []*EdbInspectionMessage, err error) {
|
|
|
o := global.DbMap[utils.DbNameIndex]
|
|
|
- sql := "SELECT * FROM edb_inspection_message WHERE admin_id =? AND is_read = 0 ORDER BY is_read ASC, create_time DESC LIMIT ?,?"
|
|
|
+ sql := "SELECT * FROM edb_inspection_message WHERE admin_id =? ORDER BY is_read ASC, create_time DESC LIMIT ?,?"
|
|
|
err = o.Raw(sql, adminId, startSize, pageSize).Find(&items).Error
|
|
|
return
|
|
|
}
|