|
@@ -55,7 +55,7 @@ func (self *CentEconomic) GetTable(WxUserId int64) string {
|
|
|
return fmt.Sprintf("cent%d_balance", split)
|
|
return fmt.Sprintf("cent%d_balance", split)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (self *CentEconomic) Create(wxUId, c int64, s, rId, remark string) (item *CentEconomic) {
|
|
|
|
|
|
|
+func (self *CentEconomic) Create(wxUId, c int64, s, rId, remark string, o orm.Ormer) (item *CentEconomic) {
|
|
|
item = &CentEconomic{
|
|
item = &CentEconomic{
|
|
|
Count: c,
|
|
Count: c,
|
|
|
WxUId: wxUId,
|
|
WxUId: wxUId,
|
|
@@ -66,7 +66,7 @@ func (self *CentEconomic) Create(wxUId, c int64, s, rId, remark string) (item *C
|
|
|
table := self.GetTable(wxUId)
|
|
table := self.GetTable(wxUId)
|
|
|
sql := fmt.Sprintf("insert into %s(count,wx_uid,source,relate_id,remark)values(?,?,?,?,?)", table)
|
|
sql := fmt.Sprintf("insert into %s(count,wx_uid,source,relate_id,remark)values(?,?,?,?,?)", table)
|
|
|
|
|
|
|
|
- o := orm.NewOrm()
|
|
|
|
|
|
|
+ //o := orm.NewOrm()
|
|
|
result, err := o.Raw(sql, item.Count, item.WxUId, item.Source, item.RelateId, item.Remark).Exec()
|
|
result, err := o.Raw(sql, item.Count, item.WxUId, item.Source, item.RelateId, item.Remark).Exec()
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
beego.BeeLogger.Debug("insert into cent economice with wxUId=%d, err=[%s]", wxUId, err)
|
|
beego.BeeLogger.Debug("insert into cent economice with wxUId=%d, err=[%s]", wxUId, err)
|