chance_revise_log.go
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package models
import (
"time"
"github.com/astaxie/beego/orm"
)
type ChanceReviseLog struct {
Id int64 `orm:"column(id);pk" description:"id 主键"`
ChanceId int64 `orm:"column(chance_id)" description:"机会编号"`
UserCompanyId int64 `orm:"column(user_company_id);null" description:"用户编号 编辑机会的人"`
Data string `orm:"column(data);null" description:"机会数据"`
CreateAt time.Time `orm:"column(create_at);type(timestamp);null" description:"创建时间"`
}
func (t *ChanceReviseLog) TableName() string {
return "chance_revise_log"
}
func init() {
orm.RegisterModel(new(ChanceReviseLog))
}
// AddChanceReviseLog insert a new ChanceReviseLog into database and returns
// last inserted Id on success.
func AddChanceReviseLog(m *ChanceReviseLog) (id int64, err error) {
o := orm.NewOrm()
id, err = o.Insert(m)
return
}
// GetChanceReviseLogById retrieves ChanceReviseLog by Id. Returns error if
// Id doesn't exist
func GetChanceReviseLogById(id int64) (v *ChanceReviseLog, err error) {
o := orm.NewOrm()
v = &ChanceReviseLog{Id: id}
if err = o.Read(v); err == nil {
return v, nil
}
return nil, err
}