|
@@ -25,7 +25,7 @@ type CygxApplyRecord struct {
|
|
|
}
|
|
|
|
|
|
func AddApplyRecord(item *CygxApplyRecord) (err error) {
|
|
|
- o, err := orm.NewOrmUsingDB("weekly_report").Begin()
|
|
|
+ o, err := orm.NewOrm().Begin()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -37,7 +37,7 @@ func AddApplyRecord(item *CygxApplyRecord) (err error) {
|
|
|
}
|
|
|
}()
|
|
|
_, err = o.Insert(item)
|
|
|
-
|
|
|
+ ow := orm.NewOrmUsingDB("weekly_report")
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -49,7 +49,7 @@ func AddApplyRecord(item *CygxApplyRecord) (err error) {
|
|
|
real_name=?,
|
|
|
mobile=?
|
|
|
WHERE user_id = ? `
|
|
|
- _, err = o.Raw(msql, item.CompanyName, item.ApplyMethod, item.RealName, item.Mobile, item.UserId).Exec()
|
|
|
+ _, err = ow.Raw(msql, item.CompanyName, item.ApplyMethod, item.RealName, item.Mobile, item.UserId).Exec()
|
|
|
return
|
|
|
}
|
|
|
|