- add black user .

This commit is contained in:
gazebo
2018-07-02 13:37:52 +08:00
parent 28921345e8
commit b82729709d
5 changed files with 89 additions and 19 deletions

View File

@@ -0,0 +1,24 @@
package controllers
import (
"git.rosy.net.cn/jx-callback/business/models"
"git.rosy.net.cn/jx-callback/globals"
"github.com/astaxie/beego/orm"
)
func IsAutoAcceptOrder(userMobile string, db orm.Ormer) bool {
if db == nil {
db = orm.NewOrm()
}
user := &models.BlackClient{
Mobile: userMobile,
}
if err := db.Read(user, "Mobile"); err != nil {
if err != orm.ErrNoRows {
globals.SugarLogger.Errorf("read data error:%v, data:%v", err, user)
}
// 在访问数据库出错的情况下,也需要自动接单
return true
}
return false
}