|
@@ -70,6 +70,7 @@ func (this *Client) PersonnelIndex() {
|
|
|
}
|
|
|
entId := qu.IntAll(user["ent_id"])
|
|
|
count := Mgo.Count("entniche_rule", map[string]interface{}{"entId": entId, "entUserId": entUserId})
|
|
|
+
|
|
|
entRuleArr, ok := Mgo.Find("entniche_rule", map[string]interface{}{"entId": entId, "entUserId": entUserId}, `{"_id":-1}`, nil, false, start, limit)
|
|
|
if ok && entRuleArr != nil && *entRuleArr != nil && len(*entRuleArr) > 0 {
|
|
|
for _, v := range *entRuleArr {
|
|
@@ -88,11 +89,27 @@ func (this *Client) PersonnelIndex() {
|
|
|
"data": nil,
|
|
|
"recordsFiltered": 0,
|
|
|
"recordsTotal": 0,
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
this.T["id"] = id
|
|
|
- this.Render("/client/personnelIndex.html")
|
|
|
+ entUserId := 0
|
|
|
+ user := this.GetSession("user").(map[string]interface{})
|
|
|
+ if id == "" {
|
|
|
+ entUserId = qu.IntAll(user["id"])
|
|
|
+ } else {
|
|
|
+ entUserId, _ = strconv.Atoi(qu.SE.DecodeString(id))
|
|
|
+ }
|
|
|
+ entId := qu.IntAll(user["ent_id"])
|
|
|
+ leftNumData := JyMysql.FindOne("user_account", map[string]interface{}{"user_id":entUserId,"ent_id":entId},"left_num","")
|
|
|
+ var left int
|
|
|
+ if (*leftNumData)==nil{
|
|
|
+ left=0
|
|
|
+ }
|
|
|
+ left = int((*leftNumData)["left_num"].(int64))
|
|
|
+ this.T["left"] = left
|
|
|
+ this.Render("/client/personnelIndex.html",&this.T)
|
|
|
}
|
|
|
}
|
|
|
|