|
@@ -11,8 +11,9 @@ import (
|
|
|
|
|
|
type Action struct {
|
|
|
*xweb.Action
|
|
|
- move xweb.Mapper `xweb:"/move"` //人员或者部门移动
|
|
|
- del xweb.Mapper `xweb:"/delete"` //人员或者部门删除
|
|
|
+ move xweb.Mapper `xweb:"/move"` //人员或者部门移动
|
|
|
+ del xweb.Mapper `xweb:"/delete"` //人员或者部门删除
|
|
|
+ whetherbuy xweb.Mapper `xweb:"/whetherbuy"` //是否购买过
|
|
|
}
|
|
|
|
|
|
func (a *Action) Move() {
|
|
@@ -57,3 +58,12 @@ func (a *Action) Del() {
|
|
|
}
|
|
|
a.ServeJson(Result{Data: M{"status": status}})
|
|
|
}
|
|
|
+func (a *Action) Whetherbuy() {
|
|
|
+ userId, _ := a.GetSession("userId").(string)
|
|
|
+ phone := VarCurrentUser.Phone(userId)
|
|
|
+ status := 0
|
|
|
+ if Mysql.CountBySql("select count(1) as count from entniche_user where phone=?", phone) > 0 {
|
|
|
+ status = 1
|
|
|
+ }
|
|
|
+ a.ServeJson(Result{Data: M{"status": status}})
|
|
|
+}
|