models/userCar.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
models/userCar.go
@@ -1,6 +1,7 @@ package models import ( "fmt" "github.com/astaxie/beego/orm" ) @@ -40,5 +41,10 @@ func (uc *UserCar) Delete(userId string, plateNo string) (int64, error) { o := orm.NewOrm() return o.Delete(&UserCar{UserId: userId, PlateNo: plateNo}) sql := fmt.Sprintf("delete from "+uc.TableName()+" where userId='%s' and plateNo='%s'", userId, plateNo) result, err := o.Raw(sql).Exec() if err != nil { return 0, err } return result.RowsAffected() }