fix:修复bug
This commit is contained in:
@ -8,8 +8,10 @@ import (
|
||||
"SciencesServer/app/service"
|
||||
"SciencesServer/app/session"
|
||||
config2 "SciencesServer/config"
|
||||
"SciencesServer/lib"
|
||||
"errors"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Company struct {
|
||||
@ -41,6 +43,11 @@ type (
|
||||
// CompanyParams 公司企业参数信息
|
||||
CompanyParams struct {
|
||||
}
|
||||
|
||||
// CompanyExcel 公司企业表格信息
|
||||
CompanyExcel struct {
|
||||
Name string `json:"name" xlsx:"名称"`
|
||||
}
|
||||
)
|
||||
|
||||
// Instance 首页信息
|
||||
@ -206,6 +213,24 @@ func (c *Company) Detail(id uint64) (*CompanyDetail, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Import 导入数据
|
||||
func (c *Company) Import(file string) error {
|
||||
excel := lib.NewExcel()
|
||||
err := excel.Import(strings.Replace(file, "/", "", 1), 0, 0)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
data := excel.Analysis(&CompanyExcel{})
|
||||
|
||||
now := time.Now()
|
||||
|
||||
for _, v := range data {
|
||||
_data := v.(*CompanyExcel)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewCompany() CompanyHandle {
|
||||
return func(session *session.Admin) *Company {
|
||||
return &Company{session}
|
||||
|
Reference in New Issue
Block a user