model

package
v0.0.0-...-57b530e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB
View Source
var Redis *redis.Client

Functions

func Automigrate

func Automigrate()

func DbStart

func DbStart() (*gorm.DB, error)

func RedisStart

func RedisStart()

Types

type Database

type Database struct {
	Addr     string `toml:"addr"`
	Username string `toml:"username"`
	Password string `toml:"password"`
	DbName   string `toml:"dbname"`
	MaxIdle  int    `toml:"max_idle"`
	MaxOpen  int    `toml:"max_open"`
}

type JdItemOriginal

type JdItemOriginal struct {
	Id                    int64   `gorm:"primary_key;AUTO_INCREMENT"`
	SkuId                 int64   `gorm:"comment:'商品ID';not null;unique_index:IX_skuid" json:"SkuId"`
	Pid                   int64   `gorm:"comment:'spuid,其值为同款商品的主skuid';not null;" json:"Pid"`
	WareId                int64   `gorm:"comment:'款id';not null;" json:"WareId"`
	SkuName               string  `gorm:"type:varchar(500);comment:'商品名称';not null;" json:"SkuName"`
	Cid1                  int     `gorm:"type:int;comment:'一级类目';not null;" json:"Cid1"`
	Cid1Name              string  `gorm:"type:varchar(50);comment:'一级类目名称';not null;" json:"Cid1Name"`
	Cid2                  int     `gorm:"type:int;comment:'二级类目';not null;" json:"Cid2"`
	Cid2Name              string  `gorm:"type:varchar(50);comment:'二级类目名称';not null;" json:"Cid2Name"`
	Cid3                  int     `gorm:"type:int;comment:'三级类目';not null;" json:"Cid3`
	Cid3Name              string  `gorm:"type:varchar(50);comment:'三级类目名称';not null;" json:"Cid3Name"`
	BrandCode             int     `gorm:"type:int;comment:'品牌编码';not null;" json:"BrandCode`
	BrandName             string  `gorm:"type:varchar(200);comment:'品牌名称';not null;" json:"BrandName"`
	Owner                 string  `gorm:"type:varchar(50);comment:'g:自营, p:pop';not null;" json:"Owner"`
	ImageUrl              string  `gorm:"type:varchar(1000);comment:'图片信息';not null;" json:"ImageUrl"`
	ImgList               string  `gorm:"type:varchar(1000);comment:'图片信息数组';not null;" json:"ImgList"`
	Vid                   int     `gorm:"type:int;comment:'店铺Id';not null;" json:"Vid"`
	PcPrice               float64 `gorm:"type:decimal(18, 2);comment:'pc价格';not null;" json:"PcPrice"`
	WlPrice               float64 `gorm:"type:decimal(18, 2);comment:'无线价格';not null;" json:"WlPrice"`
	PcCommissionShare     float64 `gorm:"type:decimal(18, 2);comment:'PC佣金比例';not null;" json:"PcCommissionShare"`
	WlCommissionShare     float64 `gorm:"type:decimal(18, 2);comment:'无线佣金比例';not null;" json:"WlCommissionShare"`
	PcCommission          float64 `gorm:"type:decimal(18, 2);comment:'PC佣金';not null;" json:"PcCommission"`
	WlCommission          float64 `gorm:"type:decimal(18, 2);comment:'无线佣金';not null;" json:"WlCommission"`
	HasCoupon             int     `gorm:"type:int;comment:'是否有优惠券, 0 :无 1: 有';not null;" json:"HasCoupon"`
	IsHot                 int     `gorm:"type:int;comment:'是否爆品, 0:否 1:是';not null;" json:"IsHot"`
	CouponId              int     `gorm:"type:int;comment:'通用计划优惠券ID';not null;" json:"CouponId"`
	CouponLink            string  `gorm:"type:varchar(50);comment:'通用计划 优惠券链接';not null;" json:"CouponLink"`
	RfId                  int     `gorm:"type:int;comment:'卡券系统batchId';not null;" json:"RfId"`
	Comments              int     `gorm:"type:int;comment:'评论数';not null;" json:"Comments"` // 结算时间
	GoodComments          int     `gorm:"type:int;comment:'好评数';not null;" json:"GoodComments"`
	GoodCommentsShare     float64 `gorm:"comment:'好评率';not null;" json:"GoodCommentsShare"`
	VenderName            string  `gorm:"type:varchar(100);comment:'店铺名称';not null;" json:"VenderName"`
	InOrderCount30Days    int     `gorm:"type:int;comment:'SPU维度 - 30天联盟引入订单量';not null;" json:"InOrderCount30Days"`
	InOrderCount30DaysSku int     `gorm:"type:int;comment:'sku维度 -30联盟天引入订单';not null;" json:"InOrderCount30DaysSku"`
	IsPinGou              int     `gorm:"type:int;comment:'是否参与拼购( 0 不拼购 1 拼购)';not null;" json:"IsPinGou"`
	PingouActiveId        int64   `gorm:"comment:'拼购活动id';not null;" json:"PingouActiveId"`
	PingouPrice           float64 `gorm:"type:decimal(18, 2);comment:'拼购价格';not null;" json:"PingouPrice"`
	PingouTmCount         int     `gorm:"type:int;comment:'成团人数';not null;" json:"PingouTmCount"`
	EliteId               int     `` /* 403-byte string literal not displayed */
	CreateTime            string  `gorm:"type:varchar(30);comment:'创建时间';not null;" json:"create_time"`
	UpdateTime            string  `gorm:"type:varchar(30);index:IX_update_time;comment:'更新时间';not null;" json:"update_time"`
}

