diff --git a/repository/client.go b/repository/client.go index 2df1d01..daf1215 100644 --- a/repository/client.go +++ b/repository/client.go @@ -194,7 +194,7 @@ func (r clientRepo) GetById(id string) (data entity.Client, err error) { // @return data // @return err func (r clientRepo) GetByPublicKey(publicKey string) (data entity.Client, err error) { - err = r.Model(&entity.Client{}).Where("keys->$.publicKey = ?", publicKey).Preload("Server").First(&data).Error + err = r.Model(&entity.Client{}).Where("json_extract(keys, '.publicKey') = ?", publicKey).Preload("Server").First(&data).Error return }