1234567891011121314151617181920212223242526272829303132333435363738 |
- package excel
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- // ExcelSheetData excel表格详情表
- type ExcelSheetData struct {
- ExcelDataId int `orm:"column(excel_data_id);pk"`
- ExcelInfoId int `description:"数据归属的excel_info的id"`
- ExcelSheetId int `description:"数据归属sheet"`
- Sort int `description:"数据排序"`
- Data string `description:"数据,分页存储"`
- ModifyTime time.Time `description:"最近修改日期"`
- CreateTime time.Time `description:"创建日期"`
- }
- // Update 更新 excel表格的sheet基础信息
- func (ExcelSheetData *ExcelSheetData) Update(cols []string) (err error) {
- o := orm.NewOrmUsingDB("data")
- _, err = o.Update(ExcelSheetData, cols...)
- return
- }
- // AddExcelSheetData 新增excel表格的sheet基础信息
- func AddExcelSheetData(excelInfo *ExcelSheetData) (err error) {
- o := orm.NewOrmUsingDB("data")
- // 表格信息入库
- lastId, err := o.Insert(excelInfo)
- if err != nil {
- return
- }
- excelInfo.ExcelInfoId = int(lastId)
- return
- }
|