fix
liuxiaolong
2020-06-30 23ff36c6b535ee9ff9c72f666214589535a9400c
fix
1个文件已修改
8 ■■■■ 已修改文件
models/userCar.go 8 ●●●● 补丁 | 查看 | 原始文档 | 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()
}