|
@@ -44,11 +44,10 @@ func GetStocksFromVmp(cont context.Context) (err error) {
|
|
|
|
|
|
items := make([]*models.CygxYanxuanSpecialCompany, 0)
|
|
|
|
|
|
-
|
|
|
for i, _ := range resp.Data {
|
|
|
items = append(items, &resp.Data[i])
|
|
|
if len(items) > 5000 {
|
|
|
- err = models.AddCygxYanxuanSpecialCompanyMulti(items)
|
|
|
+ err = models.AddCygxYanxuanSpecialCompanyMulti(items)
|
|
|
if err != nil {
|
|
|
fmt.Println("AddCygxYanxuanSpecialCompanyMulti Err:%s", err.Error())
|
|
|
return
|
|
@@ -57,7 +56,7 @@ func GetStocksFromVmp(cont context.Context) (err error) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- err = models.AddCygxYanxuanSpecialCompanyMulti(items)
|
|
|
+ err = models.AddCygxYanxuanSpecialCompanyMulti(items)
|
|
|
if err != nil {
|
|
|
fmt.Println("AddCygxYanxuanSpecialCompanyMulti Err:%s", err.Error())
|
|
|
return
|
|
@@ -65,27 +64,52 @@ func GetStocksFromVmp(cont context.Context) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func AddSpecialRecord(user *models.WxUserItem, specialId int) {
|
|
|
+func AddSpecialRecord(user *models.WxUserItem, specialId, stopTime int) {
|
|
|
var sellerName string
|
|
|
- sellerName, err := models.GetCompanySellerName(user.CompanyId)
|
|
|
+ //获取销售信息
|
|
|
+ sellerItem, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
- item := models.CygxYanxuanSpecialRecord{
|
|
|
- UserId: user.UserId,
|
|
|
- Mobile: user.Mobile,
|
|
|
- Email: user.Email,
|
|
|
- CompanyId: user.CompanyId,
|
|
|
- CompanyName: user.CompanyName,
|
|
|
- RealName: user.RealName,
|
|
|
- SellerName: sellerName,
|
|
|
- CreateTime: time.Now(),
|
|
|
- ModifyTime: time.Now(),
|
|
|
- RegisterPlatform: utils.REGISTER_PLATFORM,
|
|
|
- YanxuanSpecialId: specialId,
|
|
|
- }
|
|
|
- _, err = models.AddCygxYanxuanSpecialRecord(&item)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
+ sellerName = sellerItem.RealName
|
|
|
+
|
|
|
+ if stopTime >= 3 {
|
|
|
+ item := new(models.CygxYanxuanSpecialRecord)
|
|
|
+ item.UserId = user.UserId
|
|
|
+ item.Mobile = user.Mobile
|
|
|
+ item.Email = user.Email
|
|
|
+ item.CompanyId = user.CompanyId
|
|
|
+ item.CompanyName = user.CompanyName
|
|
|
+ item.RealName = user.RealName
|
|
|
+ item.SellerName = sellerName
|
|
|
+ item.CreateTime = time.Now()
|
|
|
+ item.ModifyTime = time.Now()
|
|
|
+ item.RegisterPlatform = utils.REGISTER_PLATFORM
|
|
|
+ item.YanxuanSpecialId = specialId
|
|
|
+
|
|
|
+ _, err = models.AddCygxYanxuanSpecialRecord(item)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //如果不是弘则研究的人员阅读的,就修改Pv、Uv数量
|
|
|
+ if user.CompanyId != utils.HZ_COMPANY_ID {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
+
|
|
|
+ //item := models.CygxYanxuanSpecialRecord{
|
|
|
+ // UserId: user.UserId,
|
|
|
+ // Mobile: user.Mobile,
|
|
|
+ // Email: user.Email,
|
|
|
+ // CompanyId: user.CompanyId,
|
|
|
+ // CompanyName: user.CompanyName,
|
|
|
+ // RealName: user.RealName,
|
|
|
+ // SellerName: sellerName,
|
|
|
+ // CreateTime: time.Now(),
|
|
|
+ // ModifyTime: time.Now(),
|
|
|
+ // RegisterPlatform: utils.REGISTER_PLATFORM,
|
|
|
+ // YanxuanSpecialId: specialId,
|
|
|
+ //}
|
|
|
+
|
|
|
+}
|