|
|
|
@ -58,8 +58,22 @@ func (s *Store) ScanTransGlobalStores(position *string, limit int64, condition s |
|
|
|
if *position != "" { |
|
|
|
lid = dtmimp.MustAtoi(*position) |
|
|
|
} |
|
|
|
// todo condition
|
|
|
|
dbr := dbGet().Must().Where("id < ?", lid).Order("id desc").Limit(int(limit)).Find(&globals) |
|
|
|
query := dbGet().Must().Where("id < ?", lid) |
|
|
|
if condition.Status != "" { |
|
|
|
query = query.Where("status = ?", condition.Status) |
|
|
|
} |
|
|
|
if condition.TransType != "" { |
|
|
|
query = query.Where("trans_type = ?", condition.TransType) |
|
|
|
} |
|
|
|
if !condition.CreateTimeStart.IsZero() { |
|
|
|
query = query.Where("create_time >= ?", condition.CreateTimeStart.Format("2006-01-02 15:04:05")) |
|
|
|
} |
|
|
|
if !condition.CreateTimeEnd.IsZero() { |
|
|
|
query = query.Where("create_time <= ?", condition.CreateTimeEnd.Format("2006-01-02 15:04:05")) |
|
|
|
} |
|
|
|
|
|
|
|
dbr := query.Order("id desc").Limit(int(limit)).Find(&globals) |
|
|
|
|
|
|
|
if dbr.RowsAffected < limit { |
|
|
|
*position = "" |
|
|
|
} else { |
|
|
|
|