|
@@ -7,9 +7,12 @@ import (
|
|
|
|
|
|
type CygxApplyRecord struct {
|
|
|
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:"创建时间"`
|
|
@@ -17,6 +20,37 @@ type CygxApplyRecord struct {
|
|
|
RegisterPlatform int `description:"来源 1小程序,2:网页"`
|
|
|
}
|
|
|
|
|
|
+func AddApplyRecordold(item *ApplyTryReq, mobile, companyNamePay string, userId, companyIdPay, CompanyIdType int) (err error) {
|
|
|
+ o, err := orm.NewOrm().Begin()
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ defer func() {
|
|
|
+ if err != nil {
|
|
|
+ o.Rollback()
|
|
|
+ } else {
|
|
|
+ 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()
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ msql := `UPDATE wx_user
|
|
|
+ SET
|
|
|
+ note = ?,
|
|
|
+ is_note = 1,
|
|
|
+ apply_method = ?,
|
|
|
+ real_name=?,
|
|
|
+ mobile=?
|
|
|
+ WHERE user_id = ? `
|
|
|
+ _, err = o.Raw(msql, item.CompanyName, item.ApplyMethod, item.RealName, mobile, userId).Exec()
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func AddApplyRecord(item *ApplyTryReq, mobile, companyNamePay string, userId, companyIdPay, CompanyIdType int) (err error) {
|
|
|
o, err := orm.NewOrm().Begin()
|
|
|
if err != nil {
|