|
|
@@ -44,3 +44,25 @@ func (a AdvertisingCallbackDb) FindAdvertisingCallbackAndTotal(page, limit, amou |
|
|
|
} |
|
|
|
return &m, count, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (a AdvertisingCallbackDb) AdvertisingCallbackExistBySession(session *xorm.Session, uid, startTime, endTime, types string) (bool, error) { |
|
|
|
var m []model.AdvertisingCallback |
|
|
|
sess := session.Where("1=1") |
|
|
|
if uid != "" { |
|
|
|
sess.And("uid=?", uid) |
|
|
|
} |
|
|
|
if types != "" { |
|
|
|
sess.And("type=?", types) |
|
|
|
} |
|
|
|
if startTime != "" { |
|
|
|
sess.And("create_at>=?", startTime) |
|
|
|
} |
|
|
|
if endTime != "" { |
|
|
|
sess.And("create_at<=?", endTime) |
|
|
|
} |
|
|
|
exist, err := sess.Exist(&m) |
|
|
|
if err != nil { |
|
|
|
return false, err |
|
|
|
} |
|
|
|
return exist, nil |
|
|
|
} |