func (JdItemOriginal) TableName

func (JdItemOriginal) TableName() string

type JdOriginalOrder

type JdOriginalOrder struct {
	Oid               int64   `gorm:"primary_key;AUTO_INCREMENT"`
	OrderId           int64   `gorm:"type:varchar(50);comment:'订单ID';not null;unique_index:IX_orderId" json:"orderId"`
	ParentId          int64   `` /* 168-byte string literal not displayed */
	FinishTime        string  `gorm:"type:varchar(50);comment:'订单完成时间(时间戳,毫秒)';not null" json:"finishTime"`
	OrderEmt          int64   `gorm:"type:int;comment:'下单设备(1:PC,2:无线)';not null" json:"orderEmt"`
	OrderTime         string  `gorm:"type:varchar(50);comment:'下单时间(时间戳,毫秒)';not null" json:"orderTime"`
	PayMonth          int64   `` /* 260-byte string literal not displayed */
	Plus              int64   `gorm:"type:int;comment:'下单用户是否为PLUS会员 0:否,1:是';not null" json:"plus"`
	PopId             int64   `gorm:"type:int;comment:'商家ID';not null" json:"popId"`
	UnionId           int64   `gorm:"type:int;comment:'推客的联盟ID';not null" json:"unionId"`
	ValidCode         int     `` /* 654-byte string literal not displayed */
	ActualCosPrice    float64 `` /* 211-byte string literal not displayed */
	ActualFee         float64 `` /* 196-byte string literal not displayed */
	Cid1              int64   `gorm:"type:int;comment:'一级类目ID';not null" json:"cid1"`
	Cid2              int64   `gorm:"type:int;comment:'二级类目ID';not null" json:"cid2"`
	Cid3              int64   `gorm:"type:int;comment:'三级类目ID';not null" json:"cid3"`
	CommissionRate    float64 `gorm:"type:decimal(18,2);comment:'佣金比例';not null" json:"commissionRate"`
	EstimateCosPrice  float64 `` /* 341-byte string literal not displayed */
	EstimateFee       float64 `` /* 192-byte string literal not displayed */
	Ext1              string  `` /* 178-byte string literal not displayed */
	FinalRate         float64 `gorm:"type:decimal(18,2);comment:'最终比例(分成比例+补贴比例)';not null" json:"finalRate"`
	FrozenSkuNum      int64   `gorm:"type:int;comment:'商品售后中数量';not null" json:"frozenSkuNum"`
	Pid               string  `` /* 143-byte string literal not displayed */
	PositionId        int64   `gorm:"type:int;comment:'推广位ID,0代表无推广位';not null" json:"positionId"`
	Price             float64 `gorm:"type:decimal(18,2);comment:'商品单价';not null" json:"price"`
	SiteId            int64   `gorm:"type:int;comment:'网站ID,0:无网站';not null" json:"siteId"`
	SkuId             int64   `gorm:"type:varchar(50);comment:'商品ID';not null" json:"skuId"`
	SkuName           string  `gorm:"type:varchar(500);comment:'商品名称';not null" json:"skuName"`
	SkuNum            int     `gorm:"type:int;comment:'商品数量';not null" json:"skuNum"`
	SkuReturnNum      int64   `gorm:"type:int;comment:'商品已退货数量';not null" json:"skuReturnNum"`
	SubSideRate       float64 `gorm:"type:decimal(18,2);comment:'分成比例';not null" json:"subSideRate"`
	SubUnionId        string  `gorm:"type:varchar(50);comment:'子联盟ID(需要联系运营开放白名单才能拿到数据)';not null" json:"subUnionId"`
	SubsidyRate       float64 `gorm:"type:decimal(18,2);comment:'补贴比例';not null" json:"subsidyRate"`
	TraceType         int64   `gorm:"type:int;comment:'2:同店;3:跨店';not null" json:"traceType"`
	UnionAlias        string  `gorm:"type:varchar(50);comment:'PID所属母账号平台名称(原第三方服务商来源)';not null" json:"unionAlias"`
	UnionTag          string  `` /* 680-byte string literal not displayed */
	UnionTrafficGroup int64   `gorm:"type:int;comment:'渠道组 1:1号店,其他:京东';not null" json:"unionTrafficGroup"`
	HasMore           int64   `gorm:"type:int;comment:'是否还有下一页';not null" json:"has_more"`
}

