|
@@ -6,16 +6,22 @@ import (
|
|
|
)
|
|
|
|
|
|
type CygxApplyRecord struct {
|
|
|
- ApplyRecordId int `orm:"column(apply_record_id);pk" description:"申请试用id"`
|
|
|
- BusinessCardUrl string `description:"名片地址"`
|
|
|
- RealName string `description:"姓名"`
|
|
|
- CompanyName string `description:"公司名称"`
|
|
|
- Mobile string `description:"手机号"`
|
|
|
- CreateTime time.Time `description:"创建时间"`
|
|
|
- ApplyMethod int `description:"1:已付费客户申请试用,2:非客户申请试用"`
|
|
|
+ ApplyRecordId int `orm:"column(apply_record_id);pk" description:"申请试用id"`
|
|
|
+ UserId int `description:"用户ID"`
|
|
|
+ BusinessCardUrl string `description:"名片地址"`
|
|
|
+ RealName string `description:"姓名"`
|
|
|
+ CompanyName string `description:"公司名称"`
|
|
|
+ CompanyIdPay int `description:"已付费客户公司id"`
|
|
|
+ CompanyIdType int `description:"用户状态,1:潜在客户 、2:现有客户 、3:FICC客户 、4:现有客户(正式,无对应权限) 、5:现有客户(试用,无对应权限) 、6:现有客户(试用暂停) 、7:现有客户(冻结) 、8:现有客户(流失) "`
|
|
|
+ CompanyNamePay string `description:"公司名称"`
|
|
|
+ Mobile string `description:"手机号"`
|
|
|
+ CreateTime time.Time `description:"创建时间"`
|
|
|
+ ApplyMethod int `description:"1:已付费客户申请试用,2:非客户申请试用"`
|
|
|
+ RegisterPlatform int `description:"来源 1小程序,2:网页"`
|
|
|
+ InviteCompanySource int `description:"来源 1小程序,2:网页"`
|
|
|
}
|
|
|
|
|
|
-func AddApplyRecord(item *ApplyTryReq, mobile, companyNamePay string, userId, companyIdPay, CompanyIdType int) (err error) {
|
|
|
+func AddApplyRecord(item *CygxApplyRecord) (err error) {
|
|
|
o, err := orm.NewOrm().Begin()
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -27,10 +33,7 @@ func AddApplyRecord(item *ApplyTryReq, mobile, companyNamePay string, userId, co
|
|
|
o.Commit()
|
|
|
}
|
|
|
}()
|
|
|
-
|
|
|
- sql := `INSERT INTO cygx_apply_record (user_id,business_card_url, real_name,company_name, mobile,create_time, apply_method,company_id_pay,company_name_pay,company_id_type)
|
|
|
- VALUES(?,?,?,?,?,?,?,?,?,?) `
|
|
|
- _, err = o.Raw(sql, userId, item.BusinessCardUrl, item.RealName, item.CompanyName, mobile, time.Now(), item.ApplyMethod, companyIdPay, companyNamePay, CompanyIdType).Exec()
|
|
|
+ _, err = o.Insert(item)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -42,7 +45,7 @@ func AddApplyRecord(item *ApplyTryReq, mobile, companyNamePay string, userId, co
|
|
|
real_name=?,
|
|
|
mobile=?
|
|
|
WHERE user_id = ? `
|
|
|
- _, err = o.Raw(msql, item.CompanyName, item.ApplyMethod, item.RealName, mobile, userId).Exec()
|
|
|
+ _, err = o.Raw(msql, item.CompanyName, item.ApplyMethod, item.RealName, item.Mobile, item.UserId).Exec()
|
|
|
return
|
|
|
}
|
|
|
|