|
@@ -34,13 +34,8 @@ type AfterPay struct {
|
|
|
directSubKWS xweb.Mapper `xweb:"/afterPay/directSubKWS"` //搜索列表直接订阅关键词
|
|
|
fastImport xweb.Mapper `xweb:"/afterPay/fastImport"` //快速导入关键词
|
|
|
modification xweb.Mapper `xweb:"/afterPay/modification"` //关键词修改记录
|
|
|
- aaa xweb.Mapper `xweb:"/aaa"`
|
|
|
}
|
|
|
|
|
|
-func (a *AfterPay) Aaa() {
|
|
|
- aa, bb := a.GetInteger("qwe")
|
|
|
- log.Println(aa, bb != nil)
|
|
|
-}
|
|
|
func (a *AfterPay) Modification() error {
|
|
|
defer qutil.Catch()
|
|
|
userId, _ := a.GetSession("userId").(string)
|
|
@@ -505,6 +500,8 @@ func (a *AfterPay) SetUserInfo() error {
|
|
|
saveData["o_vipjy.a_items."+classify_index+".a_key."+kws_index+".appendkey"] = append(addtion_kws, _kws[1:]...)
|
|
|
saveData["o_vipjy.a_items."+classify_index+".a_key."+kws_index+".notkey"] = not_kws
|
|
|
saveData["o_vipjy.a_items."+classify_index+".a_key."+kws_index+".matchway"] = match_way
|
|
|
+ saveData["o_vipjy.a_items."+classify_index+".a_key."+kws_index+".updatetime"] = time.Now().Unix()
|
|
|
+
|
|
|
}
|
|
|
} else {
|
|
|
//首次添加分类和关键词
|
|
@@ -613,8 +610,10 @@ func (a *AfterPay) SetUserInfo() error {
|
|
|
} else if a.GetString("pageType") == "other_buyerclass" {
|
|
|
other, _ := a.GetInteger("other")
|
|
|
saveData["o_vipjy.i_matchbuyerclass_other"] = other
|
|
|
- } else if keytip, er := a.GetBool("keytip"); er == nil && keytip {
|
|
|
- saveData["b_keytip"] = true //fasle:需要弹窗 true:不需要弹窗
|
|
|
+ } else if a.GetString("pageType") == "keytip" {
|
|
|
+ if keytip, er := a.GetBool("keytip"); er == nil && keytip {
|
|
|
+ saveData["b_keytip"] = true //fasle:需要弹窗 true:不需要弹窗
|
|
|
+ }
|
|
|
}
|
|
|
if len(saveData) > 0 {
|
|
|
log.Println(saveData)
|
|
@@ -622,6 +621,9 @@ func (a *AfterPay) SetUserInfo() error {
|
|
|
"$set": saveData,
|
|
|
})
|
|
|
}
|
|
|
+ if data, ok := util.MQFW.FindById("user", userId, `{"o_vipjy":1}`); len(*data) > 0 && ok && data != nil {
|
|
|
+ util.Mgo_log.Save("ovipjy_log", data)
|
|
|
+ }
|
|
|
a.ServeJson(map[string]interface{}{
|
|
|
"flag": flag,
|
|
|
"msg": msg,
|
|
@@ -657,23 +659,25 @@ func (a *AfterPay) GetUserInfo() error {
|
|
|
var area_i = -1
|
|
|
var buyerclasscount = -1
|
|
|
var city_i = 0
|
|
|
- _buyset := qutil.ObjToMap((*data)["o_buyset"].(interface{}))
|
|
|
- if (*_buyset)["citys"] != nil {
|
|
|
- area_i = qutil.IntAll((*_buyset)["areacount"])
|
|
|
- citys := qutil.ObjToMap((*_buyset)["citys"].(interface{}))
|
|
|
- buyerclasscount = qutil.IntAll((*_buyset)["buyerclasscount"])
|
|
|
- for _, cv := range *citys {
|
|
|
- city_i += qutil.IntAll(cv.(int))
|
|
|
+ if (*data)["o_buyset"] != nil {
|
|
|
+ _buyset := qutil.ObjToMap((*data)["o_buyset"].(interface{}))
|
|
|
+ if (*_buyset)["citys"] != nil {
|
|
|
+ area_i = qutil.IntAll((*_buyset)["areacount"])
|
|
|
+ citys := qutil.ObjToMap((*_buyset)["citys"].(interface{}))
|
|
|
+ buyerclasscount = qutil.IntAll((*_buyset)["buyerclasscount"])
|
|
|
+ for _, cv := range *citys {
|
|
|
+ city_i += qutil.IntAll(cv.(int))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if area_i > 0 && city_i != 0 {
|
|
|
+ (*data)["o_area"] = strconv.Itoa(area_i) + "个省级区域、" + strconv.Itoa(city_i) + "个地市"
|
|
|
+ } else if area_i <= 0 && city_i != 0 {
|
|
|
+ (*data)["o_area"] = strconv.Itoa(city_i) + "个地市"
|
|
|
+ } else if area_i > 0 && city_i == 0 {
|
|
|
+ (*data)["o_area"] = strconv.Itoa(area_i) + "个省级区域"
|
|
|
+ } else {
|
|
|
+ (*data)["o_area"] = "全国"
|
|
|
}
|
|
|
- }
|
|
|
- if area_i > 0 && city_i != 0 {
|
|
|
- (*data)["o_area"] = strconv.Itoa(area_i) + "个省级区域、" + strconv.Itoa(city_i) + "个地市"
|
|
|
- } else if area_i <= 0 && city_i != 0 {
|
|
|
- (*data)["o_area"] = strconv.Itoa(city_i) + "个地市"
|
|
|
- } else if area_i > 0 && city_i == 0 {
|
|
|
- (*data)["o_area"] = strconv.Itoa(area_i) + "个省级区域"
|
|
|
- } else {
|
|
|
- (*data)["o_area"] = "全国"
|
|
|
}
|
|
|
//采购行业
|
|
|
(*data)["a_buyerclass"] = buyerclasscount
|