|
@@ -26,6 +26,48 @@ type Client struct {
|
|
|
cuserRuleEdit xweb.Mapper `xweb:"/client/cuser/rule/Edit"`
|
|
|
//同步
|
|
|
synEuser xweb.Mapper `xweb:"/client/cuser/synchronous"`
|
|
|
+ //
|
|
|
+ adminIndex xweb.Mapper `xweb:"/admin/index"` //管理员首页
|
|
|
+ personnelIndex xweb.Mapper `xweb:"/personnel/index"` //员工首页
|
|
|
+}
|
|
|
+
|
|
|
+func (this *Client) AdminIndex() {
|
|
|
+ user := this.GetSession("user").(map[string]interface{})
|
|
|
+ entId := qu.IntAll(user["ent_id"])
|
|
|
+ // entUserId := qu.IntAll(user["id"])
|
|
|
+ // appid := qu.ObjToString(user["appid"])
|
|
|
+ // phone := qu.ObjToString(user["phone"])
|
|
|
+ entUserArr := JyMysql.Find("entniche_user", map[string]interface{}{"ent_id": entId}, "", "id desc", 0, 10)
|
|
|
+ if entUserArr != nil && *entUserArr != nil && len(*entUserArr) > 0 {
|
|
|
+ for _, v := range *entUserArr {
|
|
|
+ userId := qu.IntAll(v["id"])
|
|
|
+ deptmentUser := JyMysql.FindOne("entniche_department_user", map[string]interface{}{"user_id": userId}, "dept_id", "")
|
|
|
+ if deptmentUser != nil && *deptmentUser != nil {
|
|
|
+ dId := qu.IntAll((*deptmentUser)["dept_id"])
|
|
|
+ v["depeatId"] = dId
|
|
|
+ deptment := JyMysql.FindOne("entniche_department", map[string]interface{}{"id": dId}, "name", "")
|
|
|
+ if deptment != nil && *deptment != nil {
|
|
|
+ dName := qu.ObjToString((*deptment)["name"])
|
|
|
+ v["depeatName"] = dName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.T["entUserArr"] = *entUserArr
|
|
|
+ }
|
|
|
+ this.Render("/client/index.html")
|
|
|
+}
|
|
|
+
|
|
|
+func (this *Client) PersonnelIndex() {
|
|
|
+ user := this.GetSession("user").(map[string]interface{})
|
|
|
+ entId := qu.IntAll(user["ent_id"])
|
|
|
+ entUserId := qu.IntAll(user["id"])
|
|
|
+ // appid := qu.ObjToString(user["appid"])
|
|
|
+ // phone := qu.ObjToString(user["phone"])
|
|
|
+ entRuleArr, ok := Mgo.Find("entniche_rule", map[string]interface{}{"entId": entId, "entUserId": entUserId}, `{"_id":-1}`, nil, false, 0, 10)
|
|
|
+ if ok && entRuleArr != nil && *entRuleArr != nil && len(*entRuleArr) > 0 {
|
|
|
+ this.T["entRuleArr"] = *entRuleArr
|
|
|
+ }
|
|
|
+ this.Render("/client/index.html")
|
|
|
}
|
|
|
|
|
|
func (this *Client) Index() {
|