|
@@ -25,7 +25,7 @@ import (
|
|
|
"github.com/shopspring/decimal"
|
|
|
)
|
|
|
|
|
|
-//资源包
|
|
|
+// 资源包
|
|
|
type commonOrderStruct struct {
|
|
|
}
|
|
|
|
|
@@ -88,15 +88,18 @@ func (this *commonOrderStruct) RequestCheck(product string, m map[string]interfa
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- param
|
|
|
- product:产品类型
|
|
|
- m:订单需要的参数
|
|
|
- lotteryId, discountId:优惠券相关
|
|
|
- sess:session
|
|
|
- activityType 活动类型 0满减、1折扣券、2满赠、3促销、4限时折扣、5限时减免 0、1才有券 2以后没券(虚假的券)
|
|
|
- return
|
|
|
- insertMap:创建订单的参数
|
|
|
- msg:错误信息
|
|
|
+param
|
|
|
+
|
|
|
+ product:产品类型
|
|
|
+ m:订单需要的参数
|
|
|
+ lotteryId, discountId:优惠券相关
|
|
|
+ sess:session
|
|
|
+ activityType 活动类型 0满减、1折扣券、2满赠、3促销、4限时折扣、5限时减免 0、1才有券 2以后没券(虚假的券)
|
|
|
+
|
|
|
+return
|
|
|
+
|
|
|
+ insertMap:创建订单的参数
|
|
|
+ msg:错误信息
|
|
|
*/
|
|
|
func (this *commonOrderStruct) InserMap(product, productId, userid, lotteryId, discountId string, m map[string]interface{}, session *httpsession.Session, activityType int) (orderinfo *OrderInfo, msg string) {
|
|
|
switch product {
|
|
@@ -240,7 +243,7 @@ func dataExportCheck(m map[string]interface{}, sess *httpsession.Session) string
|
|
|
return ""
|
|
|
}
|
|
|
|
|
|
-//历史数据
|
|
|
+// 历史数据
|
|
|
func dataExportOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
|
|
|
id := encrypt.SE.Decode4Hex(qu.ObjToString(m["id"]))
|
|
|
if id == "" {
|
|
@@ -309,7 +312,7 @@ func dataExportOrder(m map[string]interface{}, userId string) (*OrderInfo, strin
|
|
|
}
|
|
|
|
|
|
ordercode := pay.GetOrderCode(userId)
|
|
|
- download_url := util.GetExcelFilePath(ordercode)
|
|
|
+ download_url := util.GetExcelFilePath(ordercode, data_count)
|
|
|
go func() {
|
|
|
list, err := dataexport.GetDataExportSearchResultByScdId(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch, id, qu.If(data_spec == "高级字段包", "2", "1").(string), data_count)
|
|
|
if err == nil && list != nil && len(*list) > 0 {
|
|
@@ -359,7 +362,7 @@ func (this *commonOrderStruct) DataExportPhoneAndMailCheck(sess *httpsession.Ses
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//商机管理
|
|
|
+// 商机管理
|
|
|
func entnicheOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
|
|
|
if phone, _ := util.GetMyPhoneAndName(userId); phone == "" {
|
|
|
return nil, "未绑定手机号"
|
|
@@ -446,7 +449,7 @@ var EntnichePirce entnichePrice
|
|
|
|
|
|
type entnichePrice struct{}
|
|
|
|
|
|
-//商机管理计算价格
|
|
|
+// 商机管理计算价格
|
|
|
func (this *entnichePrice) GetOrderMoney(userId string, personnum, cycle int) int {
|
|
|
if personnum < 5 || cycle < 1 {
|
|
|
log.Println(userId, "商机管理订单personnum、cycle参数不合法", personnum, cycle)
|
|
@@ -478,7 +481,7 @@ func (this *entnichePrice) GetOrderMoney(userId string, personnum, cycle int) in
|
|
|
return order_money
|
|
|
}
|
|
|
|
|
|
-//获取解密后的企业id
|
|
|
+// 获取解密后的企业id
|
|
|
func DecodeEntId(encodeId string) int {
|
|
|
encodeId = strings.TrimSpace(encodeId)
|
|
|
if encodeId == "" {
|
|
@@ -495,7 +498,7 @@ func DecodeEntId(encodeId string) int {
|
|
|
return id
|
|
|
}
|
|
|
|
|
|
-//超级订阅
|
|
|
+// 超级订阅
|
|
|
func vipOrder(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
|
|
|
types := qu.ObjToString(m["type"])
|
|
|
switch types {
|
|
@@ -509,7 +512,7 @@ func vipOrder(m map[string]interface{}, userId string, session *httpsession.Sess
|
|
|
return nil, "未知类型"
|
|
|
}
|
|
|
|
|
|
-//超级订阅首次购买
|
|
|
+// 超级订阅首次购买
|
|
|
func vipFirstBuy(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
|
|
|
//area := qu.ObjToMap(m["area"]) //地区 p195不再选择地区 只选择数量
|
|
|
areaCount := qu.IntAll(m["areaCount"]) //地区
|
|
@@ -629,7 +632,7 @@ func vipFirstBuy(m map[string]interface{}, userId string, session *httpsession.S
|
|
|
}, ""
|
|
|
}
|
|
|
|
|
|
-//超级订阅续费
|
|
|
+// 超级订阅续费
|
|
|
func vipRenew(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
|
|
|
disWord := qu.ObjToString(m["disWord"])
|
|
|
// req_price := qu.IntAll(m["price"])
|
|
@@ -725,7 +728,7 @@ func vipRenew(m map[string]interface{}, userId string, session *httpsession.Sess
|
|
|
}, ""
|
|
|
}
|
|
|
|
|
|
-//超级订阅升级
|
|
|
+// 超级订阅升级
|
|
|
func vipUpgrade(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
|
|
|
areaCount := qu.IntAll(m["areaCount"]) //地区
|
|
|
//area := qu.ObjToMap(m["area"]) //地区 p195不再选择地区 只选数量
|
|
@@ -879,7 +882,7 @@ func vipUpgrade(m map[string]interface{}, userId string, session *httpsession.Se
|
|
|
return orderinfo, ""
|
|
|
}
|
|
|
|
|
|
-//大会员
|
|
|
+// 大会员
|
|
|
func memberOrder(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
|
|
|
//校验是否有转账待审核订单
|
|
|
num := util.Mysql.Count("dataexport_order", map[string]interface{}{
|
|
@@ -930,7 +933,7 @@ func memberOrder(m map[string]interface{}, userId string, session *httpsession.S
|
|
|
}, ""
|
|
|
}
|
|
|
|
|
|
-//剑鱼币
|
|
|
+// 剑鱼币
|
|
|
func integralOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
|
|
|
//参数验证 price:价格(已折扣);score:购买积分
|
|
|
price := qu.IntAll(m["price"])
|
|
@@ -968,7 +971,7 @@ func integralOrder(m map[string]interface{}, userId string) (*OrderInfo, string)
|
|
|
}, ""
|
|
|
}
|
|
|
|
|
|
-//数据流量包
|
|
|
+// 数据流量包
|
|
|
func dataexportPackOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
|
|
|
packId := qu.ObjToString(m["packId"])
|
|
|
// 获取用户分销口令
|
|
@@ -1015,7 +1018,7 @@ func dataexportPackOrder(m map[string]interface{}, userId string) (*OrderInfo, s
|
|
|
}, ""
|
|
|
}
|
|
|
|
|
|
-//省份订阅包
|
|
|
+// 省份订阅包
|
|
|
func areaPackOrder(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
|
|
|
orderType := qu.IntAll(m["orderType"])
|
|
|
area := qu.ObjToMap(m["area"])
|
|
@@ -1108,7 +1111,7 @@ func areaPackOrder(m map[string]interface{}, userId string, session *httpsession
|
|
|
return orderinfo, ""
|
|
|
}
|
|
|
|
|
|
-//附件下载包
|
|
|
+// 附件下载包
|
|
|
func filePackOrder(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
|
|
|
data := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
|
|
|
if data.VipStatus <= 0 {
|
|
@@ -1156,7 +1159,9 @@ func filePackOrder(m map[string]interface{}, userId string, session *httpsession
|
|
|
useProduct :产品类型
|
|
|
useProductType:商品类型 0普通的 1线上课程
|
|
|
discountId:活动赠品对应标识
|
|
|
+
|
|
|
return:
|
|
|
+
|
|
|
timeNum:赠送数量
|
|
|
查看赠品
|
|
|
*/
|
|
@@ -1182,7 +1187,7 @@ func GiveInfo(userid string, useProduct, useProductType, discountId int) []map[s
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-//采购单位画像包 -超级订阅升级版用户可以购买使用
|
|
|
+// 采购单位画像包 -超级订阅升级版用户可以购买使用
|
|
|
func buyerPortraitPackOrder(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
|
|
|
uData := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
|
|
|
if uData.VipStatus <= 0 || uData.Vip_BuySet.Upgrade <= 0 {
|
|
@@ -1224,7 +1229,7 @@ func buyerPortraitPackOrder(m map[string]interface{}, userId string, session *ht
|
|
|
}, ""
|
|
|
}
|
|
|
|
|
|
-//数据报告
|
|
|
+// 数据报告
|
|
|
func newDataReportOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
|
|
|
reportId := qu.IntAll(m["reportId"]) //报告id
|
|
|
email := qu.ObjToString(m["email"])
|
|
@@ -1285,7 +1290,7 @@ func newDataReportOrder(m map[string]interface{}, userId string) (*OrderInfo, st
|
|
|
}, ""
|
|
|
}
|
|
|
|
|
|
-//中标必听课
|
|
|
+// 中标必听课
|
|
|
func courseOnlineOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
|
|
|
pay_way := "wx_app"
|
|
|
_id := qu.ObjToString(m["courseId"])
|