WH01243 hace 4 años
padre
commit
dbea53ea7e

+ 6 - 5
api/internal/logic/activitylotterychecklogic.go

@@ -50,15 +50,16 @@ func (l *ActivityLotteryCheckLogic) ActivityLotteryCheck(req types.Request) (*ty
 		userLottery.LotteryBeginDate=value.LotteryBeginDate
 		userLottery.LotteryendDate=value.LotteryendDate
 		userLottery.IsReceive=value.IsReceive
+		userLottery.IsUser=value.IsUser
 		for _, value := range value.UseProductList {
 			productJson:=types.ProductJson{}
 			productJson.AppPage = value.AppPage
 			productJson.ProductName = value.ProductName
 			productJson.WxPage = value.WxPage
 			productJson.PcPage = value.PcPage
-			productJson.ProductCode=value.ProductCode
-			productJson.ParentCode=value.ParentCode
-			productJson.Describe=value.Describe
+			//productJson.ProductCode=value.ProductCode
+			//productJson.ParentCode=value.ParentCode
+			//productJson.Describe=value.Describe
 			userLottery.UseProductList=append(userLottery.UseProductList,productJson)
 		}
 		//userLottery.UseProductList = value.UseProductList
@@ -66,8 +67,8 @@ func (l *ActivityLotteryCheckLogic) ActivityLotteryCheck(req types.Request) (*ty
 		userLottery.ReceiveNumber=value.ReceiveNumber
 		userLottery.Instructions=value.Instructions
 		userLottery.LotteryType=value.LotteryType
-		userLottery.ValidityDates=value.ValidityDates
-		userLottery.ValidityTimeType=value.ValidityTimeType
+		//userLottery.ValidityDates=value.ValidityDates
+		//userLottery.ValidityTimeType=value.ValidityTimeType
 		userLottery.Full=value.Full
 		userLottery.Reduce=value.Reduce
 		userLottery.Remark=value.Remark

+ 1 - 0
api/internal/types/types.go

@@ -64,6 +64,7 @@ type LotteryJson struct {
 	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、实物
+	IsUser			 bool          `form:"IsUser"`                                         //是否使用true使用false未使用
 }
 
 type ActivityJson struct {

+ 1 - 0
entity/activity.go

@@ -64,6 +64,7 @@ type LotteryJson struct {
 	Name             string        `xorm:"name" form:"name" json:"name"`                                     //奖券名字
 	Count            int64         `xorm:"count" form:"count" json:"count"`                                  //领取次数
 	DayCount         int64         `xorm:"dayCount" form:"dayCount" json:"dayCount"`                         //领取次数
+	UserCount        int64         `xorm:"UserCount" form:"UserCount" json:"UserCount"`                      //使用次数
 	UseProductList   []ProductJson `xorm:"useProductList" form:"useProductList" json:"useProductList"`       //使用商品列表
 	StockNumber      int64         `xorm:"stockNumber" form:"stockNumber" json:"stockNumber"`                //库存
 	ReceiveNumber    int64         `xorm:"receiveNumber" form:"receiveNumber" json:"receiveNumber"`          //领取数量

+ 2 - 1
rpc/activity.proto

@@ -61,7 +61,8 @@ message LotteryJson{
       int64   receiveNumber=16;//领取数
       int64   validityDates=17;//有效天数
       int64   prizeType=18;//0未使用1已使用2已过期3待使用
-      int64  lotteryType=19;//0、满减1折扣券2、实物
+      int64   lotteryType=19;//0、满减1折扣券2、实物
+      bool    isUser=20;//是否使用 true 使用 false未使用
 }
 message ActivityJson{
       string  activityName=1;//活动名字

+ 68 - 58
rpc/activity/activity.pb.go

@@ -465,6 +465,7 @@ type LotteryJson struct {
 	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、实物
+	IsUser           bool           `protobuf:"varint,20,opt,name=isUser,proto3" json:"isUser,omitempty"`                    //是否使用 true 使用 false未使用
 }
 
 func (x *LotteryJson) Reset() {
@@ -632,6 +633,13 @@ func (x *LotteryJson) GetLotteryType() int64 {
 	return 0
 }
 
+func (x *LotteryJson) GetIsUser() bool {
+	if x != nil {
+		return x.IsUser
+	}
+	return false
+}
+
 type ActivityJson struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -920,7 +928,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,
-	0xa0, 0x05, 0x0a, 0x0b, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x12,
+	0xb8, 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,
@@ -962,63 +970,65 @@ var file_activity_proto_rawDesc = []byte{
 	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,
-	0x69, 0x74, 0x79, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x42, 0x65, 0x67, 0x69,
-	0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
-	0x79, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f,
-	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, 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,
-	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x63, 0x50, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a,
-	0x06, 0x77, 0x78, 0x50, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77,
-	0x78, 0x50, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x50, 0x61, 0x67, 0x65,
-	0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x50, 0x61, 0x67, 0x65, 0x12,
-	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, 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,
-	0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x04, 0x64, 0x61,
-	0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76,
-	0x69, 0x74, 0x79, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x52,
-	0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x8e, 0x03, 0x0a, 0x08, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69,
-	0x74, 0x79, 0x12, 0x43, 0x0a, 0x0f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4c, 0x6f,
-	0x74, 0x74, 0x65, 0x72, 0x79, 0x12, 0x11, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79,
-	0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76,
-	0x69, 0x74, 0x79, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4c, 0x6f, 0x74, 0x74,
-	0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x0e, 0x6c, 0x6f, 0x74, 0x74, 0x65,
-	0x72, 0x79, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x12, 0x1a, 0x2e, 0x61, 0x63, 0x74, 0x69,
-	0x76, 0x69, 0x74, 0x79, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x72,
-	0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79,
-	0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x12, 0x6c, 0x6f, 0x74,
-	0x74, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12,
-	0x18, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
-	0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x69,
-	0x76, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a,
-	0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x55, 0x73, 0x65, 0x12, 0x1a, 0x2e, 0x61,
-	0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4f,
-	0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76,
-	0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0b,
-	0x75, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x12, 0x11, 0x2e, 0x61, 0x63,
-	0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d,
-	0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69,
-	0x74, 0x79, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a,
-	0x0b, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x11, 0x2e, 0x61,
-	0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
-	0x15, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65,
-	0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x55, 0x73, 0x65, 0x72, 0x18, 0x14, 0x20, 0x01,
+	0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x55, 0x73, 0x65, 0x72, 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, 0x69, 0x74, 0x79, 0x42, 0x65, 0x67, 0x69, 0x6e,
+	0x44, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x61, 0x63, 0x74, 0x69,
+	0x76, 0x69, 0x74, 0x79, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x28, 0x0a,
+	0x0f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65,
+	0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 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, 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, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70,
+	0x63, 0x50, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x78, 0x50, 0x61, 0x67, 0x65, 0x18,
+	0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x77, 0x78, 0x50, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a,
+	0x07, 0x61, 0x70, 0x70, 0x50, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
+	0x61, 0x70, 0x70, 0x50, 0x61, 0x67, 0x65, 0x12, 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, 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, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x12, 0x29, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
+	0x32, 0x15, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x4c, 0x6f, 0x74, 0x74,
+	0x65, 0x72, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x8e, 0x03,
+	0x0a, 0x08, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x43, 0x0a, 0x0f, 0x61, 0x63,
+	0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x12, 0x11, 0x2e,
+	0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+	0x1a, 0x1d, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x61, 0x63, 0x74, 0x69,
+	0x76, 0x69, 0x74, 0x79, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x40, 0x0a, 0x0e, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76,
+	0x65, 0x12, 0x1a, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x4c, 0x6f, 0x74,
+	0x74, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x12, 0x2e,
+	0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+	0x65, 0x12, 0x42, 0x0a, 0x12, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74,
+	0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69,
+	0x74, 0x79, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65,
+	0x71, 0x1a, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x73,
+	0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
+	0x79, 0x55, 0x73, 0x65, 0x12, 0x1a, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e,
+	0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+	0x1a, 0x12, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70,
+	0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x74, 0x74,
+	0x65, 0x72, 0x79, 0x12, 0x11, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e, 0x52,
+	0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74,
+	0x79, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72,
+	0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x37, 0x0a, 0x0b, 0x6c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79,
+	0x49, 0x6e, 0x66, 0x6f, 0x12, 0x11, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x2e,
+	0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69,
+	0x74, 0x79, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x62, 0x06,
+	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 4 - 4
rpc/activityclient/activity.go

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

+ 9 - 5
rpc/internal/logic/activitylotterylogic.go

@@ -41,15 +41,19 @@ func (l *ActivityLotteryLogic) ActivityLottery(in *activity.Request) (*activity.
 		}else{
 			userLottery.IsReceive=false
 		}
+		userLottery.IsUser=false
+		if(value.UserCount>0){
+			userLottery.IsUser=true
+		}
 		for _, value := range value.UseProductList {
 			productJson:=activity.ProductJson{}
 			productJson.AppPage = value.AppPage
 			productJson.ProductName = value.ProductName
 			productJson.WxPage = value.WxPage
 			productJson.PcPage = value.PcPage
-			productJson.ProductCode=value.ProductCode
-			productJson.ParentCode=value.ParentCode
-			productJson.Describe=value.Describe
+			//productJson.ProductCode=value.ProductCode
+			//productJson.ParentCode=value.ParentCode
+			//productJson.Describe=value.Describe
 			userLottery.UseProductList=append(userLottery.UseProductList,&productJson)
 		}
 		userLottery.LotteryType=value.LotteryType
@@ -58,8 +62,8 @@ func (l *ActivityLotteryLogic) ActivityLottery(in *activity.Request) (*activity.
 		userLottery.ReceiveNumber=value.ReceiveNumber
 		userLottery.LotteryBeginDate=value.BeginDate
 		userLottery.LotteryendDate=value.EndDate
-		userLottery.ValidityTimeType=int64(value.ValidityTimeType)
-		userLottery.ValidityDates=int64(value.ValidityDates)
+		//userLottery.ValidityTimeType=int64(value.ValidityTimeType)
+		//userLottery.ValidityDates=int64(value.ValidityDates)
 		userLottery.Full=value.Full
 		userLottery.Reduce=value.Reduce
 		userLottery.Remark=value.Remark

+ 1 - 1
service/ActivityService.go

@@ -205,7 +205,7 @@ func (service *ActivityService) ActivityLottery(in *activity.Request) (int64, st
 	//2、先查找活动下的奖品Id
 	lotteryJsonList := []entity.LotteryJson{}
 	err = orm.Table("activity").Alias("a").
-		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,( select  count(up.id) FROM user_prize up where  up.lotteryId = l.id AND up.userId ='"+in.UserId+"' and  to_days(createTime) = to_days(now())) AS daycount,p.isLimitNumber,p.validityTimeType,p.validityDates,p.instructions,p.remark,l.id as lotteryId ,l.name ").
+		Select("( SELECT count( up.id ) FROM user_prize up WHERE up.lotteryId = l.id AND up.userId = '123' and up.prizeType!=0 ) AS usercount,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,( select  count(up.id) FROM user_prize up where  up.lotteryId = l.id AND up.userId ='"+in.UserId+"' and  to_days(createTime) = to_days(now())) AS daycount,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)