WH01243 пре 4 година
родитељ
комит
053b65be63

+ 2 - 0
api/internal/logic/activitylotterychecklogic.go

@@ -51,12 +51,14 @@ func (l *ActivityLotteryCheckLogic) ActivityLotteryCheck(req types.Request) (*ty
 			productJson.WxPage = value.WxPage
 			productJson.PcPage = value.PcPage
 			productJson.ProductCode=value.ProductCode
+			productJson.ParentCode=value.ParentCode
 			userLottery.UseProductList=append(userLottery.UseProductList,productJson)
 		}
 		//userLottery.UseProductList = value.UseProductList
 		userLottery.StockNumber=value.StockNumber
 		userLottery.ReceiveNumber=value.ReceiveNumber
 		userLottery.Instructions=value.Instructions
+		userLottery.LotteryType=value.LotteryType
 		userLottery.ValidityDates=value.ValidityDates
 		userLottery.ValidityTimeType=value.ValidityTimeType
 		userLottery.Full=value.Full

+ 2 - 0
api/internal/logic/lotteryinfochecklogic.go

@@ -49,10 +49,12 @@ func (l *LotteryInfoCheckLogic) LotteryInfoCheck(req types.Request) (*types.Lott
 		productJson.WxPage = value.WxPage
 		productJson.PcPage = value.PcPage
 		productJson.ProductCode=value.ProductCode
+		productJson.ParentCode=value.ParentCode
 		userLottery.UseProductList=append(userLottery.UseProductList,productJson)
 	}
 	userLottery.Instructions = data.Instructions
 	userLottery.Remark = data.Remark
+	userLottery.LotteryType=data.LotteryType
 	userLottery.LotteryId = data.LotteryId
 	userLottery.UseDate = data.UseDate
 	result.Code=resp.Code

+ 3 - 0
api/internal/logic/userlotterychecklogic.go

@@ -51,9 +51,12 @@ func (l *UserLotteryCheckLogic) UserLotteryCheck(req types.Request) (*types.Acti
 			productJson.WxPage = value.WxPage
 			productJson.PcPage = value.PcPage
 			productJson.ProductCode=value.ProductCode
+			productJson.ParentCode=value.ParentCode
 			userLottery.UseProductList=append(userLottery.UseProductList,productJson)
 		}
 		//userLottery.UseProductList = value.UseProductList
+		userLottery.LotteryType=value.LotteryType
+		userLottery.PrizeType=value.PrizeType
 		userLottery.UserLotteryId = value.UserLotteryId
 		userLottery.UseDate = value.UseDate
 		userLottery.Instructions=value.Instructions

+ 19 - 16
api/internal/types/types.go

