- temp.
This commit is contained in:
20
business/model/dao/sku.go
Normal file
20
business/model/dao/sku.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals/gormdb"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
func GetCategory(ID int, db *gorm.DB) (*model.SkuCategory, error) {
|
||||
if db == nil {
|
||||
db = gormdb.GetDB()
|
||||
}
|
||||
item := &model.SkuCategory{}
|
||||
item.ID = ID
|
||||
err := utils.CallFuncLogError(func() error {
|
||||
return db.First(item).Error
|
||||
}, "GetCategory")
|
||||
return item, err
|
||||
}
|
||||
20
business/model/dao/store.go
Normal file
20
business/model/dao/store.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals/gormdb"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
func GetStore(ID int, db *gorm.DB) (*model.Store, error) {
|
||||
if db == nil {
|
||||
db = gormdb.GetDB()
|
||||
}
|
||||
item := &model.Store{}
|
||||
item.ID = ID
|
||||
err := utils.CallFuncLogError(func() error {
|
||||
return db.First(item).Error
|
||||
}, "GetStore")
|
||||
return item, err
|
||||
}
|
||||
@@ -52,7 +52,7 @@ type SkuJdCategory struct {
|
||||
ModelIDCUO
|
||||
Name string `gorm:"type:varchar(255);index"`
|
||||
Level int
|
||||
ParentID int64
|
||||
ParentID int
|
||||
}
|
||||
|
||||
type SkuCategory struct {
|
||||
@@ -63,8 +63,8 @@ type SkuCategory struct {
|
||||
Type int8 // 类别类型
|
||||
Seq int
|
||||
|
||||
JdID int64 `gorm:"index"` // 这个是指商家自己的商品类别在京东平台上的ID
|
||||
JdCategoryID int64 // 这个是指对应的京东商品类别
|
||||
JdID int `gorm:"index"` // 这个是指商家自己的商品类别在京东平台上的ID
|
||||
JdCategoryID int // 这个是指对应的京东商品类别
|
||||
ElmID string `gorm:"type:varchar(48);index"`
|
||||
MtID string `gorm:"type:varchar(48);index"`
|
||||
DidiID string `gorm:"type:varchar(48);index"`
|
||||
|
||||
Reference in New Issue
Block a user