- add black user .
This commit is contained in:
24
business/controllers/business.go
Normal file
24
business/controllers/business.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user