Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DB *gorm.DB
)
DB 数据库实例
Functions ¶
This section is empty.
Types ¶
type Amount ¶
type Amount struct { ID int64 `json:"id" gorm:"primaryKey"` Period string `json:"period,omitempty" gorm:"size:256;uniqueIndex:idx_pershop"` ShopCode string `json:"shop_code" gorm:"size:256;uniqueIndex:idx_pershop"` ShopName string `json:"shop_name" gorm:"size:256"` OrderNum uint `json:"order_num"` OrderAmount float64 `json:"order_amount"` OrderAvgAmount float64 `json:"order_avg_amount"` }
Amount represents each shop sales amount.
func GetAmountBy ¶
GetAmountBy returns the report of each shop sales amount for a specified month.
type Delivery ¶
type Delivery struct { ID int64 `json:"id" gorm:"primaryKey"` Delivery bool `json:"delivery" gorm:"comment:发货状态"` Code string `json:"code" gorm:"size:256;comment:发货单据号"` WarehouseName string `json:"warehouse_name" gorm:"size:256"` WarehouseCode string `json:"warehouse_code" gorm:"size:256;index"` ExpressName string `json:"express_name" gorm:"size:256"` ExpressCode string `json:"express_code" gorm:"size:256"` MailNo string `json:"mail_no" gorm:"size:256"` OrderCode string `json:"order_code" gorm:"size:256;index"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at" gorm:"index"` DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"` }
Delivery struct to map the Entity of the Delivery.
type Detail ¶
type Detail struct { ID int64 `json:"id" gorm:"primaryKey"` OID string `json:"oid" gorm:"size:256;comment:子订单号"` Qty float64 `json:"qty"` Price float64 `json:"price" gorm:"comment:实际单价"` Amount float64 `json:"amount" gorm:"comment:实际金额"` Refund int `json:"refund" gorm:"comment:退款状态,0:未退款,1:退款成功,2:退款中"` Note string `json:"note"` PlatformItemName string `json:"platform_item_name" gorm:"size:256;comment:平台规格名称"` PlatformSkuName string `json:"platform_sku_name" gorm:"size:256;comment:平台规格代码"` ItemCode string `json:"item_code" gorm:"size:256;index;comment:商品代码"` ItemName string `json:"item_name" gorm:"size:256;comment:商品名称"` ItemSimpleName string `json:"item_simple_name" gorm:"size:256;comment:商品简称"` PostFee float64 `json:"post_fee" gorm:"comment:物流费用"` DiscountFee float64 `json:"discount_fee" gorm:"comment:让利金额"` AmountAfter float64 `json:"amount_after" gorm:"comment:让利后金额"` OrderCode string `json:"order_code" gorm:"size:256;index"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at" gorm:"index"` DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"` }
Detail struct to map the Entity of the item details.
type Order ¶
type Order struct { ID int64 `json:"id" gorm:"unique"` Code string `json:"code" gorm:"primaryKey;size:256;comment:单据编号"` PlatformCode string `json:"platform_code" gorm:"size:256;index;comment:平台单号"` OrderTypeName string `json:"order_type_name" gorm:"size:256;index;comment:订单类型"` ShopName string `json:"shop_name" gorm:"size:256;index"` ShopCode string `json:"shop_code" gorm:"size:256;index"` VIPName string `json:"vip_name" gorm:"size:256;column:vip_name;comment:会员名称"` VIPCode string `json:"vip_code" gorm:"size:256;column:vip_code;index;comment:会员代码"` VIPRealName string `json:"vip_real_name" gorm:"size:256;column:vip_real_name"` AccountStatus string `json:"account_status" gorm:"size:256;index"` AccountAmount float64 `json:"account_amount" gorm:"comment:到账金额"` BusinessMan string `json:"business_man" gorm:"size:256"` Qty int8 `json:"qty"` Amount float64 `json:"amount" gorm:"comment:订单金额"` Payment float64 `json:"payment" gorm:"comment:支付金额"` WarehouseName string `json:"warehouse_name" gorm:"size:256"` WarehouseCode string `json:"warehouse_code" gorm:"size:256"` DeliveryState int8 `json:"delivery_state" gorm:"index"` ExpressName string `json:"express_name" gorm:"size:256"` ExpressCode string `json:"express_code" gorm:"size:256;index"` ReceiverName string `json:"receiver_name" gorm:"size:256;index"` ReceiverMobile string `json:"receiver_mobile" gorm:"size:256;index"` ReceiverArea string `json:"receiver_area" gorm:"size:256"` ReceiverAddress string `json:"receiver_address" gorm:"size:512"` PlatformTradingState string `json:"platform_trading_state" gorm:"size:256"` Deliverys []Delivery `json:"deliverys" gorm:"foreignKey:OrderCode;references:Code"` Details []Detail `json:"details" gorm:"foreignKey:OrderCode;references:Code"` Payments []Payment `json:"payments" gorm:"foreignKey:OrderCode;references:Code"` Paytime time.Time `json:"paytime" gorm:"index"` DealTime time.Time `json:"deal_time" gorm:"comment:拍单时间"` CreateTime time.Time `json:"create_time" gorm:"comment:创建时间"` ModifyTime time.Time `json:"modify_date" gorm:"comment:修改时间"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at" gorm:"index"` DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"` }
A Order struct to map the Entity Order
func (*Order) GetLastUpdatedAt ¶
GetLastUpdatedAt get the last updated timestamp of the order.
func (*Order) GetOrderCreatedMon ¶
GetOrderCreatedMon returns the list of orders created date, formatted as "YYYY-MM"
type Payment ¶
type Payment struct { ID int64 `json:"id" gorm:"primaryKey"` Payment float64 `json:"payment" gorm:"comment:支付金额"` PayCode string `json:"pay_code" gorm:"size:256;comment:支付交易号"` PayTypeName string `json:"pay_type_name" gorm:"size:256;comment:支付方式名称"` PayTime time.Time `json:"pay_time" gorm:"comment:支付时间"` OrderCode string `json:"order_code" gorm:"size:256;index"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at" gorm:"index"` DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"` }
Payment struct to map the Entity of the payment.
type Shop ¶
type Shop struct { ID int64 `json:"id" gorm:"unique"` ShopID int `json:"shop_id" gorm:"primaryKey"` Nick string `json:"nick" gorm:"size:256"` Code string `json:"code" gorm:"unique"` Name string `json:"name" gorm:"size:256"` Note string `json:"note" gorm:"size:256"` TypeName string `json:"type_name" gorm:"size:256;index"` CreateDate time.Time `json:"create_date"` ModifyDate time.Time `json:"modify_date"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at" gorm:"index"` DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"` }
A Shop struct to map every shop information.
func (*Shop) GetAllShops ¶
GetAllShops returns all shop from database.
func (*Shop) GetAmountByShop ¶
GetAmountByShop returns sales amount for each shop.
func (*Shop) GetLastUpdatedAt ¶
GetLastUpdatedAt get the datetime of last updated of shop.