func (JdOriginalOrder) TableName

func (JdOriginalOrder) TableName() string

type PddItemOriginal

type PddItemOriginal struct {
	Id                   int64  `gorm:"primary_key;AUTO_INCREMENT"`
	GoodsId              int64  `gorm:"comment:'商品id';not null;index:IX_goods_id;" json:"goods_id"`               // 商品id
	GoodsName            string `gorm:"type:varchar(300);comment:'商品名称';not null;" json:"goods_name"`             // 商品名称
	CategoryId           string `gorm:"type:varchar(100);comment:'商品类目 id';not null;" json:"category_id"`         // 商品类目 id
	CategoryName         string `gorm:"type:varchar(100);comment:'商品类目名称';not null;" json:"category_name"`        // 商品类目名称
	CatId                string `gorm:"type:varchar(100);comment:'商品类目id';not null;" json:"cat_id"`               // 商品类目id
	CouponDiscount       int64  `gorm:"type:int;comment:'优惠券面额,单位为分';not null;" json:"coupon_discount"`           // 优惠券面额,单位为分
	CouponEndTime        int64  `gorm:"type:int;comment:'优惠券失效时间,UNIX时间戳';not null;" json:"coupon_end_time"`      // 优惠券失效时间,UNIX时间戳
	CouponMinOrderAmount int64  `gorm:"type:int;comment:'优惠券门槛价格,单位为分';not null;" json:"coupon_min_order_amount"` // 优惠券门槛价格,单位为分
	CouponPrice          int64  `gorm:"type:int;comment:'优惠券金额';not null;" json:"coupon_price"`                   // 优惠券面额,单位为分
	CouponRemainQuantity int    `gorm:"type:int;comment:'优惠券剩余数量';not null;" json:"coupon_remain_quantity"`       // 优惠券剩余数量
	CouponStartTime      int64  `gorm:"type:int;comment:'优惠券生效时间,UNIX时间戳';not null;" json:"coupon_start_time"`    // 优惠券生效时间,UNIX时间戳
	CouponTotalQuantity  int    `gorm:"type:int;comment:'优惠券总数量';not null;" json:"coupon_total_quantity"`         // 优惠券总数量
	GoodsDesc            string `gorm:"type:varchar(500);comment:'商品描述';not null;" json:"goods_desc"`             // 商品描述
	GoodsImageUrl        string `gorm:"type:varchar(100);comment:'商品主图';not null;" json:"goods_image_url"`        // 商品主图
	GoodsThumbnailUrl    string `gorm:"type:varchar(100);comment:'商品缩略图';not null;" json:"goods_thumbnail_url"`   // 商品缩略图
	HasCoupon            bool   `gorm:"type:int;comment:'是否有优惠券';not null;" json:"has_coupon"`                    // 是否有优惠券
	MallId               int64  `gorm:"comment:'店铺 id';not null;" json:"mall_id"`                                 // 店铺 id
	MallName             string `gorm:"type:varchar(500);comment:'店铺名字';not null;" json:"mall_name"`              // 店铺名字
	MerchantType         string ``                                                                                // 店铺类型,1-个人,2-企业,3-旗舰店,4-专卖店,5-专营店,6-普通店
	/* 156-byte string literal not displayed */
	MinGroupPrice int64 `` // 最小拼团价(单位为分) 最低价 sku 的拼团价,单位为分
	/* 134-byte string literal not displayed */
	MinNormalPrice       int64  `gorm:"type:int;comment:'最小单买价格(单位为分)';not null;" json:"min_normal_price"`           // 最小单买价格(单位为分)
	PromotionRate        int64  `gorm:"type:int;comment:'佣金比例,千分比 300';not null;" json:"promotion_rate"`             // 佣金比例,千分比 300
	PredictPromotionRate int64  `gorm:"type:int;comment:'比价行为预判定佣金,需要用户备案';not null;" json:"predict_promotion_rate"` // 比价行为预判定佣金,需要用户备案
	EliteId              int    ``                                                                                   /* 217-byte string literal not displayed */
	CreateTime           string `gorm:"type:varchar(30);comment:'创建时间';not null;" json:"create_time`
	UpdateTime           string `gorm:"type:varchar(30);index:IX_update_time;comment:'更新时间';not null;" json:"update_time"`
}

