mirror of
https://github.com/tiger1103/gfast.git
synced 2026-09-21 18:20:47 +00:00
40 lines
1.2 KiB
Go
40 lines
1.2 KiB
Go
// =================================================================================
|
|
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
|
// =================================================================================
|
|
|
|
package dao
|
|
|
|
import (
|
|
"fmt"
|
|
"gfast/app/system/dao/internal"
|
|
"gfast/app/system/model"
|
|
"github.com/gogf/gf/errors/gerror"
|
|
"github.com/gogf/gf/frame/g"
|
|
)
|
|
|
|
// sysModelInfoDao is the manager for logic model data accessing
|
|
// and custom defined data operations functions management. You can define
|
|
// methods on it to extend its functionality as you wish.
|
|
type sysModelInfoDao struct {
|
|
internal.SysModelInfoDao
|
|
}
|
|
|
|
var (
|
|
// SysModelInfo is globally public accessible object for table sys_model_info operations.
|
|
SysModelInfo = sysModelInfoDao{
|
|
internal.SysModelInfo,
|
|
}
|
|
)
|
|
|
|
// Fill with you ideas below.
|
|
func (i *sysModelInfoDao) GetModelsByCateIds(cateIds []int) (models []*model.SysModelInfo, err error) {
|
|
err = i.Fields(fmt.Sprintf("%s,%s,%s", i.Columns.ModelId, i.Columns.ModelName, i.Columns.ModelTitle)).
|
|
Where(i.Columns.ModelCategoryId+" in(?)", cateIds).
|
|
Order(i.Columns.ModelId + " ASC ").Scan(&models)
|
|
if err != nil {
|
|
g.Log().Error(err)
|
|
err = gerror.New("获取模型信息失败")
|
|
}
|
|
return
|
|
}
|