| 123456789101112131415161718192021222324252627282930313233343536373839 |
- // =================================================================================
- // 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
- }
|