feat:完善项目
This commit is contained in:
@ -1,11 +1,24 @@
|
||||
package model
|
||||
|
||||
import "SciencesServer/app/common/model"
|
||||
import (
|
||||
"SciencesServer/app/common/model"
|
||||
"SciencesServer/serve/orm"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type SysBanner struct {
|
||||
*model.SysBanner
|
||||
}
|
||||
|
||||
func (m *SysBanner) Get(tenantID uint64, condition map[string]interface{}) error {
|
||||
db := orm.GetDB().Table(m.TableName())
|
||||
|
||||
for k, v := range condition {
|
||||
db = db.Or(fmt.Sprintf("`%s` = '%v' AND is_deleted = %d AND tenant_id = %d", k, v, model.DeleteStatusForNot, tenantID))
|
||||
}
|
||||
return db.Scan(m.SysBanner).Error
|
||||
}
|
||||
|
||||
func NewSysBanner() *SysBanner {
|
||||
return &SysBanner{model.NewSysBanner()}
|
||||
}
|
||||
|
Reference in New Issue
Block a user