diff --git a/dao/item.go b/dao/item.go index e6ae82b..51139be 100644 --- a/dao/item.go +++ b/dao/item.go @@ -192,7 +192,8 @@ func (dao *dbItemDao) Search(context context.Context, categoryId int64, address, } if len(keyword) > 0 { - rawSql = rawSql + ` and name like ?` + rawSql = rawSql + ` and (name like ? or description like ?) ` + parameters = append(parameters, "%"+keyword+"%") parameters = append(parameters, "%"+keyword+"%") } diff --git a/monitor/bsc_block_processor.go b/monitor/bsc_block_processor.go index 88d8bf5..c123b43 100644 --- a/monitor/bsc_block_processor.go +++ b/monitor/bsc_block_processor.go @@ -204,8 +204,9 @@ func (p *BscBlockProcessor) handleEventList(blockHeight uint64, l types.Log) (st return "", err } - rawSql := fmt.Sprintf("update items set status = %d, price = %s, updated_bsc_height = %d where group_id = %d ", - database.ItemListed, event.Price, blockHeight, event.GroupId) + // only list Objects, i.e., pictures + rawSql := fmt.Sprintf("update items set status = %d, price = %s, updated_bsc_height = %d where group_id = %d and `type` = %d", + database.ItemListed, event.Price, blockHeight, event.GroupId, database.OBJECT) return rawSql, nil }