diff --git a/db/db_block_star_chain.go b/db/db_block_star_chain.go index a424a13..cdc5b0c 100644 --- a/db/db_block_star_chain.go +++ b/db/db_block_star_chain.go @@ -78,9 +78,13 @@ func BlockStarChainUpdate(session *xorm.Session, id interface{}, BlockStarChain func BlockStarChainGetOneByParams(session *xorm.Session, params map[string]interface{}) (*model.BlockStarChain, error) { var m model.BlockStarChain var query = fmt.Sprintf("%s =?", params["key"]) - if has, err := session.Where(query, params["value"]).Get(&m); err != nil || has == false { + has, err := session.Where(query, params["value"]).Get(&m) + if err != nil { return nil, zhios_order_relate_logx.Error(err) } + if has == false { + return nil, errors.New("未查询到相应的 block_star_chain 记录") + } return &m, nil }