func (c *JobController) getInitData() { c.Data["Types"] = c.getRequires() c.Data["Departments"] = departments c.Data["is_edit"] = false c.Data["ProjectNames"], _ = project.NewProjectList().GetAllProjectNames() c.Data["Status"] = c.getinitStatusData() users, err := user.GetList() if err == nil { c.Data["Employees"] = users } c.Data["BussinessMen"] = user.BussinessMen }
func (c *ProduceController) GetInitData() { c.Data["Types"] = c.getRequires() c.Data["Departments"] = departments filter := make(map[string]interface{}) projectList := project.NewProjectList() projects, err := projectList.GetList(filter) if err == nil { c.Data["Projects"] = projects } users, err := user.GetList() if err == nil { c.Data["Employees"] = users } }
func (c *UserController) GetViewUsers() { allUser, _ := user.GetList() companyCode := c.GetString("company") role := c.GetString("role") users := make([]*models.User, 0) for _, v := range allUser { if v.Company.Code == companyCode { if role == "" || v.Roles == role { users = append(users, v) } } } c.Data["allUsers"] = users }
func (c *ComplaintController) GetInitData() { response := []string{"1", "0"} c.Data["Types"] = c.getRequires() c.Data["Departments"] = departments c.Data["Response"] = response //获取project对象 filter := make(map[string]interface{}) projectList := project.NewProjectList() projects, err := projectList.GetList(filter) if err == nil { c.Data["Projects"] = projects } //获取作业单元 users, err := user.GetList() if err == nil { c.Data["Employees"] = users } }