func (PddItemOriginal) TableName

func (PddItemOriginal) TableName() string

type PddOriginalOrder

type PddOriginalOrder struct {
	Id                    int64   `gorm:"primary_key;AUTO_INCREMENT"`
	OrderSn               string  `gorm:"type:varchar(50);comment:'推广订单编号';not null;unique_index:IX_order_sn" json:"order_sn"`
	GoodsId               int64   `gorm:"type:varchar(50);comment:'商品ID';not null" json:"goods_id"`
	GoodsName             string  `gorm:"type:varchar(500);comment:'商品标题';not null;" json:"goods_name"`
	GoodsThumbnailUrl     string  `gorm:"type:varchar(100);comment:'商品缩略图';not null;" json:"goods_thumbnail_url"`
	GoodsQuantity         int     `gorm:"type:int;comment:'购买商品的数量';not null;" json:"goods_quantity"`
	GoodsPrice            float64 `gorm:"type:decimal(18,2);comment:'订单中sku的单件价格,单位为分';not null;" json:"goods_price"`
	OrderAmount           float64 `gorm:"type:decimal(18,2);comment:'实际支付金额,单位为分';not null;" json:"order_amount"`
	OrderCreateTime       int64   `gorm:"type:varchar(50);comment:'订单生成时间,UNIX时间戳';not null;" json:"order_create_time"`
	OrderSettleTime       int     `gorm:"type:varchar(50);comment:'结算时间';not null;" json:"order_settle_time"`    // 结算时间
	OrderVerifyTime       int     `gorm:"type:varchar(50);comment:'审核时间';not null;" json:"order_verify_time"`    // 审核时间
	OrderReceiveTime      int     `gorm:"type:varchar(50);comment:'确认收货时间';not null;" json:"order_receive_time"` // 收货时间
	OrderPayTime          int     `gorm:"type:varchar(50);comment:'支付时间';not null;" json:"order_pay_time"`
	PromotionRate         float64 `gorm:"type:decimal(18,2);comment:'佣金比例,千分比';not null;" json:"promotion_rate"`
	PromotionAmount       float64 `gorm:"type:decimal(18,2);comment:'佣金金额,单位为分';not null;" json:"promotion_amount"`
	BatchNo               string  `gorm:"type:varchar(50);comment:'结算批次号';default null;" json:"batch_no"`
	OrderStatus           int     `` /* 231-byte string literal not displayed */
	OrderStatusDesc       string  `gorm:"type:varchar(500);comment:'订单状态描述';not null;" json:"order_status_desc"`
	OrderGroupSuccessTime int64   `gorm:"type:varchar(50);comment:'成团时间';not null;" json:"order_group_success_time"`
	OrderModifyAt         int     `gorm:"type:varchar(50);comment:'最后更新时间';not null;" json:"order_modify_at"`
	Type                  int     `gorm:"type:int;comment:'订单推广类型';not null;" json:"type"`
	GroupId               int64   `gorm:"type:varchar(50);comment:'成团编号';not null;" json:"group_id"`
	AuthDuoId             int     `gorm:"type:varchar(50);comment:'订多多客工具id';not null;" json:"auth_duo_id"`
	ZsDuoId               int     `gorm:"type:varchar(50);comment:'招商多多客id';not null;" json:"zs_duo_id"`
	CustomParameters      string  `gorm:"type:varchar(50);comment:'自定义参数';not null;" json:"custom_parameters"`
	PId                   string  `gorm:"type:varchar(50);comment:'推广位ID';not null;" json:"p_id"`
	Pid                   string  `gorm:"type:varchar(50);comment:'未知ID';not null;" json:"pid"`
	VerifyTime            int     `gorm:"type:varchar(50);comment:'订单审核时间';not null;" json:"verify_time"` // 审核时间
	MatchChannel          int     `gorm:"type:varchar(50);comment:'匹配渠道';not null;" json:"match_channel"`
	CpaNew                int     `gorm:"type:varchar(50);comment:'是否是 cpa 新用户,1表示是,0表示否';default null;" json:"cpa_new"`
	DuoCouponAmount       float64 `gorm:"type:decimal(18,2);comment:'优惠券金额';not null;" json:"duo_coupon_amount"`
}