@@ -45,22 +45,24 @@ type ActivityLotteryResp struct {
 }
 
 type LotteryJson struct {
-	LotteryId        int64         `form:"lotteryId"`        //奖券Id
-	LotteryName      string        `form:"lotteryName"`      //奖券名字
-	LotteryBeginDate string        `form:"lotteryBeginDate"` //活动时间起
-	LotteryendDate   string        `form:"lotteryendDate"`   //活动时间止
-	IsReceive        bool          `form:"isReceive"`        //是否领取
-	UseProductList   []ProductJson `form:"useProductList"`   //使用商品列表
-	Full             int64         `form:"full"`             //满多少
-	Reduce           int64         `form:"reduce"`           //减多少
-	Instructions     string        `form:"instructions"`     //使用说明
-	Remark           string        `form:"remark"`           //备注
-	UserLotteryId    int64         `form:"userLotteryId"`    //用户奖券标识
-	UseDate          string        `form:"useDate"`          //使用时间
-	StockNumber      int64         `form:"stockNumber"`      //库存数
-	ReceiveNumber    int64         `form:"receiveNumber"`    //领取数
-	ValidityDates    int64         `form:"validityDates"`    //有效天数
-	ValidityTimeType int64         `form:"validityTimeType"` //有效时间类型0、有起止时间1、当天起几天可用2、次日起几天可用
+	LotteryId        int64         `form:"lotteryId"`                                         //奖券Id
+	LotteryName      string        `form:"lotteryName"`                                       //奖券名字
+	LotteryBeginDate string        `form:"lotteryBeginDate"`                                  //活动时间起
+	LotteryendDate   string        `form:"lotteryendDate"`                                    //活动时间止
+	IsReceive        bool          `form:"isReceive"`                                         //是否领取
+	UseProductList   []ProductJson `form:"useProductList"`                                    //使用商品列表
+	Full             int64         `form:"full"`                                              //满多少
+	Reduce           int64         `form:"reduce"`                                            //减多少
+	Instructions     string        `form:"instructions"`                                      //使用说明
+	Remark           string        `form:"remark"`                                            //备注
+	UserLotteryId    int64         `form:"userLotteryId"`                                     //用户奖券标识
+	UseDate          string        `form:"useDate"`                                           //使用时间
+	StockNumber      int64         `form:"stockNumber"`                                       //库存数
+	ReceiveNumber    int64         `form:"receiveNumber"`                                     //领取数
+	ValidityDates    int64         `form:"validityDates"`                                     //有效天数
+	ValidityTimeType int64         `form:"validityTimeType"`                                  //有效时间类型0、有起止时间1、当天起几天可用2、次日起几天可用
+	PrizeType        int64         `xorm:"prizeType" form:"prizeType" json:"prizeType"`       //0未使用1已使用2已过期3待使用
+	LotteryType      int64         `xorm:"lotteryType" form:"lotteryType" json:"lotteryType"` //0、满减1折扣券2、实物
 }
 
 type ActivityJson struct {
@@ -77,6 +79,7 @@ type ProductJson struct {
 	WxPage      string `xorm:"wxPage" form:"wxPage" json:"wxPage"`                //wx端产品推广页地址
 	AppPage     string `xorm:"appPage" form:"appPage" json:"appPage"`             //app端产品推广页地址
 	Describe    string `xorm:"describe" form:"describe" json:"describe"`          //描述
+	ParentCode  int64  `xorm:"parentCode" form:"parentCode" json:"parentCode"`
 }
 
 type LotteryResp struct {

+ 32 - 28
entity/activity.go

@@ -43,22 +43,24 @@ type Lottery struct {
 
 //活动奖券数量
 type LotteryJson struct {
-	LotteryId        int64  `xorm:"lotteryId" form:"lotteryId" json:"lotteryId"`                      //奖品Id
-	Instructions     string `xorm:"instructions" form:"instructions" json:"instructions"`             //使用说明
-	Remark           string `xorm:"remark" form:"remark" json:"remark"`                               //备注
-	IsLimitNumber    int    `xorm:"isLimitNumber" form:"isLimitNumber" json:"isLimitNumber"`          //是否限制0限制1不限制
-	LimitNumber      int    `xorm:"limitNumber" form:"limitNumber" json:"limitNumber"`                //领取次数
-	ValidityDates    int    `xorm:"validityDates" form:"validityDates" json:"validityDates"`          //有效天数
-	ValidityTimeType int    `xorm:"validityTimeType" form:"validityTimeType" json:"validityTimeType"` //有效时间类型0、有起止时间1、当天起几天可用2、次日起几天可用
-	Name             string `xorm:"name" form:"name" json:"name"`                                     //奖券名字
-	Count            int64  `xorm:"count" form:"count" json:"reduce"`                                 //领取次数
+	LotteryId        int64         `xorm:"lotteryId" form:"lotteryId" json:"lotteryId"`                      //奖品Id
+	Instructions     string        `xorm:"instructions" form:"instructions" json:"instructions"`             //使用说明
+	Remark           string        `xorm:"remark" form:"remark" json:"remark"`                               //备注
+	IsLimitNumber    int           `xorm:"isLimitNumber" form:"isLimitNumber" json:"isLimitNumber"`          //是否限制0限制1不限制
+	LimitNumber      int           `xorm:"limitNumber" form:"limitNumber" json:"limitNumber"`                //领取次数
+	ValidityDates    int           `xorm:"validityDates" form:"validityDates" json:"validityDates"`          //有效天数
+	ValidityTimeType int           `xorm:"validityTimeType" form:"validityTimeType" json:"validityTimeType"` //有效时间类型0、有起止时间1、当天起几天可用2、次日起几天可用
+	Name             string        `xorm:"name" form:"name" json:"name"`                                     //奖券名字
+	Count            int64         `xorm:"count" form:"count" json:"reduce"`                                 //领取次数
 	UseProductList   []ProductJson `xorm:"useProductList" form:"useProductList" json:"useProductList"`       //使用商品列表
-	StockNumber      int64  `xorm:"stockNumber" form:"stockNumber" json:"stockNumber"`                //库存
-	ReceiveNumber    int64  `xorm:"receiveNumber" form:"receiveNumber" json:"receiveNumber"`          //领取数量
-	BeginDate        string `xorm:"beginDate" form:"beginDate" json:"beginDate"`                      //有效期起
-	EndDate          string `xorm:"endDate" form:"endDate" json:"endDate"`                            //有效期止
-	Full             int64  `xorm:"full" form:"full" json:"full"`                                     //满多少
-	Reduce           int64  `xorm:"reduce" form:"reduce" json:"reduce"`                               //减多少
+	StockNumber      int64         `xorm:"stockNumber" form:"stockNumber" json:"stockNumber"`                //库存
+	ReceiveNumber    int64         `xorm:"receiveNumber" form:"receiveNumber" json:"receiveNumber"`          //领取数量
+	BeginDate        string        `xorm:"beginDate" form:"beginDate" json:"beginDate"`                      //有效期起
+	EndDate          string        `xorm:"endDate" form:"endDate" json:"endDate"`                            //有效期止
+	Full             int64         `xorm:"full" form:"full" json:"full"`                                     //满多少
+	Reduce           int64         `xorm:"reduce" form:"reduce" json:"reduce"`                               //减多少
+	PrizeType        int64         `xorm:"prizeType" form:"prizeType" json:"prizeType"`                      //0未使用1已使用2已过期3待使用
+	LotteryType      int64         `xorm:"lotteryType" form:"lotteryType" json:"lotteryType"`                //0、满减1折扣券2、实物
 }
 
 //用户奖券信息
@@ -83,19 +85,20 @@ type UserPrize struct {
 
 //用户奖券返回信息
 type UserPrizeJson struct {
-	Id             int64       `xorm:"pk autoincr id" form:"id" json:"id"`
-	BeginDate      string      `xorm:"beginDate" form:"beginDate" json:"beginDate"`                //有效期起
-	EndDate        string      `xorm:"endDate" form:"endDate" json:"endDate"`                      //有效期止
-	UseDate        time.Time   `xorm:"useDate" form:"useDate" json:"useDate"`                      //使用时间
-	CreateTime     time.Time   `xorm:"createTime" form:"createTime" json:"createTime"`             //创建时间
-	PrizeType      int         `xorm:"prizeType" form:"prizeType" json:"prizeType"`                //0未使用1已使用2已过期
-	LotteryId      int64       `xorm:"lotteryId" form:"lotteryId" json:"lotteryId"`                //奖券标识
-	Name           string      `xorm:"name" form:"name" json:"name"`                               //奖券名字
-	Full           int64       `xorm:"full" form:"full" json:"full"`                               //满多少
-	Reduce         int64       `xorm:"reduce" form:"reduce" json:"reduce"`                         //减多少
+	Id             int64         `xorm:"pk autoincr id" form:"id" json:"id"`
+	BeginDate      string        `xorm:"beginDate" form:"beginDate" json:"beginDate"`                //有效期起
+	EndDate        string        `xorm:"endDate" form:"endDate" json:"endDate"`                      //有效期止
+	UseDate        time.Time     `xorm:"useDate" form:"useDate" json:"useDate"`                      //使用时间
+	CreateTime     time.Time     `xorm:"createTime" form:"createTime" json:"createTime"`             //创建时间
+	PrizeType      int64           `xorm:"prizeType" form:"prizeType" json:"prizeType"`                //0未使用1已使用2已过期
+	LotteryId      int64         `xorm:"lotteryId" form:"lotteryId" json:"lotteryId"`                //奖券标识
+	Name           string        `xorm:"name" form:"name" json:"name"`                               //奖券名字
+	Full           int64         `xorm:"full" form:"full" json:"full"`                               //满多少
+	Reduce         int64         `xorm:"reduce" form:"reduce" json:"reduce"`                         //减多少
 	UseProductList []ProductJson `xorm:"useProductList" form:"useProductList" json:"useProductList"` //使用商品列表
-	Instructions   string      `xorm:"instructions" form:"instructions" json:"instructions"`       //使用说明
-	Remark         string      `xorm:"remark" form:"remark" json:"remark"`                         //备注
+	Instructions   string        `xorm:"instructions" form:"instructions" json:"instructions"`       //使用说明
+	Remark         string        `xorm:"remark" form:"remark" json:"remark"`                         //备注
+	LotteryType    int64         `xorm:"lotteryType" form:"lotteryType" json:"lotteryType"`          //0、满减1折扣券2、实物
 }
 type Activity struct {
 	ActivityId     string    `xorm:"activityId" form:"activityId" json:"activityId"`                 //活动ID
@@ -119,5 +122,6 @@ type ProductJson struct {
 	WxPage      string `xorm:"wxPage" form:"wxPage" json:"wxPage"`                //wx端产品推广页地址
 	AppPage     string `xorm:"appPage" form:"appPage" json:"appPage"`             //app端产品推广页地址
 	Describe    string `xorm:"describe" form:"describe" json:"describe"`          //描述
-	ProductCode int64 `xorm:"productCode" form:"productCode" json:"productCode"` //产品编号
+	ProductCode int64  `xorm:"productCode" form:"productCode" json:"productCode"` //产品编号
+	ParentCode  int64  `xorm:"parentCode" form:"parentCode" json:"parentCode"`
 }

+ 3 - 0
rpc/activity.proto

@@ -60,6 +60,8 @@ message LotteryJson{
       int64   stockNumber=15;//库存数
       int64   receiveNumber=16;//领取数
       int64   validityDates=17;//有效天数
+      int64   prizeType=18;//0未使用1已使用2已过期3待使用
+      int64  lotteryType=19;//0、满减1折扣券2、实物
 }
 message ActivityJson{
       string  activityName=1;//活动名字
@@ -74,6 +76,7 @@ message ProductJson{
       string  appPage=4;//app端产品推广页地址
       string  describe=5;//描述
       int64   productCode=6;//产品编号
+      int64   parentCode=7;//一级产品Id
 }
 //活动下的奖券信息
 message LotteryResp {

+ 34 - 4
rpc/activity/activity.pb.go

@@ -463,6 +463,8 @@ type LotteryJson struct {
 	StockNumber      int64          `protobuf:"varint,15,opt,name=stockNumber,proto3" json:"stockNumber,omitempty"`          //库存数
 	ReceiveNumber    int64          `protobuf:"varint,16,opt,name=receiveNumber,proto3" json:"receiveNumber,omitempty"`      //领取数
 	ValidityDates    int64          `protobuf:"varint,17,opt,name=validityDates,proto3" json:"validityDates,omitempty"`      //有效天数
+	PrizeType        int64          `protobuf:"varint,18,opt,name=prizeType,proto3" json:"prizeType,omitempty"`              //0未使用1已使用2已过期3待使用
+	LotteryType      int64          `protobuf:"varint,19,opt,name=lotteryType,proto3" json:"lotteryType,omitempty"`          //0、满减1折扣券2、实物
 }
 
 func (x *LotteryJson) Reset() {
@@ -616,6 +618,20 @@ func (x *LotteryJson) GetValidityDates() int64 {
 	return 0
 }
 
+func (x *LotteryJson) GetPrizeType() int64 {
+	if x != nil {
+		return x.PrizeType
+	}
+	return 0
+}
+
+func (x *LotteryJson) GetLotteryType() int64 {
+	if x != nil {
+		return x.LotteryType
+	}
+	return 0
+}
+
 type ActivityJson struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -698,6 +714,7 @@ type ProductJson struct {
 	AppPage     string `protobuf:"bytes,4,opt,name=appPage,proto3" json:"appPage,omitempty"`          //app端产品推广页地址
 	Describe    string `protobuf:"bytes,5,opt,name=describe,proto3" json:"describe,omitempty"`        //描述
 	ProductCode int64  `protobuf:"varint,6,opt,name=productCode,proto3" json:"productCode,omitempty"` //产品编号
+	ParentCode  int64  `protobuf:"varint,7,opt,name=parentCode,proto3" json:"parentCode,omitempty"`   //一级产品Id
 }
 
 func (x *ProductJson) Reset() {
@@ -774,6 +791,13 @@ func (x *ProductJson) GetProductCode() int64 {
 	return 0
 }
 
+func (x *ProductJson) GetParentCode() int64 {
+	if x != nil {
+		return x.ParentCode
+	}
+	return 0
+}
+
 //活动下的奖券信息
 type LotteryResp struct {
 	state         protoimpl.MessageState
@@ -896,7 +920,7 @@ var file_activity_proto_rawDesc = []byte{
 	0x73, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x63, 0x74, 0x69,
 	0x76, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4a, 0x73, 0x6f,
 	0x6e, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x22,
-	0xe0, 0x04, 0x0a, 0x0b, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x12,
+	0xa0, 0x05, 0x0a, 0x0b, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x12,
 	0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
 	0x28, 0x03, 0x52, 0x09, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x64, 0x12, 0x20, 0x0a,
 	0x0b, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
@@ -934,7 +958,11 @@ var file_activity_proto_rawDesc = []byte{
 	0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d,
 	0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x65, 0x73, 0x18, 0x11, 0x20,
 	0x01, 0x28, 0x03, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74,
-	0x65, 0x73, 0x22, 0xae, 0x01, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4a,
+	0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18,
+	0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x54, 0x79, 0x70, 0x65,
+	0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x18,
+	0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x54, 0x79,
+	0x70, 0x65, 0x22, 0xae, 0x01, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4a,
 	0x73, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4e,
 	0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76,
 	0x69, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76,
@@ -945,7 +973,7 @@ var file_activity_proto_rawDesc = []byte{
 	0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12,
 	0x22, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x65, 0x73, 0x63, 0x18,
 	0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44,
-	0x65, 0x73, 0x63, 0x22, 0xb7, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4a,
+	0x65, 0x73, 0x63, 0x22, 0xd7, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4a,
 	0x73, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61,
 	0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,
 	0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x63, 0x50, 0x61, 0x67, 0x65, 0x18,
@@ -956,7 +984,9 @@ var file_activity_proto_rawDesc = []byte{
 	0x1a, 0x0a, 0x08, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
 	0x09, 0x52, 0x08, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70,
 	0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x66, 0x0a,
+	0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a,
+	0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x66, 0x0a,
 	0x0b, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04,
 	0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65,
 	0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,

+ 5 - 5
rpc/activityclient/activity.go

@@ -14,15 +14,15 @@ import (
 )
 
 type (
-	UpdateStateReq      = activity.UpdateStateReq
-	ActivityLotteryResp = activity.ActivityLotteryResp
 	Request             = activity.Request
+	LotteryOperation    = activity.LotteryOperation
 	Response            = activity.Response
-	LotteryJson         = activity.LotteryJson
-	ActivityJson        = activity.ActivityJson
+	ActivityLotteryResp = activity.ActivityLotteryResp
 	ProductJson         = activity.ProductJson
 	LotteryResp         = activity.LotteryResp
-	LotteryOperation    = activity.LotteryOperation
+	UpdateStateReq      = activity.UpdateStateReq
+	LotteryJson         = activity.LotteryJson
+	ActivityJson        = activity.ActivityJson
 
 	Activity interface {
 		// 查询活动下的奖券

+ 2 - 0
rpc/internal/logic/activitylotterylogic.go

@@ -44,8 +44,10 @@ func (l *ActivityLotteryLogic) ActivityLottery(in *activity.Request) (*activity.
 			productJson.WxPage = value.WxPage
 			productJson.PcPage = value.PcPage
 			productJson.ProductCode=value.ProductCode
+			productJson.ParentCode=value.ParentCode
 			userLottery.UseProductList=append(userLottery.UseProductList,&productJson)
 		}
+		userLottery.LotteryType=value.LotteryType
 		userLottery.Instructions=value.Instructions
 		userLottery.StockNumber=value.StockNumber
 		userLottery.ReceiveNumber=value.ReceiveNumber

+ 2 - 0
rpc/internal/logic/lotteryinfologic.go

@@ -40,9 +40,11 @@ func (l *LotteryInfoLogic) LotteryInfo(in *activity.Request) (*activity.LotteryR
 		productJson.ProductName = value.ProductName
 		productJson.WxPage = value.WxPage
 		productJson.PcPage = value.PcPage
+		productJson.ParentCode=value.ParentCode
 		productJson.ProductCode=value.ProductCode
 		userLottery.UseProductList=append(userLottery.UseProductList,&productJson)
 	}
+	userLottery.LotteryType=data.LotteryType
 	userLottery.UserLotteryId = data.Id
 	userLottery.Instructions = data.Instructions
 	userLottery.Remark = data.Remark

+ 3 - 0
rpc/internal/logic/userlotterylogic.go

@@ -44,8 +44,11 @@ func (l *UserLotteryLogic) UserLottery(in *activity.Request) (*activity.Activity
 			productJson.WxPage = value.WxPage
 			productJson.PcPage = value.PcPage
 			productJson.ProductCode=value.ProductCode
+			productJson.ParentCode=value.ParentCode
 			userLottery.UseProductList=append(userLottery.UseProductList,&productJson)
 		}
+		userLottery.PrizeType=value.PrizeType
+		userLottery.LotteryType=value.LotteryType
 		userLottery.UserLotteryId=value.Id
 		userLottery.Instructions=value.Instructions
 		userLottery.Remark=value.Remark

+ 7 - 7
service/ActivityService.go

@@ -184,7 +184,7 @@ func (service *ActivityService) ActivityLottery(in *activity.Request) (int64, st
 	//2、先查找活动下的奖品Id
 	lotteryJsonList := []entity.LotteryJson{}
 	err = orm.Table("activity").Alias("a").
-		Select("	l.full,l.reduce, p.beginDate,p.endDate,l.stockNumber,l.receiveNumber,p.limitNumber,( select  count(up.id) FROM user_prize up where  up.lotteryId = l.id AND up.userId ='"+in.UserId+"' ) AS count,p.isLimitNumber,p.validityTimeType,p.validityDates,p.instructions,p.remark,l.id as lotteryId ,l.name ").
+		Select("p.prizeType as lotteryType,l.full,l.reduce, p.beginDate,p.endDate,l.stockNumber,l.receiveNumber,p.limitNumber,( select  count(up.id) FROM user_prize up where  up.lotteryId = l.id AND up.userId ='"+in.UserId+"' ) AS count,p.isLimitNumber,p.validityTimeType,p.validityDates,p.instructions,p.remark,l.id as lotteryId ,l.name ").
 		Join("left", "prize p", " a.prizeId = p.Id").
 		Join("left", "lottery l", " l.prizeId = p.id ").
 		Where("a.id = ?  and a.appId=? ", in.ActivityId, in.AppId).Find(&lotteryJsonList)
@@ -223,7 +223,7 @@ func (service *ActivityService) UserLottery(data *activity.Request) (int64, stri
 		} else {
 			condition = " up.prizeType=0 and up.beginDate<='" + nowStr + "'"
 		}
-		count, err = orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark").
+		count, err = orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark,p.prizeType as lotteryType").
 			Join("left", "activity a ", "a.prizeId=up.prizeId").
 			Join("left", "prize p ", "a.prizeId=p.Id").
 			Where("up.userId=? and  up.appId=? and  up.endDate>=?", data.UserId, data.AppId, nowStr).
@@ -232,7 +232,7 @@ func (service *ActivityService) UserLottery(data *activity.Request) (int64, stri
 			FindAndCount(&userLettryList)
 	case 0:
 		//查看名下所有奖券
-		count, err = orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark").
+		count, err = orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark,p.prizeType as lotteryType").
 			Join("left", "activity a ", "a.prizeId=up.prizeId").
 			Join("left", "prize p ", "a.prizeId=p.Id").
 			Where("up.userId=? and  up.appId=?", data.UserId, data.AppId).Desc("up.createTime").
@@ -240,7 +240,7 @@ func (service *ActivityService) UserLottery(data *activity.Request) (int64, stri
 			FindAndCount(&userLettryList)
 	case 2:
 		//过期的奖券
-		count, err = orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark").
+		count, err = orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark,p.prizeType as lotteryType").
 			Join("left", "activity a ", "a.prizeId=up.prizeId").
 			Join("left", "prize p ", "a.prizeId=p.Id").
 			Where("up.userId=? and  up.appId=? ", data.UserId, data.AppId ).
@@ -249,7 +249,7 @@ func (service *ActivityService) UserLottery(data *activity.Request) (int64, stri
 			FindAndCount(&userLettryList)
 	case 3:
 		//已用的奖券
-		count, err = orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark").
+		count, err = orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark,p.prizeType as lotteryType").
 			Join("left", "activity a ", "a.prizeId=up.prizeId").
 			Join("left", "prize p ", "a.prizeId=p.Id").
 			Where("up.userId=? and  up.appId=? and (up.prizeType=1 or up.prizeType=3)", data.UserId, data.AppId, ).
@@ -258,7 +258,7 @@ func (service *ActivityService) UserLottery(data *activity.Request) (int64, stri
 
 	case 4:
 		//所有未使用奖券
-		count, err = orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark").
+		count, err = orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark,p.prizeType as lotteryType").
 			Join("left", "activity a ", "a.prizeId=up.prizeId").
 			Join("left", "prize p ", "a.prizeId=p.Id").
 			Where("up.userId=? and  up.appId=? and  up.endDate>=?", data.UserId, data.AppId, nowStr).
@@ -448,7 +448,7 @@ func (service *ActivityService)LotteryInfo(data *activity.Request) (int64, strin
 	orm := entity.Engine.NewSession()
 	userLettryList := []entity.UserPrizeJson{}
 	//已用的奖券
-	err := orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark").
+	err := orm.Table("user_prize").Alias("up").Select("up.*,p.instructions,p.remark,p.prizeType as lotteryType").
 	Join("left", "activity a ", "a.prizeId=up.prizeId").
 	Join("left", "prize p ", "a.prizeId=p.Id").
 	Where("up.userId=? and  up.appId=? and up.prizeType=0 and  up.lotteryId=?",data.UserId,data.AppId,data.LotteryId).