aa
This commit is contained in:
@@ -78,7 +78,7 @@ func GetStoreMessages(ctx *jxcontext.Context, msgIDs, storeIDs, types []int, fro
|
||||
return pagedInfo, err
|
||||
}
|
||||
|
||||
func GetStoreMessageStatuses(ctx *jxcontext.Context, msgIDs, storeIDs []int, fromReadCount, toReadCount int, fromTime, toTime time.Time, keyword string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
||||
func GetStoreMessageStatuses(ctx *jxcontext.Context, msgIDs, storeIDs, confirmStatuss []int, fromReadCount, toReadCount int, fromTime, toTime time.Time, keyword string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS
|
||||
t1.*,
|
||||
@@ -92,6 +92,10 @@ func GetStoreMessageStatuses(ctx *jxcontext.Context, msgIDs, storeIDs []int, fro
|
||||
sql += " AND t1.store_id IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, storeIDs)
|
||||
}
|
||||
if len(confirmStatuss) > 0 {
|
||||
sql += " AND t1.confirm_status IN (" + dao.GenQuestionMarks(len(confirmStatuss)) + ")"
|
||||
sqlParams = append(sqlParams, confirmStatuss)
|
||||
}
|
||||
if len(msgIDs) > 0 {
|
||||
sql += " AND t1.message_id IN (" + dao.GenQuestionMarks(len(msgIDs)) + ")"
|
||||
sqlParams = append(sqlParams, msgIDs)
|
||||
|
||||
@@ -127,6 +127,7 @@ func (c *MsgController) GetStoreMessages() {
|
||||
// @Param storeIDs query string false "门店 ID列表"
|
||||
// @Param fromTime query string false "创建起始时间"
|
||||
// @Param toTime query string false "创建结束时间"
|
||||
// @Param confirmStatuss query int false "确认状态,0表示没点,1表示确认,-1表示拒绝"
|
||||
// @Param fromReadCount query int false "已读次数开始"
|
||||
// @Param toReadCount query int false "已读次数结束"
|
||||
// @Param offset query int false "消息状态列表起始序号(以0开始,缺省为0)"
|
||||
@@ -136,9 +137,9 @@ func (c *MsgController) GetStoreMessages() {
|
||||
// @router /GetStoreMessageStatuses [get]
|
||||
func (c *MsgController) GetStoreMessageStatuses() {
|
||||
c.callGetStoreMessageStatuses(func(params *tMsgGetStoreMessageStatusesParams) (retVal interface{}, errCode string, err error) {
|
||||
var msgIDs, storeIDs []int
|
||||
var msgIDs, storeIDs, confirmStatuss []int
|
||||
var timeList []time.Time
|
||||
if err = jxutils.Strings2Objs(params.MsgIDs, &msgIDs, params.StoreIDs, &storeIDs); err != nil {
|
||||
if err = jxutils.Strings2Objs(params.MsgIDs, &msgIDs, params.StoreIDs, &storeIDs, params.ConfirmStatuss, &confirmStatuss); err != nil {
|
||||
return retVal, "", err
|
||||
}
|
||||
if timeList, err = jxutils.BatchStr2Time(params.FromTime, params.ToTime); err != nil {
|
||||
@@ -150,7 +151,7 @@ func (c *MsgController) GetStoreMessageStatuses() {
|
||||
if _, ok := params.MapData["toReadCount"]; !ok {
|
||||
params.ToReadCount = -1
|
||||
}
|
||||
retVal, err = cms.GetStoreMessageStatuses(params.Ctx, msgIDs, storeIDs, params.FromReadCount, params.ToReadCount, timeList[0], timeList[1], params.Keyword, params.Offset, params.PageSize)
|
||||
retVal, err = cms.GetStoreMessageStatuses(params.Ctx, msgIDs, storeIDs, confirmStatuss, params.FromReadCount, params.ToReadCount, timeList[0], timeList[1], params.Keyword, params.Offset, params.PageSize)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user