func (PddOriginalOrder) TableName

func (PddOriginalOrder) TableName() string

type RedisObj

type RedisObj struct {
	Addr     string `toml:"addr"`
	Password string `toml:"password"`
	Db       int    `toml:"db"`
	PoolSize int    `toml:"pool_size"`
}

func (*RedisObj) NewClient

func (r *RedisObj) NewClient() *redis.Client

新建client

type TbDingdan

type TbDingdan struct {
	Did            int64   `gorm:"primary_key;AUTO_INCREMENT" json:"did"`
	Ordernum       string  `gorm:"type:varchar(50);comment:'订单ID';not null;index:IX_orderNum;unique_index:shopid_ordernum" json:"ordernum"`
	OrdernumParent string  `gorm:"type:varchar(50);comment:'父订单ID';not null;index:IX_ordernum_parent" json:"ordernum_parent"`
	ShopId         int64   `gorm:"type:int;comment:'商城ID';not null;unique_index:shopid_ordernum" json:"shop_id"`
	Userid         int64   `gorm:"type:int;comment:'用户ID';index:IX_userid;not null" json:"userid"`
	Buydate        string  `gorm:"type:datetime;comment:'下单时间';not null" json:"buydate"`
	Amount         float64 `gorm:"type:decimal(18,2);comment:'订单金额';not null" json:"amount"`
	InputDate      string  `gorm:"type:datetime;comment:'跟单时间';not null" json:"input_date"`
	OrderState     int     `` /* 131-byte string literal not displayed */
	FanliState     int     `gorm:"type:int;comment:'返利状态 : 1.待返利,2:己返利,3:无效';not null" json:"fanli_state"`
	PreCommission  float64 `gorm:"type:decimal(18,2);comment:'订单预计佣金';not null" json:"pre_commission"`
	Fanli          float64 `gorm:"type:decimal(18,2);comment:'返利值';not null" json:"fanli"`
	TrackingCode   string  `gorm:"type:varchar(50);comment:'跟踪码';default null" json:"tracking_code"`
	ShopTitle      string  `gorm:"type:varchar(100);comment:'店铺名称';not null" json:"shop_title"`
	PayDate        string  `gorm:"type:datetime;comment:'支付时间';not null" json:"pay_time"`
	Commission     float64 `gorm:"type:decimal(18,2);comment:'实际佣金';not null" json:"commission"`
	Yujifanli      float64 `gorm:"type:decimal(18,2);comment:'预计返利';not null" json:"yujifanli"`
	Remark         string  `gorm:"type:varchar(200);comment:'订单备注';not null" json:"remark"`
	ModifyDate     string  `gorm:"type:varchar(50);comment:'修改时间';not null" json:"modify_date"`
}

