You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
872 B
35 lines
872 B
package jst
|
|
|
|
import "recook/internal/v2/lib/db"
|
|
|
|
// JSTOrder 聚水潭order关联.
|
|
type OrderModel struct {
|
|
db.BaseModel
|
|
ID uint `gorm:"column:id;primary_key"`
|
|
OID uint `gorm:"column:oid"`
|
|
OrderID uint `gorm:"column:order_id"`
|
|
JSTShopID uint `gorm:"column:jst_shop_id"`
|
|
}
|
|
|
|
// TableName sets the insert table name for this struct type.
|
|
func (r *OrderModel) TableName() string {
|
|
return "jst_order"
|
|
}
|
|
|
|
// FindByOrderID 根据orderGoodsID.
|
|
func (r *OrderModel) FindByOrderID(by uint) (result OrderModel) {
|
|
r.GetDb().Model(&OrderModel{}).Where("order_id = ?", by).First(&result)
|
|
return
|
|
}
|
|
|
|
// FindByOID 根据erp内部id.
|
|
func (r *OrderModel) FindByOID(by uint) (result OrderModel) {
|
|
r.GetDb().Model(&OrderModel{}).Where("oid = ?", by).First(&result)
|
|
return
|
|
}
|
|
|
|
// Create 创建.
|
|
func (r *OrderModel) Create(data *OrderModel) {
|
|
r.GetDb().Create(data)
|
|
}
|