|
@@ -2,6 +2,7 @@ package models
|
|
|
|
|
|
import (
|
|
|
"github.com/beego/beego/v2/client/orm"
|
|
|
+ "hongze/hongze_clpt/utils"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -28,9 +29,9 @@ func AddApplyRecord(item *ApplyTryReq, mobile, companyNamePay string, userId, co
|
|
|
}
|
|
|
}()
|
|
|
|
|
|
- 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()
|
|
|
+ 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,register_platform)
|
|
|
+ VALUES(?,?,?,?,?,?,?,?,?,?,?) `
|
|
|
+ _, err = o.Raw(sql, userId, item.BusinessCardUrl, item.RealName, item.CompanyName, mobile, time.Now(), item.ApplyMethod, companyIdPay, companyNamePay, CompanyIdType, utils.REGISTER_PLATFORM).Exec()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -52,3 +53,11 @@ func GetApplyRecordCount(userId int) (count int, err error) {
|
|
|
err = o.Raw(sql, userId).QueryRow(&count)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// 通过手机号获取详情
|
|
|
+func GetCygxApplyRecordByMobile(mobile string) (item *CygxApplyRecord, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT * FROM cygx_apply_record WHERE mobile=? AND status=0 ORDER BY apply_record_id DESC LIMIT 1 `
|
|
|
+ err = o.Raw(sql, mobile).QueryRow(&item)
|
|
|
+ return
|
|
|
+}
|