Skip to content

Commit

Permalink
chore: refactor for re-design
Browse files Browse the repository at this point in the history
  • Loading branch information
forcodedancing committed Jan 8, 2024
1 parent 702b18b commit f8c940d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dao/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -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+"%")
}

Expand Down
5 changes: 3 additions & 2 deletions monitor/bsc_block_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f8c940d

Please sign in to comment.