|
@@ -251,7 +251,6 @@ func (w *WsDataExport) PaySuccessPage() error {
|
|
func (w *WsDataExport) ToCreateOrderPage() error {
|
|
func (w *WsDataExport) ToCreateOrderPage() error {
|
|
defer util.Catch()
|
|
defer util.Catch()
|
|
id := util.SE.Decode4Hex(w.GetString("id"))
|
|
id := util.SE.Decode4Hex(w.GetString("id"))
|
|
- s_phone := util.ObjToString(w.GetSession("s_phone"))
|
|
|
|
userId := util.ObjToString(w.GetSession("userId"))
|
|
userId := util.ObjToString(w.GetSession("userId"))
|
|
if userId == "" {
|
|
if userId == "" {
|
|
return errors.New("未登录")
|
|
return errors.New("未登录")
|
|
@@ -268,49 +267,43 @@ func (w *WsDataExport) ToCreateOrderPage() error {
|
|
//邮箱验证
|
|
//邮箱验证
|
|
// w.DelSession("DataExportVerifyEmail_val")
|
|
// w.DelSession("DataExportVerifyEmail_val")
|
|
// w.DelSession("DataExportVerifyPhone_val")
|
|
// w.DelSession("DataExportVerifyPhone_val")
|
|
- email := w.GetSession("DataExportVerifyEmail_val")
|
|
|
|
- resPhone := w.GetSession("DataExportVerifyPhone_val")
|
|
|
|
- if email != nil {
|
|
|
|
|
|
+ resEmail, _ := w.GetSession("DataExportVerifyEmail_val").(string)
|
|
|
|
+ resPhone, _ := w.GetSession("DataExportVerifyPhone_val").(string)
|
|
|
|
+ if resEmail != "" {
|
|
lastSendDEVerify := util.Int64All(w.GetSession("CreatEVerifyTime"))
|
|
lastSendDEVerify := util.Int64All(w.GetSession("CreatEVerifyTime"))
|
|
timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5
|
|
timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5
|
|
- w.T["email"] = email
|
|
|
|
|
|
+ w.T["email"] = resEmail
|
|
w.T["timeSpaceing"] = timeSpaceing
|
|
w.T["timeSpaceing"] = timeSpaceing
|
|
- } else {
|
|
|
|
- mail_phone := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
|
|
|
|
|
|
+ }
|
|
|
|
+ if resPhone != "" {
|
|
|
|
+ w.T["phone"] = resPhone
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if resEmail == "" || resPhone == "" {
|
|
|
|
+ lastEmail, lastPhone := "", ""
|
|
|
|
+ if lastOrder := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
|
|
"user_id": userId,
|
|
"user_id": userId,
|
|
"product_type": "历史数据",
|
|
"product_type": "历史数据",
|
|
- }, "user_mail,user_phone", "create_time desc")
|
|
|
|
- if mail_phone != nil {
|
|
|
|
- email = (*mail_phone)["user_mail"]
|
|
|
|
- resPhone = (*mail_phone)["user_phone"]
|
|
|
|
- }
|
|
|
|
- if email == nil || email == "" {
|
|
|
|
- userData, _ := mongodb.FindById("user", userId, `{"o_jy":1}`)
|
|
|
|
- o_jy := util.ObjToMap((*userData)["o_jy"])
|
|
|
|
- email = (*o_jy)["s_email"]
|
|
|
|
|
|
+ }, "user_mail,user_phone", "create_time desc"); lastOrder != nil && len(*lastOrder) > 0 { //若有上一个订单,邮箱和手机号则取上个订单中的
|
|
|
|
+ lastEmail, _ = (*lastOrder)["user_mail"].(string)
|
|
|
|
+ lastPhone, _ = (*lastOrder)["user_phone"].(string)
|
|
|
|
+ } else { //若无上个订单,则取用户账户中设置的手机号和邮箱
|
|
|
|
+ userData, _ := mongodb.FindById("user", userId, `{"s_myemail":1,"s_phone":1,"s_m_phone":1}`)
|
|
|
|
+ if userData != nil && len(*userData) > 0 {
|
|
|
|
+ lastEmail, _ = (*userData)["s_myemail"].(string)
|
|
|
|
+ lastPhone, _ = util.If((*userData)["s_phone"] != nil, (*userData)["s_phone"], (*userData)["s_m_phone"]).(string)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- if email != nil && email != "" {
|
|
|
|
|
|
+ if resEmail == "" && lastEmail != "" {
|
|
|
|
+ w.T["email"] = lastEmail
|
|
w.SetSession("EMVerifySucess", true)
|
|
w.SetSession("EMVerifySucess", true)
|
|
- w.SetSession("DataExportVerifyEmail_val", email)
|
|
|
|
|
|
+ w.SetSession("DataExportVerifyEmail_val", lastEmail)
|
|
}
|
|
}
|
|
- w.T["email"] = email
|
|
|
|
- }
|
|
|
|
- //手机号
|
|
|
|
- phone := w.GetSession("DataExportVerifyPhone_val")
|
|
|
|
- if phone != nil && phone != "" {
|
|
|
|
- w.T["phone"] = phone
|
|
|
|
- } else {
|
|
|
|
- //app手机号登录
|
|
|
|
- log.Println("s_phone:", s_phone)
|
|
|
|
- if isPhone(s_phone) {
|
|
|
|
- phone = s_phone
|
|
|
|
- } else {
|
|
|
|
- phone = resPhone
|
|
|
|
- }
|
|
|
|
- if phone != nil && phone != "" {
|
|
|
|
- w.SetSession("DataExportVerifyPhone_val", phone)
|
|
|
|
|
|
+
|
|
|
|
+ if resPhone == "" && lastPhone != "" {
|
|
|
|
+ w.SetSession("DataExportVerifyPhone_val", lastPhone)
|
|
|
|
+ w.T["phone"] = lastPhone
|
|
}
|
|
}
|
|
- w.T["phone"] = phone
|
|
|
|
}
|
|
}
|
|
//支付方式
|
|
//支付方式
|
|
payway := w.GetString("payway")
|
|
payway := w.GetString("payway")
|