|
|
@@ -353,6 +353,7 @@ type Messageboard struct {
|
|
|
Userid int64 `json:"userid" xorm:"'USERID'"` // 用户ID
|
|
|
Message string `json:"message" xorm:"'MESSAGE'"` // 留言信息
|
|
|
Createtime time.Time `json:"createtime" xorm:"'CREATETIME'"` // 创建时间
|
|
|
+ Contactnum string `json:"contactnum" xorm:"'CONTACTNUM'"` // 联系电话
|
|
|
}
|
|
|
|
|
|
// TableName is MESSAGEBOARD
|
|
|
@@ -649,7 +650,7 @@ func GetMessageBoard(userID int) ([]Messageboard, error) {
|
|
|
}
|
|
|
|
|
|
// InsertMessageBoard 新增用户留言板信息
|
|
|
-func InsertMessageBoard(userID int, message string) int {
|
|
|
+func InsertMessageBoard(userID int, message, contactNum string) int {
|
|
|
engine := db.GetEngine()
|
|
|
|
|
|
// 一天最多只能新增3条留言
|
|
|
@@ -663,7 +664,7 @@ func InsertMessageBoard(userID int, message string) int {
|
|
|
}
|
|
|
|
|
|
// 由于XORM对ORACLE支持不行,有时间字段更新的直接使用SQL语句执行
|
|
|
- sql := fmt.Sprintf("insert into MESSAGEBOARD (MESSAGEBOARDID, USERID, MESSAGE, CREATETIME) values (SEQ_MessageBoard.nextval, %d, '%s', (select sysdate from dual))", userID, message)
|
|
|
+ sql := fmt.Sprintf("insert into MESSAGEBOARD (MESSAGEBOARDID, USERID, MESSAGE, CONTACTNUM ,CREATETIME) values (SEQ_MessageBoard.nextval, %d, '%s', '%s', (select sysdate from dual))", userID, message, contactNum)
|
|
|
if _, err := engine.Exec(sql); err != nil {
|
|
|
return e.ERROR_OPERATION_FAILED
|
|
|
}
|