You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
857 B

package LoginDao
import (
"dsSdsf/Utils/DbUtil"
"github.com/xormplus/xorm"
)
var db = DbUtil.Engine
func TestSqlJson() (string, error) {
sql := "select * from t_complaint_info"
results, err := db.SQL(sql).Query().Json()
return results, err
}
func TestSqlSingle() xorm.Record {
record := make(xorm.Record)
sql := "select * from t_complaint_info where id =?"
db.SQL(sql, "157328").Get(&record)
return record
}
func TestSqlUpdate() {
sql := "update t_complaint_info set pct_tel = ? where id = ?"
db.SQL(sql, "13999999998", "157328").Execute()
}
//用户名和密码是否存在
func GetLoginPwdExists(user string, pwd string) bool {
flag := false
sql := "select login_pwd from t_complaint_login where login_name = ? and login_pwd = ? and b_use = 1"
c, _ := db.SQL(sql, user, pwd).Query().Count()
if c > 0 {
flag = true
}
return flag
}