优化视频补充信息查询条件

This commit is contained in:
徐俊杰 2023-03-28 13:51:44 +08:00
parent bc0f15f77e
commit 4dd5ff48da

View File

@ -8,6 +8,7 @@ package dao
import (
"errors"
"github.com/fonchain/fonchain-artistinfo/cmd/model"
"github.com/fonchain/fonchain-artistinfo/pb/artistinfoArtshow"
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
@ -75,10 +76,12 @@ func (a artistinfoArtshowVideo) GetDataList(req *artistinfoArtshow.GetArtshowVid
tx = tx.Where("lock_time = ?", req.LockTime)
}
if req.ArtistName != "" {
tx = tx.Clauses(clause.Like{
Column: "artist_name",
Value: "%" + req.ArtistName + "%",
})
// tx = tx.Clauses(clause.Like{
// Column: "artist_name",
// Value: "%" + req.ArtistName + "%",
// })
var searchName = "%" + req.ArtistName + "%"
tx = tx.Where("artist_name LIKE ? OR artist_uid LIKE ?", searchName, searchName)
}
if req.Status != 0 {
tx = tx.Where("status = ?", req.Status)