This commit is contained in:
li 2022-05-18 14:28:00 +08:00
parent 3670b91603
commit ceea1518e0
2 changed files with 62 additions and 12 deletions

View File

@ -164,6 +164,26 @@ func InitDBProd() {
//&UserAttendance{},
//&UserAttendanceRecord{},
&Store{},
&GameCard{},
&GameCardGoods{},
&GameCardGoodsStock{},
&User{},
&Order{},
&OrderCard{},
&OperationLog{},
&CooperativeBusiness{},
&CooperativeMemberDeduct{},
&CooperativeAssistantMemberDeduct{},
&CooperativeMemberPromotion{},
&CooperativeMemberPromotionStore{},
&CooperativeMemberPromotionDay{},
&CooperativeMemberPromotionStoreDay{},
&InviteMemberReport{},
&CooperativeDeductSettle{},
&XcxRole{},
)
if err := DBProd.DB().Ping(); err != nil {
@ -1165,3 +1185,33 @@ func TestAddCooperativeMemberPromotion(t *testing.T) {
DB = DBDev
AddCooperativeMemberPromotion(4, 20, 68608411, 2)
}
func TestUpdateCooperativeBusiness(t *testing.T) {
//InitTestDB()
//DB = DBDev
InitDBProd()
DB = DBProd
//var list []GameCardGoods
//err := DB.Table("game_card").Find(&list).Error
//if err != nil {
// fmt.Println("err:", err)
//}
//storeMap := GetAllStoreMap()
chendu := []uint32{15, 17, 20, 21}
chongqin := []uint32{12, 16}
diwei := []uint32{13, 14, 18, 19, 23, 24, 25}
DB.Table("user").Where("store_id in (?)", chendu).Updates(map[string]interface{}{
"cooperative_business_id": 2,
"cooperative_name": "成都合作商",
})
DB.Table("user").Where("store_id in (?)", chongqin).Updates(map[string]interface{}{
"cooperative_business_id": 3,
"cooperative_name": "重庆合作商",
})
DB.Table("user").Where("store_id in (?)", diwei).Updates(map[string]interface{}{
"cooperative_business_id": 1,
"cooperative_name": "迪为合作商",
})
}

View File

@ -277,18 +277,18 @@ const (
// gen:qs
type OperationLog struct {
Model
Uid uint32 `json:"uid" gorm:"index"` // 店员id
Description string `json:"description"` // 描述
OperationType string `json:"operation_type" gorm:"index"` // 操作类型
CorrelationId uint32 `json:"correlation_id" gorm:"index"` // 关联id
CorrelationName string `json:"correlation_name" gorm:"index"` // 关联name
StoreId uint32 `json:"store_id" gorm:"index"` // 门店id
StoreName string `json:"store_name"` // 门店名称
CooperativeName string `json:"cooperative_name"` // 合作商名称
CooperativeBusinessId uint32 `json:"cooperative_business_id"` // 合作商id
SerialNumber string `json:"serial_number" gorm:"index"` // 卡编号
Detail string `json:"detail"` // 详情
Remark string `json:"remark"` // 备注
Uid uint32 `json:"uid" gorm:"index"` // 店员id
Description string `json:"description"` // 描述
OperationType string `json:"operation_type" gorm:"index"` // 操作类型
CorrelationId uint32 `json:"correlation_id" gorm:"index"` // 关联id
CorrelationName string `json:"correlation_name" gorm:"index"` // 关联name
StoreId uint32 `json:"store_id" gorm:"index"` // 门店id
StoreName string `json:"store_name"` // 门店名称
CooperativeName string `json:"cooperative_name"` // 合作商名称
CooperativeBusinessId uint32 `json:"cooperative_business_id" gorm:"index"` // 合作商id
SerialNumber string `json:"serial_number" gorm:"index"` // 卡编号
Detail string `json:"detail"` // 详情
Remark string `json:"remark"` // 备注
}
func (m *UserOpenMemberRecord) OrderRefund(outTradeNo string) error {