服务之间相互调用

This commit is contained in:
2026-08-24 10:06:52 +08:00
parent c33fbdb422
commit 80f428c032
49 changed files with 1756 additions and 35 deletions
+25
View File
@@ -0,0 +1,25 @@
package dao
const DeliveryAddressDefaultYes = 1 //默认
const DeliveryAddressDefaultNo = 2 //不默认
const DeliveryAddressTypeStore = 1
type Address struct {
Id int64 `json:"id" gorm:"id"`
TargetId int64 `json:"target_id" gorm:"target_id"` // 对象ID
District string `json:"district" gorm:"district"` // 地区
DistrictIds string `json:"district_ids" gorm:"district_ids"` // 地区IDS
Default int32 `json:"default" gorm:"default"` // 默认:1为默认,2为不默认
Address string `json:"address" gorm:"address"` // 地址
SaleId int64 `json:"sale_id" gorm:"sale_id"` // 销售ID
GroupId int64 `json:"group_id" gorm:"group_id"` // 分组ID
Name string `json:"name" gorm:"name"` // 收货人姓名
Mobile string `json:"mobile" gorm:"mobile"` // 收货人手机
Type int32 `json:"type" gorm:"type"` // 类型 1门店 , 2销售,3为用户
Status int32 `json:"status" gorm:"status"` // 状态,1是正常,2为申请,3为一审核,4为二审核中,5为拒绝申请,6为审核失败,7为删除
Reason string `json:"reason" gorm:"reason"`
NewContent string `json:"new_content" gorm:"new_content"` // 编辑后的内容
TypeName string `json:"type_name" gorm:"type_name"` // 类型名
AdminId int64 `json:"admin_id" gorm:"admin_id"`
AdminName string `json:"admin_name" gorm:"admin_name"`
}
+10
View File
@@ -0,0 +1,10 @@
package dao
type Cart struct {
Id int64 `json:"id" gorm:"id"`
Content string `json:"content" gorm:"content"` // 内容
StoreId int64 `json:"store_id" gorm:"store_id"` // 门店ID
SaleId int64 `json:"sale_id" gorm:"sale_id"` // 销售ID
Type bool `json:"type" gorm:"type"` // 类型,1为门店添加,2为销售添加
UserId int64 `json:"user_id" gorm:"user_id"` // 用户ID
}
+223
View File
@@ -0,0 +1,223 @@
package dao
import (
"lone-services/pkg/utils"
)
const (
OrderPayTypeWechat = 1 //微信
OrderPayTypeAlipay = 2 //支付宝
OrderPayTypeRemaining = 3 //余额
OrderPayStatusOk = 1 //为已支付
OrderPayStatusWait = 2 //为未支付
OrderPayStatusIn = 3 //为支付中
OrderPayStatusFail = 4 //支付失败
OrderPayStatusLose = 5 //已失效
OrderTypeSale = 1 //销售
OrderTypeStore = 2 //为门店
OrderTypePersonal = 3 //为个人
OrderTypeHome = 4 //为个人家庭试用
)
type OrderCreate struct {
Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
OrderSn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
StoreId int `gorm:"column:store_id;type:int(11);comment:美容院关联ID号" json:"store_id"`
StoreName string `gorm:"column:store_name;type:varchar(50);comment:门店名" json:"store_name"`
SaleName string `gorm:"column:sale_name;type:varchar(50);comment:销售姓名" json:"sale_name"`
SaleMobile string `gorm:"column:sale_mobile;type:char(60);comment:销售电话" json:"sale_mobile"`
SaleProvince int `gorm:"column:sale_province;type:int(11);default:0;comment:销售到的地域" json:"sale_province"`
UserId int `gorm:"column:user_id;type:int(11);comment:用户ID" json:"user_id"`
UserName string `gorm:"column:user_name;type:varchar(255);comment:用户名" json:"user_name"`
SaleId int `gorm:"column:sale_id;type:int(11);comment:销售员ID号" json:"sale_id"`
Mobile string `gorm:"column:mobile;type:char(60);comment:收货人手机号;NOT NULL" json:"mobile"`
Address string `gorm:"column:address;type:varchar(255);comment:收货人地址;NOT NULL" json:"address"`
Addressee string `gorm:"column:addressee;type:varchar(50);comment:收货人姓名;NOT NULL" json:"addressee"`
DistrictIds string `gorm:"column:district_ids;type:varchar(255);comment:地区IDS;NOT NULL" json:"district_ids"`
TotalPrice float64 `gorm:"column:total_price;type:decimal(10,2);comment:总价;NOT NULL" json:"total_price"`
GroupId int `gorm:"column:group_id;type:int(11);default:0" json:"group_id"`
PayPrice float64 `gorm:"column:pay_price;type:decimal(10,2);comment:实际支付金额" json:"pay_price"`
PayType uint8 `gorm:"column:pay_type;type:tinyint(1);default:1;comment:支付类型,1为微信,2为支付宝,3为余额支付" json:"pay_type"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:2;comment:支付状态,1为已支付,2为未支付,3为支付中,4支付失败,5已失效;NOT NULL" json:"status"`
IsSupply uint8 `gorm:"column:is_supply;type:tinyint(1);default:1;comment:是否补过货,1为没有,2为补过" json:"is_supply"`
Note string `gorm:"column:note;type:varchar(255);comment:备注" json:"note"`
VerifyStatus uint8 `gorm:"column:verify_status;type:tinyint(1);default:0;comment:审核状态,1为通过,2为失败,3为待审核,0为正常订单不需要审核" json:"verify_status"`
ProductIds string `gorm:"column:product_ids;type:varchar(150);comment:产品IDs" json:"product_ids"`
Type uint8 `gorm:"column:type;type:tinyint(1);default:0;comment:类型 1 销售,2为门店,3为个人,4为个人家庭试用,5为个人门店试用" json:"type"`
}
type OrderInfo struct {
Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
OrderSn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
StoreId int `gorm:"column:store_id;type:int(11);comment:美容院关联ID号" json:"store_id"`
StoreName string `gorm:"column:store_name;type:varchar(50);comment:门店名" json:"store_name"`
SaleName string `gorm:"column:sale_name;type:varchar(50);comment:销售姓名" json:"sale_name"`
SaleMobile string `gorm:"column:sale_mobile;type:char(60);comment:销售电话" json:"sale_mobile"`
UserId int `gorm:"column:user_id;type:int(11);comment:用户ID" json:"user_id"`
UserName string `gorm:"column:user_name;type:varchar(255);comment:用户名" json:"user_name"`
SaleId int `gorm:"column:sale_id;type:int(11);comment:销售员ID号" json:"sale_id"`
Mobile string `gorm:"column:mobile;type:char(60);comment:收货人手机号;NOT NULL" json:"mobile"`
Address string `gorm:"column:address;type:varchar(255);comment:收货人地址;NOT NULL" json:"address"`
Addressee string `gorm:"column:addressee;type:varchar(50);comment:收货人姓名;NOT NULL" json:"addressee"`
DistrictIds string `gorm:"column:district_ids;type:varchar(255);comment:地区IDS;NOT NULL" json:"district_ids"`
TotalPrice float64 `gorm:"column:total_price;type:decimal(10,2);comment:总价;NOT NULL" json:"total_price"`
PayPrice float64 `gorm:"column:pay_price;type:decimal(10,2);comment:实际支付金额" json:"pay_price"`
PayType uint8 `gorm:"column:pay_type;type:tinyint(1);default:1;comment:支付类型,1为微信,2为支付宝,3为余额支付" json:"pay_type"`
DeliverStatus uint8 `gorm:"column:deliver_status;type:tinyint(1);default:2;comment:发货状态,1为已签收,2为待发货,3为发货中,4为已发货" json:"deliver_status"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:2;comment:支付状态,1为已支付,2为未支付,3为支付中,4支付失败,5已失效;NOT NULL" json:"status"`
IsSupply uint8 `gorm:"column:is_supply;type:tinyint(1);default:1;comment:是否补过货,1为没有,2为补过" json:"is_supply"`
Note string `gorm:"column:note;type:varchar(255);comment:备注" json:"note"`
ProductIds string `gorm:"column:product_ids;type:varchar(150);comment:产品IDs" json:"product_ids"`
OutTradeNo string `gorm:"column:out_trade_no;type:varchar(50);comment:支付订单号" json:"out_trade_no"`
OldAddress string `gorm:"column:old_address;type:varchar(255);comment:老的收发货信息,如果有这个就表明是修改过收货地址" json:"old_address"`
Type uint8 `gorm:"column:type;type:tinyint(1);default:0;comment:类型 1 销售,2为门店,3为个人,4为个人家庭试用,5为个人门店试用" json:"type"`
SignTime utils.CustomTime `gorm:"column:sign_time;type:datetime;comment:签收时间" json:"sign_time"`
CreateType uint8 `gorm:"column:create_type;type:tinyint(1);default:1;comment:下单人类型,1为销售,2为门店,3为个人;NOT NULL" json:"create_type"`
CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP;comment:订单创建时间" json:"create_time"`
ProductItems []OrderProducts `gorm:"-" json:"product_items"`
RefundStatus uint8 `gorm:"column:refund_status" json:"refund_status"`
AesMobile string `gorm:"-" json:"aes_mobile"`
OriginalMobile string `gorm:"-" json:"original_mobile,omitempty"`
}
type OrderPay struct {
Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
TotalPrice float64 `gorm:"column:total_price;type:decimal(10,2);comment:总价;NOT NULL" json:"total_price"`
OrderSn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
PayPrice float64 `gorm:"column:pay_price;type:decimal(10,2);comment:实际支付金额" json:"pay_price"`
PayType uint8 `gorm:"column:pay_type;type:tinyint(1);default:1;comment:支付类型,1为微信,2为支付宝,3为余额支付" json:"pay_type"`
DistrictIds string `gorm:"column:district_ids;type:varchar(255);comment:地区IDS;NOT NULL" json:"district_ids"`
GroupId int `gorm:"column:group_id;type:int(11);default:0;comment:分组ID" json:"group_id"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:2;comment:支付状态,1为已支付,2为未支付,3为支付中,4支付失败,5已失效;NOT NULL" json:"status"`
Mobile string `gorm:"column:mobile;type:char(60);comment:收货人手机号;NOT NULL" json:"mobile"`
Address string `gorm:"column:address;type:varchar(255);comment:收货人地址;NOT NULL" json:"address"`
Addressee string `gorm:"column:addressee;type:varchar(50);comment:收货人姓名;NOT NULL" json:"addressee"`
OutTradeNo string `gorm:"column:out_trade_no;type:varchar(50);comment:支付订单号;NOT NULL" json:"out_trade_no"`
}
type OrderDown struct {
Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
OrderSn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
StoreId int `gorm:"column:store_id;type:int(11);comment:美容院关联ID号" json:"store_id"`
StoreName string `gorm:"column:store_name;type:varchar(50);comment:门店名" json:"store_name"`
SaleName string `gorm:"column:sale_name;type:varchar(50);comment:销售姓名" json:"sale_name"`
SaleMobile string `gorm:"column:sale_mobile;type:char(60);comment:销售电话" json:"sale_mobile"`
SaleId int `gorm:"column:sale_id;type:int(11);comment:销售员ID号" json:"sale_id"`
Mobile string `gorm:"column:mobile;type:char(60);comment:收货人手机号;NOT NULL" json:"mobile"`
Address string `gorm:"column:address;type:varchar(255);comment:收货人地址;NOT NULL" json:"address"`
Addressee string `gorm:"column:addressee;type:varchar(50);comment:收货人姓名;NOT NULL" json:"addressee"`
DistrictIds string `gorm:"column:district_ids;type:varchar(255);comment:地区IDS;NOT NULL" json:"district_ids"`
TotalPrice float64 `gorm:"column:total_price;type:decimal(10,2);comment:总价;NOT NULL" json:"total_price"`
PayPrice float64 `gorm:"column:pay_price;type:decimal(10,2);comment:实际支付金额" json:"pay_price"`
PayType uint8 `gorm:"column:pay_type;type:tinyint(1);default:1;comment:支付类型,1为微信,2为支付宝,3为余额支付" json:"pay_type"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:2;comment:支付状态,1为已支付,2为未支付,3为支付中,4支付失败,5已失效;NOT NULL" json:"status"`
ProductIds string `gorm:"column:product_ids;type:varchar(150);comment:产品IDs" json:"product_ids"`
SignTime utils.CustomTime `gorm:"column:sign_time;type:datetime;comment:签收时间" json:"sign_time"`
CreateType uint8 `gorm:"column:create_type;type:tinyint(1);default:1;comment:下单人类型,1为销售,2为门店,3为个人;NOT NULL" json:"create_type"`
CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP;comment:订单创建时间" json:"create_time"`
ProductName string `gorm:"-" json:"product_name"`
TypeName string `gorm:"-" json:"type_name"`
BankInfo string `gorm:"-" json:"bank_info"`
OriginalMobile string `gorm:"-" json:"original_mobile"`
OriginalSaleMobile string `gorm:"-" json:"original_sale_mobile"`
}
type OrderSaleItems struct {
Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
OrderSn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
StoreName string `gorm:"column:store_name;type:varchar(50);comment:门店名" json:"store_name"`
TotalPrice float64 `gorm:"column:total_price;type:decimal(10,2);comment:总价;NOT NULL" json:"total_price"`
PayPrice float64 `gorm:"column:pay_price;type:decimal(10,2);comment:实际支付金额" json:"pay_price"`
ProductIds string `gorm:"column:product_ids;type:varchar(150);comment:产品IDs" json:"product_ids"`
SignTime utils.CustomTime `gorm:"column:sign_time;type:datetime;comment:签收时间" json:"sign_time"`
CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP;comment:订单创建时间" json:"create_time"`
ProductItems []OrderProducts `gorm:"-" json:"product_items"`
}
type OrderAccount struct {
Id int `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
OrderSn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
StoreId int `gorm:"column:store_id;type:int(11);comment:美容院关联ID号" json:"store_id"`
UserId int `gorm:"column:user_id;type:int(11);comment:用户ID" json:"user_id"`
SaleId int `gorm:"column:sale_id;type:int(11);comment:销售员ID号" json:"sale_id"`
TotalPrice float64 `gorm:"column:total_price;type:decimal(10,2);comment:总价;NOT NULL" json:"total_price"`
PayPrice float64 `gorm:"column:pay_price;type:decimal(10,2);comment:实际支付金额" json:"pay_price"`
PayType uint8 `gorm:"column:pay_type;type:tinyint(1);default:1;comment:支付类型,1为微信,2为支付宝,3为余额支付" json:"pay_type"`
ProductIds string `gorm:"column:product_ids;type:varchar(150);comment:产品IDs" json:"product_ids"`
Type uint8 `gorm:"column:type;type:tinyint(1);default:0;comment:类型 1 销售,2为门店,3为个人,4为个人家庭试用,5为个人门店试用" json:"type"`
Products []OrderProducts `gorm:"-" json:"products"`
TaskAwardMonthStatus uint8 `gorm:"column:task_awark_month_status;type:tinyint(1);default:2;comment:结算任务与奖励月,1 为已结算,2为未结算" json:"task_awark_month_status"`
TaskAwardQuarterStatus uint8 `gorm:"column:task_awark_quarter_status;type:tinyint(1);default:2;comment:结算任务与奖励季度,1 为已结算,2为未结算" json:"task_awark_quarter_status"`
TaskAwardHalfYearStatus uint8 `gorm:"column:task_awark_half_year_status;type:tinyint(1);default:2;comment:结算任务与奖励半年,1 为已结算,2为未结算" json:"task_awark_half_year_status"`
TaskAwardYearStatus uint8 `gorm:"column:task_awark_year_status;type:tinyint(1);default:2;comment:结算任务与奖励年,1 为已结算,2为未结算" json:"task_awark_year_status"`
CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP;comment:订单创建时间" json:"create_time"`
}
type OrderAccountStatus struct {
AccountStatus uint8 `gorm:"column:account_status;type:tinyint(1);default:2;comment:结算订单状态,1为已结算,2为未结算,3为结算中" json:"account_status"`
}
type OrderShareStatus struct {
ShareStatus uint8 `gorm:"column:share_status;type:tinyint(1);default:2;comment:结算抽成状态,1为已结算,2为未结算,3为结算中" json:"share_status"`
}
type OrderDeliverGoodsStatus struct {
SignTime utils.CustomTime `gorm:"column:sign_time;type:datetime;comment:签收时间" json:"sign_time"`
DeliverStatus uint8 `gorm:"column:deliver_status;type:tinyint(1);default:2;comment:发货状态,1为已签收,2为待发货,3为发货中,4为已发货" json:"deliver_status"`
}
type OrderImitateInfo struct {
Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
OrderSn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
Mobile string `gorm:"column:mobile;type:char(60);comment:收货人手机号;NOT NULL" json:"mobile"`
Address string `gorm:"column:address;type:varchar(255);comment:收货人地址;NOT NULL" json:"address"`
Addressee string `gorm:"column:addressee;type:varchar(50);comment:收货人姓名;NOT NULL" json:"addressee"`
DistrictIds string `gorm:"column:district_ids;type:varchar(255);comment:地区IDS;NOT NULL" json:"district_ids"`
PayType uint8 `gorm:"column:pay_type;type:tinyint(1);default:1;comment:支付类型,1为微信,2为支付宝,3为余额支付" json:"pay_type"`
DeliverStatus uint8 `gorm:"column:deliver_status;type:tinyint(1);default:2;comment:发货状态,1为已签收,2为待发货,3为发货中,4为已发货" json:"deliver_status"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:2;comment:支付状态,1为已支付,2为未支付,3为支付中,4支付失败,5已失效;NOT NULL" json:"status"`
VerifyStatus uint8 `gorm:"column:verify_status;type:tinyint(1);default:0;comment:审核状态,1为通过,2为失败,3为待审核,0为正常订单不需要审核" json:"verify_status"`
ProductIds string `gorm:"column:product_ids;type:varchar(150);comment:产品IDs" json:"product_ids"`
}
type OrderImitateItems struct {
OrderImitateInfo
ProductItems []OrderProducts `gorm:"-" json:"product_items"`
}
type OrderDownInfo struct {
Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
OrderSn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
StoreId int `gorm:"column:store_id;type:int(11);comment:美容院关联ID号" json:"store_id"`
StoreName string `gorm:"column:store_name;type:varchar(50);comment:门店名" json:"store_name"`
SaleName string `gorm:"column:sale_name;type:varchar(50);comment:销售姓名" json:"sale_name"`
UserId int `gorm:"column:user_id;type:int(11);comment:用户ID" json:"user_id"`
UserName string `gorm:"column:user_name;type:varchar(255);comment:用户名" json:"user_name"`
SaleId int `gorm:"column:sale_id;type:int(11);comment:销售员ID号" json:"sale_id"`
Mobile string `gorm:"column:mobile;type:char(60);comment:收货人手机号;NOT NULL" json:"mobile"`
Address string `gorm:"column:address;type:varchar(255);comment:收货人地址;NOT NULL" json:"address"`
Addressee string `gorm:"column:addressee;type:varchar(50);comment:收货人姓名;NOT NULL" json:"addressee"`
DistrictIds string `gorm:"column:district_ids;type:varchar(255);comment:地区IDS;NOT NULL" json:"district_ids"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:2;comment:支付状态,1为已支付,2为未支付,3为支付中,4支付失败,5已失效;NOT NULL" json:"status"`
ProductIds string `gorm:"column:product_ids;type:varchar(150);comment:产品IDs" json:"product_ids"`
CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP;comment:订单创建时间" json:"create_time"`
CreateDate string `gorm:"-" json:"create_date"`
ProductName string `gorm:"-" json:"product_name"`
ProductNumber int `gorm:"-" json:"product_number"`
StoreBusinessLicense string `gorm:"-" json:"store_business_license"`
}
type OrderTaskAndAwardMonth struct {
TaskAwardMonthStatus uint8 `gorm:"column:task_award_month_status;type:tinyint(1);default:2;comment:结算任务与奖励月,1 为已结算,2为未结算" json:"task_awark_month_status"`
}
type OrderTaskAndAwardQuarter struct {
TaskAwardQuarterStatus uint8 `gorm:"column:task_award_quarter_status;type:tinyint(1);default:2;comment:结算任务与奖励季度,1 为已结算,2为未结算" json:"task_awark_quarter_status"`
}
type OrderTaskAndAwardHalfYear struct {
TaskAwardHalfYearStatus uint8 `gorm:"column:task_award_half_year_status;type:tinyint(1);default:2;comment:结算任务与奖励半年,1 为已结算,2为未结算" json:"task_awark_half_year_status"`
}
type OrderTaskAndAwardYear struct {
TaskAwardYearStatus uint8 `gorm:"column:task_award_year_status;type:tinyint(1);default:2;comment:结算任务与奖励年,1 为已结算,2为未结算" json:"task_awark_year_status"`
}
@@ -0,0 +1,44 @@
package dao
import "lone-services/pkg/utils"
type OrderProductCreate struct {
Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
Ordersn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
ProductId int `gorm:"column:product_id;type:int(11);comment:产品ID;NOT NULL" json:"product_id"`
ProductName string `gorm:"column:product_name;type:varchar(255);comment:产品名;NOT NULL" json:"product_name"`
Price float64 `gorm:"column:price;type:decimal(10,2);comment:产品单价格;NOT NULL" json:"price"`
Number int `gorm:"column:number;type:int(11);default:0;comment:购买的数量;NOT NULL" json:"number"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态:1为正常,2为已推货" json:"status"`
ReturnNumber int `gorm:"column:return_number;type:int(11);default:0;comment:退货数量" json:"return_number"`
}
type OrderProductInfo struct {
Id int64 `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
Ordersn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
ProductId int `gorm:"column:product_id;type:int(11);comment:产品ID;NOT NULL" json:"product_id"`
ProductName string `gorm:"column:product_name;type:varchar(255);comment:产品名;NOT NULL" json:"product_name"`
Price float64 `gorm:"column:price;type:decimal(10,2);comment:产品单价格;NOT NULL" json:"price"`
Number int `gorm:"column:number;type:int(11);default:0;comment:购买的数量;NOT NULL" json:"number"`
Status uint8 `gorm:"column:status;type:tinyint(1);default:1;comment:状态:1为正常,2为已推货" json:"status"`
ReturnNumber int `gorm:"column:return_number;type:int(11);default:0;comment:退货数量" json:"return_number"`
CreateType uint8 `gorm:"column:create_type;type:tinyint(1);default:1;comment:下单人类型,1为销售,2为门店,3为个人;NOT NULL" json:"create_type"`
CreateTime utils.CustomTime `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP;comment:订单创建时间" json:"create_time"`
}
type OrderProductPay struct {
ProductId int `gorm:"column:product_id;type:int(11);comment:产品ID;NOT NULL" json:"product_id"`
Number int `gorm:"column:number;type:int(11);default:0;comment:购买的数量;NOT NULL" json:"number"`
ProductName string `gorm:"column:product_name;type:varchar(255);comment:产品名;NOT NULL" json:"product_name"`
Type uint8 `gorm:"-" json:"type"`
Price float64 `gorm:"column:price;type:decimal(10,2);comment:产品单价格;NOT NULL" json:"price"`
}
type OrderProducts struct {
Id int `gorm:"column:id;type:bigint(20);primary_key;AUTO_INCREMENT" json:"id"`
OrderSn string `gorm:"column:ordersn;type:varchar(100);comment:订单号;NOT NULL" json:"ordersn"`
ProductId int `gorm:"column:product_id;type:int(11);comment:产品ID;NOT NULL" json:"product_id"`
ProductName string `gorm:"column:product_name;type:varchar(255);comment:产品名;NOT NULL" json:"product_name"`
Price float32 `gorm:"column:price;type:decimal(10,2);comment:产品单价格;NOT NULL" json:"price"`
Number int `gorm:"column:number;type:int(11);default:0;comment:购买的数量;NOT NULL" json:"number"`
}