func (TbDingdan) TableName

func (TbDingdan) TableName() string

type TbDingdanItems

type TbDingdanItems struct {
	Id             int64   `gorm:"primary_key;AUTO_INCREMENT"`
	Did            int64   `gorm:"type:int;index:IX_did;unique_index:did_pid" json:"did"`
	Userid         int64   `gorm:"type:int;comment:'用户ID';index:IX_userid;not null" json:"userid"`
	ShopId         int64   `gorm:"type:int;comment:'商城ID';not null" json:"shop_id"`
	Pid            string  `gorm:"type:varchar(50);unique_index:did_pid;comment:'商品ID';not null" json:"pid"`
	Pnum           int     `gorm:"type:int;comment:'商品数量';not null" json:"pnum"`
	Price          float64 `gorm:"type:decimal(18,2);comment:'商品总价';not null" json:"price"`
	Unitprice      float64 `gorm:"type:decimal(18,2);comment:'商品单价';not null" json:"unitprice"`
	Comm           float64 `gorm:"type:decimal(18,2);comment:'佣金';not null" json:"comm"`
	Cid            string  `gorm:"type:varchar(100);comment:'佣金分类';not null" json:"cid"`
	Fanli          float64 `gorm:"type:decimal(18,2);comment:'商品返利值';not null" json:"fanli"`
	Category_id    int64   `gorm:"type:int;comment:'分类ID';not null" json:"category_id"`
	Shop_title     string  `gorm:"type:varchar(500);comment:'店铺名称';not null" json:"shop_title"`
	Product_title  string  `gorm:"type:varchar(500);comment:'商品名称';not null" json:"product_title"`
	Product_status int     `gorm:"type:int;comment:'订单商品状态';not null" json:"product_status"`
	Related_pid    string  `gorm:"type:varchar(100);comment:'关联商品ID';not null" json:"related_pid"`
	Itempic        string  `gorm:"type:varchar(200);comment:'商品图片';not null" json:"itempic"`
	Remark         string  `gorm:"type:varchar(500);comment:'备注';not null" json:"remark"`
	ModifyDate     string  `gorm:"type:datetime;comment:'修改时间';not null" json:"modify_date"`
}

func (TbDingdanItems) TableName

func (TbDingdanItems) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL