models

package
v0.0.0-...-759746e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2019 License: Apache-2.0 Imports: 18 Imported by: 7

Documentation

Overview

提交给merit的成果记录表

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAdminCalendar

func AddAdminCalendar(title, content, color string, allday, public bool, start, end time.Time) (id int64, err error)

********日历******** 添加

func AddAdminCarousel

func AddAdminCarousel(title, url string) (id int64, err error)

添加轮播动画

func AddAdminCategory

func AddAdminCategory(pid int64, title, code string, grade int) (id int64, err error)

添加

func AddAdminDepart

func AddAdminDepart(pid int64, title, code string) (id int64, err error)

添加部门

func AddAdminIpsegment

func AddAdminIpsegment(title, startip, endip string, iprole int) (id int64, err error)

添加ip地址段

func AddAdminSynchIp

func AddAdminSynchIp(pid int64, username, synchip, port string) (id int64, err error)

****项目同步ip**** 添加AdminSynchIp

func AddArticle

func AddArticle(subtext, content string, productid int64) (id int64, err error)

添加文章作为成果的附件

func AddAttachment

func AddAttachment(filename string, filesize, downloads, productid int64) (id int64, err error)

添加附件到成果id下 如果附件名称已经存在,则不再追加写入数据库 应该用ReadOrCreate尝试从数据库读取,不存在的话就创建一个

func AddCarCalendar

func AddCarCalendar(title, content, color, ip string, allday, public bool, start, end time.Time) (id int64, err error)

********汽车日历******** 添加

func AddCatalogLink(cid int64, link string) (id int64, err error)

添加附件链接表

func AddDiary

func AddDiary(title, content, diarydate string, projectid, uid int64) (id int64, err error)

添加日记

func AddDoc

func AddDoc(code, title, label, principal string, end time.Time, uid int64) (id int64, err error)

添加成果到项目侧栏某个id下 如果这个侧栏id下的这个成果编号已经存在,则返回id //应该用ReadOrCreate尝试从数据库读取,不存在的话就创建一个

func AddMeetCalendar

func AddMeetCalendar(title, content, color, ip string, allday, public bool, start, end time.Time) (id int64, err error)

*******会议室日历 添加

func AddOnlyAttachment

func AddOnlyAttachment(filename string, filesize, downloads, productid int64) (id int64, err1, err2 error)

添加附件到成果id下 如果附件名称已经存在,则不再追加写入数据库 应该用ReadOrCreate尝试从数据库读取,不存在的话就创建一个

func AddOnlyChanges

func AddOnlyChanges(key, uid, uname, created string) (id int64, err1, err2 error)

添加历史版本

func AddOnlyHistory

func AddOnlyHistory(onlyattachmentid, uid int64, serverversion string, version int, key, fileurl, changesurl string, expires, created time.Time) (id int64, err1, err2 error)

添加历史版本

func AddPostMerit

func AddPostMerit(catalog PostMerit) (cid int64, err error, news string)

添加成果列表

func AddProduct

func AddProduct(code, title, label, principal string, uid, Projectid, TopProjectId int64) (id int64, err error)

添加成果到项目侧栏某个id下 如果这个侧栏id下的这个成果编号已经存在,则返回id //应该用ReadOrCreate尝试从数据库读取,不存在的话就创建一个

func AddProjCalendar

func AddProjCalendar(pid int64, title, content, color, imgurl string, allday, public, memorabilia bool, start, end time.Time) (id int64, err error)

************项目日历 ********日历******** 添加

func AddProjGant

func AddProjGant(id1, parentid int64, status, code, name, depends, description string, level, duration, progress int, start, end time.Time, startismilestone, endismilestone, haschild bool) (id int64, err error)

添加项目进度

func AddProject

func AddProject(code, title, label, principal string, parentid int64, parentidpath, parenttitlepath string, grade int) (id int64, err error)

添加项目

func AddRelevancy

func AddRelevancy(prodid int64, relevancy string) (id int64, err error)

添加项目

func AddTopicLike

func AddTopicLike(tid int64, openid string) (id int64, err error)

func AddTopicReply

func AddTopicReply(tid int64, openid, content, avatar, username, created string) (id int64, err error)

func AddUser

func AddUser(u *User) (int64, error)

添加用户

func AddUserAvator

func AddUserAvator(userid int64, avatarurl string) (id int64, err error)

后台手工操作添加微信小程序openid和用户名

func AddUserOpenID

func AddUserOpenID(userid int64, openid string) (id int64, err error)

后台手工操作添加微信小程序openid和用户名

func AddUserRole

func AddUserRole(uid, rid int64) error

将userid和roleid存入对应数据库 如果存在,

func AddWikiMany

func AddWikiMany(title, uname, content, attachment string) (id int64, err error)

一对多模式

func AddWikiOne

func AddWikiOne(title, content, uname string) (id int64, err error)

一对一模式

func AddWikiReply

func AddWikiReply(tid, nickname, content string) error

func BbsBbs

func BbsBbs(UserId int64, Desc string, SelectDate time.Time) (id int64, err error)

打卡记录写入数据库

func CheckCheck

func CheckCheck(ActivityId, UserId int64, Lat, Lng float64, PhotoUrl string, SelectDate time.Time) (id int64, err error)

打卡记录写入数据库

func CheckCreate

func CheckCreate(CreaterId int64, Caption, Desc, Location string, Lat, Lng float64, StartDate, EndDate time.Time, IfFace, IfPhoto, IfLocation bool) (id int64, err error)

func CheckUname

func CheckUname(user User) error

func CloseProjGant

func CloseProjGant(id int64) error

关闭

func Connect

func Connect()

数据库连接_这个仅作为参考,和上面重复

func DelAdminCarouselById

func DelAdminCarouselById(Id int64) (int64, error)

func DelUserById

func DelUserById(Id int64) (int64, error)

func DeletAttachment

func DeletAttachment(aid string) error

删除文章中的附件

func DeletWiki

func DeletWiki(tid string) error

func DeleteAdminCalendar

func DeleteAdminCalendar(cid int64) error

删除事件

func DeleteAdminCategory

func DeleteAdminCategory(cid int64) error

删除

func DeleteAdminDepart

func DeleteAdminDepart(cid int64) error

删除

func DeleteAdminIpsegment

func DeleteAdminIpsegment(cid int64) error

删除

func DeleteAdminSynchIp

func DeleteAdminSynchIp(cid int64) error

删除

func DeleteArticle

func DeleteArticle(id int64) error

删除

func DeleteAttachment

func DeleteAttachment(cid int64) error

删除

func DeleteCarCalendar

func DeleteCarCalendar(cid int64) error

删除事件

func DeleteDiary

func DeleteDiary(id int64) error

删除

func DeleteDoc

func DeleteDoc(cid int64) error

删除_把附件也一并删除(在controllers中实现吧)

func DeleteMeetCalendar

func DeleteMeetCalendar(cid int64) error

删除事件

func DeleteOnlyAttachment

func DeleteOnlyAttachment(cid int64) error

删除附件

func DeletePostMerit

func DeletePostMerit(cid int64) error

删除成果列表

func DeleteProduct

func DeleteProduct(cid int64) error

删除_把附件也一并删除(在controllers中实现吧)

func DeleteProjCalendar

func DeleteProjCalendar(cid int64) error

删除事件

func DeleteProjGant

func DeleteProjGant(id int64) error

删除

func DeleteProject

func DeleteProject(id int64) error

删除

func DeleteRelevancy

func DeleteRelevancy(prodid int64) error

删除

func DeleteRole

func DeleteRole(Id int64) (int64, error)

func DeleteStandard

func DeleteStandard(id int64) error

func DeleteTodo

func DeleteTodo(todoid int64) error

删除待办

func DeleteTopicLike

func DeleteTopicLike(openid string) error

func DeleteTopicReply

func DeleteTopicReply(id int64) error

func DeleteUserRole

func DeleteUserRole(uid, rid int64) error

func DeleteValid

func DeleteValid(id int64) error

func DeleteWikiReply

func DeleteWikiReply(rid string) error

func DropAdminCalendar

func DropAdminCalendar(cid int64, start, end time.Time) error

拖曳

func DropCarCalendar

func DropCarCalendar(cid int64, start, end time.Time) error

拖曳

func DropMeetCalendar

func DropMeetCalendar(cid int64, start, end time.Time) error

拖曳

func DropProjCalendar

func DropProjCalendar(cid int64, start, end time.Time) error

拖曳

func GetAttachmentsCount

func GetAttachmentsCount(id int64) (cnt int64, err error)

根据成果id取得所有附件数量

func GetProductsCount

func GetProductsCount(id int64, searchText string) (count int64, err error)

取得侧栏id下成果总数

func GetProjectsCount

func GetProjectsCount(searchText string) (count int64, err error)

取得项目总数

func Getuserlist

func Getuserlist(page int64, page_size int64, sort string) (users []orm.Params, count int64)

get user list

func InsertRole

func InsertRole() error

func InsertUser

func InsertUser()

*********初始化数据库中的用户********

func Insertprojtemplet

func Insertprojtemplet(pid int64, parentidpath, parenttitlepath string, nodes []*FileNode)

递归将项目模板目录写入数据库

func ModifyCatalog

func ModifyCatalog(cid int64, fieldname, value string) error

用户修改一条成果的某个字段

func ModifyCatalogLink(id, cid int64, fieldname, value string) error

修改links

func ModifyDatabase

func ModifyDatabase() (err1 error)

删除数据表和字段测试

func ModifyWiki

func ModifyWiki(tid, title, content string) error

只修改编号、名称和内容,不修改附件及分类树状目录

func Projhasson

func Projhasson(id int64) bool

根据id查是否有下级

func ResizeAdminCalendar

func ResizeAdminCalendar(cid int64, end time.Time) error

resize

func ResizeCarCalendar

func ResizeCarCalendar(cid int64, end time.Time) error

resize

func ResizeMeetCalendar

func ResizeMeetCalendar(cid int64, end time.Time) error

resize

func ResizeProjCalendar

func ResizeProjCalendar(cid int64, end time.Time) error

resize

func SaveLibrary

func SaveLibrary(library Library) (lid int64, err error)

有效版本库存入数据库

func SaveRole

func SaveRole(role Role) (rid int64, err error)

添加权限

func SaveStandard

func SaveStandard(standard Standard) (sid int64, err error)

标准存入数据库

func SaveUser

func SaveUser(user User) (uid int64, err error)

这个是使用的,下面那个adduser不知干啥的

func TodoCreate

func TodoCreate(name string, userid int64) (id int64, err error)

func UpdateAdminCalendar

func UpdateAdminCalendar(cid int64, title, content, color string, allday, public bool, start, end time.Time) error

修改

func UpdateAdminCategory

func UpdateAdminCategory(cid int64, title, code string, grade int) error

修改

func UpdateAdminDepart

func UpdateAdminDepart(cid int64, title, code string) error

修改

func UpdateAdminIpsegment

func UpdateAdminIpsegment(cid int64, title, startip, endip string, iprole int) error

修改Ip地址段

func UpdateAdminSynchIp

func UpdateAdminSynchIp(cid int64, username, synchip, port string) error

修改

func UpdateArticle

func UpdateArticle(id int64, subtext, content string) error

修改

func UpdateAttachment

func UpdateAttachment(cid int64, filename string, filesize, downloads int64) (err error)

修改_这个意义不大,对于附件的修改,一般是追加或删除

func UpdateAttachmentTime

func UpdateAttachmentTime(cid int64) (err error)

修改附件的日期和changesurl修改记录地址

func UpdateCarCalendar

func UpdateCarCalendar(cid int64, title, content, color string, allday, public bool, start, end time.Time) error

修改

func UpdateDatabase

func UpdateDatabase() (err1, err2, err3, err4, err5, err6, err7 error)

func UpdateDiary

func UpdateDiary(id int64, title, content string) error

修改

func UpdateDoc

func UpdateDoc(cid int64, code, title, label, principal string, end time.Time) error

修改成果信息

func UpdateDocTime

func UpdateDocTime(cid int64) error

修改成果时间信息

func UpdateMeetCalendar

func UpdateMeetCalendar(cid int64, title, content, color string, allday, public bool, start, end time.Time) error

修改

func UpdateMeritBasic

func UpdateMeritBasic(cid int64, fieldname, value string) error

用户修改一个用户的某个字段

func UpdateOnlyAttachment

func UpdateOnlyAttachment(cid int64, filename string) (err error)

修改附件的日期和changesurl修改记录地址

func UpdatePostMerit

func UpdatePostMerit(id int64, fieldname, value string) error

用户修改一个用户的某个字段

func UpdateProduct

func UpdateProduct(cid int64, code, title, label, principal string) error

修改成果信息

func UpdateProductTime

func UpdateProductTime(cid int64) error

修改成果时间信息

func UpdateProductTtile

func UpdateProductTtile(pid int64, title string) error

修改成果名称

func UpdateProjCalendar

func UpdateProjCalendar(cid int64, title, content, color, url string, allday, public, memorabilia bool, start, end time.Time) error

修改

func UpdateProjGant

func UpdateProjGant(cid int64, code, title, label string) error

修改——还没改

func UpdateProject

func UpdateProject(cid int64, code, title, label, principal string) error

修改——还没改,有问题,不能用

func UpdateProjectTtile

func UpdateProjectTtile(pid int64, title string) error

修改项目名称——有问题,不能用

func UpdateRole

func UpdateRole(role Role) (err error)

func UpdateStandard

func UpdateStandard(id int64, number, title, route string) error

func UpdateTodo

func UpdateTodo(todoid int64) error

修改

func UpdateUser

func UpdateUser(cid int64, fieldname, value string) error

用户修改一个用户的某个字段

func UpdateUserlastlogintime

func UpdateUserlastlogintime(username string) error

更新用户登陆时间

func ValidateUser

func ValidateUser(user User) error

Types

type Activity

type Activity struct {
	Id         int64 `json:"F_ID"`
	CreaterId  int64
	Caption    string `json:"F_Caption"`
	Desc       string
	Location   string `json:"F_Location"`
	Lat        float64
	Lng        float64
	StartDate  time.Time `json:"F_StartDate",orm:"auto_now_add;type(date)"`
	EndDate    time.Time `json:"F_EndDate",orm:"auto_now_add;type(date)"`
	IfFace     bool
	IfLocation bool
	IfPhoto    bool
}

func CheckLike

func CheckLike(name string) (activity []*Activity, err error)
getallLike:function (str,callback) {
    var sql = 'SELECT * FROM T_activity WHERE F_Caption LIKE ? ';
    str = '%' + str + '%';
    var params = [str];
    db.connection.query(sql,params,function (err,res) {
        if(err){
            console.log(err);
            return;
        }
        callback(res);
    })
},

func GetAll

func GetAll() (activity []*Activity, err error)
getall: function (user_id,callback) {
    var sql = 'SELECT * FROM v_apply_activity WHERE F_ApplyerId=? ';
    var params = [user_id];
    db.connection.query(sql,params,function (err,res) {
        if(err){
            console.log(err);
            return;
        }
        callback(res);
    })
},

type AdminCalendar

type AdminCalendar struct {
	Id        int64     `json:"id",form:"-"`
	Title     string    `json:"title",form:"title;text;title:",valid:"MinSize(1);MaxSize(100)"` //orm:"unique",
	Content   string    `json:"content",orm:"sie(20)"`
	Starttime time.Time `json:"start",orm:"type(datetime)"`
	Endtime   time.Time `json:"end",orm:"null;type(datetime)"`
	Allday    bool      `json:"allDay",orm:"default(0)"`
	Color     string    `json:"color",orm:"null"`
	Public    bool      `default(true)`
}

func GetAdminCalendar

func GetAdminCalendar(start, end time.Time, public bool) (calendars []*AdminCalendar, err error)

取所有——要修改为支持时间段的,比如某个月份

func GetAdminCalendarbyid

func GetAdminCalendarbyid(id int64) (calendar AdminCalendar, err error)

根据id查询事件

func SearchAdminCalendar

func SearchAdminCalendar(title string, public bool) (calendars []*AdminCalendar, err error)

取所有——要修改为支持时间段的,比如某个月份 未测试!!!20181117修改filter为cond2

type AdminCarousel

type AdminCarousel struct {
	Id      int64     `json:"id",form:"-"`
	Title   string    `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique",
	Url     string    `orm:"null"`
	Created time.Time `orm:"auto_now_add;type(datetime)"`
	Updated time.Time `orm:"auto_now_add;type(datetime)"`
}

首页轮播图片

func GetAdminCarousel

func GetAdminCarousel() (carousels []*AdminCarousel, err error)

type AdminCategory

type AdminCategory struct {
	Id       int64     `form:"-"`
	ParentId int64     `orm:"null"`
	Title    string    `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique",
	Code     string    `orm:"null"`
	Grade    int       `orm:"null"`
	Created  time.Time `orm:"auto_now_add;type(datetime)"`
	Updated  time.Time `orm:"auto_now;type(datetime)"`
}

func GetAdminCategory

func GetAdminCategory(pid int64) (categories []*AdminCategory, err error)

根据父级id取得所有 如果父级id为空,则取所有一级category

func GetAdminCategoryTitle

func GetAdminCategoryTitle(title string) (categories []*AdminCategory, err error)

根据类别名字title查询所有下级分级category

func GetAdminCategorybyId

func GetAdminCategorybyId(id int64) (category []*AdminCategory, err error)

根据id查分级

type AdminDepartment

type AdminDepartment struct {
	Id       int64     `form:"-"`
	ParentId int64     `orm:"null"`
	Title    string    `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique",
	Code     string    `orm:"null"`
	Created  time.Time `orm:"auto_now_add;type(datetime)"`
	Updated  time.Time `orm:"auto_now_add;type(datetime)"`
}

科室结构

func GetAdminDepart

func GetAdminDepart(pid int64) (departs []*AdminDepartment, err error)

根据部门id取得所有科室 如果父级id为0,则取所有部门

func GetAdminDepartName

func GetAdminDepartName(title string) (AdminDepartment, error)

根据父级id取得所有 如果父级id为空,则取所有一级category

func GetAdminCategory(pid int64) (categories []*AdminDepartment, err error) {
	o := orm.NewOrm()
	categories = make([]*AdminDepartment, 0)
	qs := o.QueryTable("AdminDepartment")
	_, err = qs.Filter("parentid", pid).All(&categories)
	if err != nil {
		return nil, err
	}
	return categories, err
}

根据部门名字title返回自身

func GetAdminDepartTitle

func GetAdminDepartTitle(title string) (categories []*AdminDepartment, err error)

根据部门名字title查询所有下级科室category

func GetAdminDepartbyId

func GetAdminDepartbyId(id int64) (category AdminDepartment, err error)

根据id查科室

func GetAdminDepartbyidtitle

func GetAdminDepartbyidtitle(id int64, title string) (*AdminDepartment, error)

由分院id和科室 名称取得科室

type AdminIpsegment

type AdminIpsegment struct {
	Id      int64     `form:"-"`
	Title   string    `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique",
	StartIp string    //`orm:"not null"`
	EndIp   string    `orm:"null"`
	Iprole  int       `orm:"null"`
	Created time.Time `orm:"auto_now_add;type(datetime)"`
	Updated time.Time `orm:"auto_now;type(datetime)"`
}

func GetAdminIpsegment

func GetAdminIpsegment() (ipsegments []*AdminIpsegment, err error)

查询所有Ip地址段

type AdminSynchIp

type AdminSynchIp struct {
	Id       int64     `form:"-"`
	ParentId int64     `orm:"null"`
	UserName string    `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique",
	SynchIp  string    //`orm:"not null"`
	Port     string    `orm:"default(80)"`
	Created  time.Time `orm:"auto_now_add;type(datetime)"`
	Updated  time.Time `orm:"auto_now;type(datetime)"`
}

项目同步ip表

func GetAdminSynchIp

func GetAdminSynchIp(pid int64) (synchips []*AdminSynchIp, err error)

根据父级id取得所有AdminSynchIp

type Apply

type Apply struct {
	Id         int64
	ApplyerId  int64
	ActivityId int64
	ApplyDate  time.Time `orm:"auto_now_add;type(date)"`
}

报名活动

type Article

type Article struct {
	Id        int64     `json:"id",form:"-"`
	Subtext   string    `orm:"sie(20)"`
	Content   string    `json:"html",orm:"sie(5000)"`
	ProductId int64     `orm:"null"`
	Views     int64     `orm:"default(0)"`
	Created   time.Time `orm:"auto_now_add;type(datetime)"`
	Updated   time.Time `orm:"auto_now_add;type(datetime)"`
}

func GetArticle

func GetArticle(id int64) (Artic *Article, err error)

根据文章id取得文章

func GetArticles

func GetArticles(pid int64) (Articles []*Article, err error)

取得所有项目

func GetArticles() (Artic []*Article, err error) {
	o := orm.NewOrm()
	qs := o.QueryTable("Article") //这个表名AchievementTopic需要用驼峰式,
	_, err = qs.Filter("parentid", 0).All(&Artic)
	if err != nil {
		return Artic, err
	}
	return Artic, err
}

根据成果id取得所有文章——只返回id和prodid,因为返回content太慢了,没必要吧20171007

func GetWxArticles

func GetWxArticles(pid int64) (Articles []*Article, err error)

微信小程序,根据成果id取得所有文章——返回id和prodid,content……

type Attachment

type Attachment struct {
	Id        int64
	FileName  string
	FileSize  int64
	Downloads int64
	ProductId int64     //*Topic    `orm:"rel(fk)"`
	Created   time.Time `orm:"auto_now_add;type(datetime)"`
	Updated   time.Time `orm:"auto_now;type(datetime)"`
}

附件,attachment 和 topic 是 ManyToOne 关系,也就是 ForeignKey 为 topic

func GetAttachbyId

func GetAttachbyId(Id int64) (attach Attachment, err error)

根据附件id查询附件

func GetAttachmentTitle

func GetAttachmentTitle(title string) (cate Attachment, err error)

根据名字title查询到附件

func GetAttachments

func GetAttachments(id int64) (attachments []*Attachment, err error)

根据成果id取得所有附件

type Bbs

type Bbs struct {
	Id         int64
	UserId     int64
	BbsDate    time.Time `orm:"auto_now_add;type(date)"`
	Desc       string
	SelectDate time.Time `orm:"auto_now_add;type(date)"`
}

公告记录

func BbsGetBbs

func BbsGetBbs(SelectMonth1, SelectMonth2 time.Time) (bbs []*Bbs, err error)

按月查询打卡记录

func GetBbs

func GetBbs(SelectDate time.Time) (bbs Bbs, err error)

查询选定日期记录

type CarCalendar

type CarCalendar struct {
	Id        int64     `json:"id",form:"-"`
	Title     string    `json:"title",form:"title;text;title:",valid:"MinSize(1);MaxSize(100)"` //orm:"unique",
	Content   string    `json:"content",orm:"sie(20)"`
	Starttime time.Time `json:"start",orm:"type(datetime)"`
	Endtime   time.Time `json:"end",orm:"type(datetime)"`
	Allday    bool      `json:"allDay",orm:"default(0)"`
	Color     string    `json:"color",orm:"null"`
	Public    bool      `default(true)`
	Ip        string    `json:"ip",orm:"null"`
}

func GetCarCalendar

func GetCarCalendar(start, end time.Time, public bool) (calendars []*CarCalendar, err error)

取所有——要修改为支持时间段的,比如某个月份

func GetCarCalendarbyid

func GetCarCalendarbyid(id int64) (calendar CarCalendar, err error)

根据id查询事件

type CatalogLink struct {
	Id        int64
	CatalogId int64
	Url       string    `orm:"sie(500)"`
	Created   time.Time `orm:"auto_now_add;type(datetime)"`
	Updated   time.Time `orm:"auto_now_add;type(datetime)"`
}

附件链接表

func GetCatalogLinks(cid int64) (links []*CatalogLink, err error)

根据成果id查出附件链接表

type Check

type Check struct {
	Id         int64
	ActivityId int64
	UserId     int64
	CheckDate  time.Time `orm:"auto_now_add;type(date)"`
	PhotoUrl   string
	Lat        float64
	Lng        float64
	SelectDate time.Time `orm:"auto_now_add;type(date)"`
}

打卡记录

type CheckUser

type CheckUser struct {
	Checkin `xorm:"extends"`
	User    `xorm:"extends"`
}

GetPkgInfosByIDs returns a list of package info by given IDs.

func GetPkgInfosByIDs(ids []int64) ([]*PkgInfo, error) {
	if len(ids) == 0 {
		return []*PkgInfo{}, nil
	}
	pkgInfos := make([]*PkgInfo, 0, len(ids))
	return pkgInfos, x.Where("id > 0").In("id", base.Int64sToStrings(ids)).Find(&pkgInfos)
}

func GetCheckUser2

func GetCheckUser2(selectmonth1, selectmonth2 time.Time, activityid int64, limit, offset int) ([]*CheckUser, error)

按月统计**************

type Checkin

type Checkin struct {
	Id         int64
	ActivityId int64
	UserId     int64
	CheckDate  time.Time `orm:"auto_now_add;type(date)"`
	PhotoUrl   string
	Lat        float64
	Lng        float64
	SelectDate time.Time `orm:"auto_now_add;type(date)"`
}

打卡记录

func CheckGetCheck

func CheckGetCheck(ActivityId, UserId int64, SelectMonth1, SelectMonth2 time.Time) (check []*Checkin, err error)

按月查询打卡记录

func GetCheckUser

func GetCheckUser(selectmonth1, selectmonth2 time.Time, activityid int64) ([]*Checkin, error)

按月统计**************这个没用 查询check里的用户Distinct("check.user_id").Limit(limit, offset)

type Commenttopic

type Commenttopic struct {
	Id       int64
	Tid      int64
	OpenID   string `orm:"size(30)"`
	Content  string `orm:"size(100)"`
	Avatar   string
	Username string `orm:"size(20)"`
	Created  string `orm:"size(20)"`
}

文章评论

func GetAllTopicReplies

func GetAllTopicReplies(tid int64) (replies []*Commenttopic, err error)

type Commentwiki

type Commentwiki struct {
	Id      int64
	Tid     int64
	Name    string
	Content string `orm:"size(1000)"`
	Created time.Time
}

wiki评论

func GetAllWikiReplies

func GetAllWikiReplies(tid int64) (replies []*Commentwiki, err error)

type Diary

type Diary struct {
	Id        int64     `json:"id",form:"-"`
	Title     string    `orm:"sie(20)"`
	Diarydate string    `orm:"sie(20)"`
	Content   string    `json:"html",orm:"sie(5000)"`
	ProjectId int64     `orm:"null"`
	UserId    int64     `orm:"null"`
	Views     int64     `orm:"default(0)"`
	Created   time.Time `orm:"auto_now_add;type(datetime)"`
	Updated   time.Time `orm:"auto_now_add;type(datetime)"`
}

func GetDiary

func GetDiary(id int64) (Diary1 *Diary, err error)

根据id取得日志

func GetWxDiaries

func GetWxDiaries(pid, limit, offset int64) (diaries []*Diary, err error)

微信小程序,根据projectid取得所有设代日志

type DiaryUser

type DiaryUser struct {
	Diary `xorm:"extends"`
	User  `xorm:"extends"`
}

func GetWxDiaries2

func GetWxDiaries2(pid int64, limit, offset int) ([]*DiaryUser, error)

微信小程序,根据projectid取得所有设代日志

type FileNode

type FileNode struct {
	Id        int64  `json:"id"`
	Title     string `json:"text"`
	Code      string `json:"code"` //分级目录代码
	Grade     int
	FileNodes []*FileNode `json:"nodes"`
}

树状目录数据

type Library

type Library struct {
	Id       int64
	Number   string //规范的编号`orm:"unique"`
	Title    string
	LiNumber string    //完整编号,含年份
	Category string    //行业分类
	Year     string    //编号里的年份
	Execute  string    //执行时间
	Content  string    `orm:"sie(5000)"`
	Created  time.Time `orm:"auto_now_add;type(datetime)"`
	Updated  time.Time `orm:"auto_now;type(datetime)"`
}

func GetAllValids

func GetAllValids() ([]*Library, error)

func SearchLiabraryName

func SearchLiabraryName(Name string) ([]*Library, error)

由法规名称精确搜索有效版本库

func SearchLiabraryNumber

func SearchLiabraryNumber(Category, Number string) (*Library, error)

由分类SL和编号搜索有效版本库

type Like

type Like struct {
	Id      int64
	Tid     int64
	OpenID  string `json:"openID"`
	Created time.Time
}
type Topic struct {
	Id                int64
	Uid               int64
	Title             string
	Tnumber           string //`orm:"unique"`
	Category          string
	CategoryId        int64
	Content           string `orm:"sie(5000)"`
	Attachment        string
	Created           time.Time `orm:"auto_now_add;type(datetime)"`
	Updated           time.Time `orm:"auto_now;type(datetime)"`
	Views             int64
	Author            string
	ReplyTime         time.Time
	ReplyCount        int64
	ReplyLastUserName string
	// Attachments     []*Attachment `orm:"reverse(many)"` // fk 的反向关系
}

文章点赞

func GetAllTopicLikes

func GetAllTopicLikes(tid int64) (likes []*Like, err error)

type MeetCalendar

type MeetCalendar struct {
	Id        int64     `json:"id",form:"-"`
	Title     string    `json:"title",form:"title;text;title:",valid:"MinSize(1);MaxSize(100)"` //orm:"unique",
	Content   string    `json:"content",orm:"sie(20)"`
	Starttime time.Time `json:"start",orm:"type(datetime)"`
	Endtime   time.Time `json:"end",orm:"type(datetime)"`
	Allday    bool      `json:"allDay",orm:"default(0)"`
	Color     string    `json:"color",orm:"null"`
	Public    bool      `default(true)`
	Ip        string    `json:"ip",orm:"null"`
}

func GetMeetCalendar

func GetMeetCalendar(start, end time.Time, public bool) (calendars []*MeetCalendar, err error)

取所有——要修改为支持时间段的,比如某个月份

func GetMeetCalendarbyid

func GetMeetCalendarbyid(id int64) (calendar MeetCalendar, err error)

根据id查询事件

func SearchMeetCalendar

func SearchMeetCalendar(title string, public bool) (calendars []*MeetCalendar, err error)

取所有——要修改为支持时间段的,比如某个月份 未测试20181117修改filter为cond3

type MeritBasic

type MeritBasic struct {
	Id         int64  `PK`
	Username   string `orm:"unique"` //这个拼音的简写
	Nickname   string //中文名,注意这里,很多都要查询中文名才行`orm:"unique;size(32)" form:"Nickname" valid:"Required;MaxSize(20);MinSize(2)"`
	Password   string
	Repassword string `orm:"-" form:"Repassword" valid:"Required" form:"-"`
	Ip         string //ip地址
	Port       string
	EcmsIp     string    //用户engineercms的ip地址
	EcmsPort   string    //用户engineercms的端口
	Createtime time.Time `orm:"type(datetime);auto_now_add" `
	Updated    time.Time `orm:"type(datetime);auto_now_add" `
}

用户表

func GetMeritBasic

func GetMeritBasic() (meritbasic MeritBasic, err error)

查出merit基本信息 取到一个数据,不是数组,所以table无法显示

type OnlyAttachment

type OnlyAttachment struct {
	Id        int64
	FileName  string
	FileSize  int64
	Downloads int64
	DocId     int64 //*Topic `orm:"rel(fk)"`
	// Changesurl string    `orm:"null"` //文件修改记录
	Created time.Time `orm:"auto_now_add;type(datetime)"`
	Updated time.Time `orm:"auto_now;type(datetime)"`
}

附件

func GetOnlyAttachbyId

func GetOnlyAttachbyId(Id int64) (attach OnlyAttachment, err error)

根据附件id查询附件

func GetOnlyAttachments

func GetOnlyAttachments(id int64) (attachments []*OnlyAttachment, err error)

根据成果id取得所有附件

type OnlyChanges

type OnlyChanges struct {
	Id         int64
	HistoryKey string `orm:"sie(19)"`
	UserId     string `orm:"sie(10)"`
	UserName   string `orm:"sie(20)"`
	Created    string `orm:"sie(19)"`
}

修改情况

func GetOnlyChanges

func GetOnlyChanges(key string) (onlychanges []*OnlyChanges, err error)

根据附件历史版本key获取历史版本修改信息

type OnlyHistory

type OnlyHistory struct {
	Id            int64
	AttachId      int64
	UserId        int64
	ServerVersion string
	Version       int
	FileUrl       string
	ChangesUrl    string    //`orm:"null"`
	HistoryKey    string    `orm:"sie(19)"`
	Expires       time.Time `orm:"type(datetime)"`
	Created       time.Time `orm:"type(datetime)"`
}

历史版本

func GetOnlyHistory

func GetOnlyHistory(onlyattachmentid int64) (onlyhistories []*OnlyHistory, err error)

根据附件id获取历史版本信息

func GetOnlyHistoryVersion

func GetOnlyHistoryVersion(onlyattachmentid int64) (onlyhistories []OnlyHistory, err error)

获取附件id历史版本号

type OnlyOffice

type OnlyOffice struct {
	Id        int64     `form:"-"`
	Code      string    `orm:"null"`
	Title     string    `orm:"null"`
	Label     string    `orm:"null"`
	End       time.Time `orm:"null;type(datetime)"`
	Principal string    `orm:"null"`
	// Ext     string    `orm:"null"`
	Uid     int64     `orm:"null"`
	Created time.Time `orm:"auto_now_add;type(datetime)"`
	Updated time.Time `orm:"auto_now;type(datetime)"`
}

func GetDocs

func GetDocs() (docs []*OnlyOffice, err error)

取得所有项目

func Getdocbyid

func Getdocbyid(id int64) (doc OnlyOffice, err error)

根据docid获得docuid

type OnlyOfficeAttatch

type OnlyOfficeAttatch struct {
	OnlyOffice     `xorm:"extends"`
	OnlyAttachment `xorm:"extends"`
	User           `xorm:"extends"`
}

func GetDocList

func GetDocList(offset, limit int) (docs []*OnlyOfficeAttatch, err error)

分页取得所有项目

type Pidstruct

type Pidstruct struct {
	ParentId        int64
	ParentTitle     string
	ParentIdPath    string
	ParentTitlePath string
}

func Insertproj

func Insertproj(pid []Pidstruct, nodes []*AdminCategory, igrade, height int) (cid []Pidstruct)

递归将分级目录写入数据库

type PostMerit

type PostMerit struct {
	Id            int64     `json:"id"`
	ProjectNumber string    //项目编号
	ProjectName   string    //项目名称
	DesignStage   string    //阶段
	Section       string    //专业
	Tnumber       string    //成果编号
	Name          string    //成果名称
	Category      string    //成果类型
	Page          string    //成果计量单位
	Count         float64   //成果数量
	Drawn         string    //编制、绘制
	Designd       string    //设计
	Checked       string    //校核
	Examined      string    //审查
	Verified      string    //核定
	Approved      string    //批准
	Complex       float64   //难度系数
	Drawnratio    float64   //编制、绘制占比系数
	Designdratio  float64   //设计系数
	Checkedratio  float64   //校核系数
	Examinedratio float64   //审查系数
	Datestring    string    //保存字符型日期
	Date          time.Time `orm:"null;auto_now_add;type(datetime)"`
	Created       time.Time `orm:"auto_now_add;type(datetime)"`
	Updated       time.Time `orm:"auto_now_add;type(datetime)"`
	Author        string    //上传者
	State         int       //1编写状态,未提交;2编写者提交,
}

func GetPostMerit

func GetPostMerit(id int64) (postmerit PostMerit, err error)

根据成果id取得成果

func GetPostMerits

func GetPostMerits(status int) (postmerit []*PostMerit, err error)

查出所有成果

type Product

type Product struct {
	Id           int64
	Code         string `orm:"null"`                                              //编号                                          //编号                                             //编号
	Title        string `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique",
	Label        string `orm:"null"`                                              //关键字                                           //标签
	Uid          int64  `orm:"null"`
	Principal    string `orm:"null"`       //提供人                                            //负责人id
	ProjectId    int64  `orm:"null"`       //侧栏id
	TopProjectId int64  `orm:"default(0)"` //项目id
	// Content      string    `orm:"sie(5000)"` //内容
	Created time.Time `orm:"auto_now_add;type(datetime)"`
	Updated time.Time `orm:"auto_now;type(datetime)"`
}

func GetAllProducts

func GetAllProducts() (products []*Product, err error)

直接把所有成果都查出来。——全表,避免使用

func GetProd

func GetProd(id int64) (prod Product, err error)

根据成果id取得成果

func GetProducts

func GetProducts(id int64) (products []*Product, err error)

根据侧栏id查出所有成果——按编号排序

func GetProductsPage

func GetProductsPage(id, limit, offset, uid int64, searchText string) (products []*Product, err error)

根据侧栏id分页查出所有成果——按编号排序

func GetProjProducts

func GetProjProducts(id int64, number int) (count int64, products []*Product, err error)

根据项目顶级id查出所有成果 这个不优雅,应该用循环子孙id,查询字段在id数组中,参考SearchProjProductPage 直接把所有成果都查出来。getallproduct

func SearchProduct

func SearchProduct(key string) (prod []*Product, err error)

搜索本地成果

func SearchProductPage

func SearchProductPage(limit, offset int64, key string) (prod []*Product, err error)

搜索本地成果,分页

func SearchProjProduct

func SearchProjProduct(pid, limit, offset int64, key, searchtext string) (count int64, prod []*Product, err error)

搜索某个项目里的成果:article的全文,待完善

func SearchProjProductPage

func SearchProjProductPage(pid, limit, offset int64, key string) (prod []*Product, err error)

搜索某个项目里的成果,分页, 递归出所有子孙项目,这个厉害

type ProjCalendar

type ProjCalendar struct {
	Id          int64     `json:"id",form:"-"`
	ProjectId   int64     `json:"projectid"`
	Title       string    `json:"title",form:"title;text;title:",valid:"MinSize(1);MaxSize(100)"` //orm:"unique",
	Content     string    `json:"content",orm:"sie(20)"`
	Starttime   time.Time `json:"start",orm:"type(datetime)"`
	Endtime     time.Time `json:"end",orm:"null;type(datetime)"`
	Allday      bool      `json:"allDay",orm:"default(true)"`
	Memorabilia bool      `json:"memorabilia",orm:"default(false)"` //是否属于大事记
	Image       string    `json:"image",orm:"null"`                 //图片链接地址
	Color       string    `json:"color",orm:"null"`
	Public      bool      `default(true)` //是否公开

}

func GetAllProjCalendar

func GetAllProjCalendar(pid int64, public bool) (calendars []*ProjCalendar, err error)

取出所有日历日程

func GetProjCalendar

func GetProjCalendar(pid int64, start, end time.Time, public bool) (calendars []*ProjCalendar, err error)

取所有——要修改为支持时间段的,比如某个月份

func GetProjCalendarbyid

func GetProjCalendarbyid(id int64) (calendar ProjCalendar, err error)

根据id查询事件

func ListPostsByOffsetAndLimit

func ListPostsByOffsetAndLimit(pid int64, set, postsPerPage int, public bool) ([]*ProjCalendar, error)

取出分页的日历

type ProjGant

type ProjGant struct {
	Id               int64  `form:"-"`
	ParentId         int64  `orm:"null"`
	Status           string `orm:"null"` //STATUS_ACTIVE, STATUS_DONE, STATUS_FAILED, STATUS_SUSPENDED, STATUS_UNDEFINED
	Level            int    `orm:"null"`
	Code             string `orm:"null"` //编号
	Name             string `orm:"null"` //项目名称
	StartIsMilestone bool
	Start            time.Time `orm:"type(datetime)"`
	EndIsMilestone   bool
	End              time.Time `orm:"null;type(datetime)"`
	Duration         int       `orm:"null"`
	Progress         int       `orm:"null"`
	Depends          string    `orm:"null"`
	HasChild         bool      `orm:"null"`
	Description      string    `orm:"null"`
	Show             bool
	Created          time.Time `orm:"null","auto_now_add;type(datetime)"`
	Updated          time.Time `orm:"null","auto_now_add;type(datetime)"`
}

func GetProjGant

func GetProjGant(id int64) (projgant ProjGant, err error)

根据id取得项目进度

func GetProjGantName

func GetProjGantName(code, name string) (projgant ProjGant, err error)

根据编号code和名字name查询到项目进度

func GetProjGantParent

func GetProjGantParent(name string, parentid int64) (projgant ProjGant, err error)

根据名字name和parentid查询到项目进度

func GetProjGants

func GetProjGants() (projgant []*ProjGant, err error)

取得所有项目进度,按结束时间早到晚排列。

type Project

type Project struct {
	Id              int64     `form:"-"`
	Code            string    `orm:"null"`                                              //编号
	Title           string    `form:"title;text;title:",valid:"MinSize(1);MaxSize(20)"` //orm:"unique",
	Label           string    `orm:"null"`                                              //标签
	Principal       string    `orm:"null"`                                              //负责人id
	ParentId        int64     `orm:"null"`
	ParentIdPath    string    `orm:"null"`
	ParentTitlePath string    `orm:"null"`
	Grade           int       `orm:"null"`
	Created         time.Time `orm:"null","auto_now_add;type(datetime)"`
	Updated         time.Time `orm:"null","auto_now_add;type(datetime)"`
}

func GetAllProjects

func GetAllProjects() (proj []*Project, err error)

取得所有项目目录

func GetProj

func GetProj(id int64) (proj Project, err error)

根据id取得项目目录

func GetProjSonbyId

func GetProjSonbyId(id int64) (projects []*Project, err error)

根据id查出所有儿子

func GetProjbyParentidTitle

func GetProjbyParentidTitle(parentid int64, title string) (proj Project, err error)

根据parentid和title取得proj目录

func GetProjbyParenttitlepath

func GetProjbyParenttitlepath(parenttitlepath, title string) (proj Project, err error)

根据parenttitlepath和title取得proj目录

func GetProjectCodeTitle

func GetProjectCodeTitle(code, title string) (proj Project, err error)

根据名字title查询到项目目录

func GetProjects

func GetProjects() (proj []*Project, err error)

取得所有项目

func GetProjectsPage

func GetProjectsPage(limit, offset int64, searchText string) (proj []*Project, err error)

分页取得项目列表

func GetProjectsbyPid

func GetProjectsbyPid(id int64) (projects []*Project, err error)

根据id查出所有子孙,用ParentIdPath 逻辑错误:110-210-310包含了10???? 20180107完美解决这个问题。同ProdModel.go中GetProjProducts一致 通过Id为projid,查出本级 parentid是projid,查出二级 parentidpath包含projid-,查出三级,以及往下 还是不严谨,projid-前面还有数据呢?必须前后都有限定符号才行 差点按照无闻的视频,将parentidpath存成$id1#$id2#$id3# 存:parentidpath="$"+id1+"#" 查:__contains,"$"+id1+"#" 取:stings.replace(stings.replace(parentidpath,"#",","-1),"$",""-1) 输出:strings.split(上面的,",")

func SearchProject

func SearchProject(key string) (proj []*Project, err error)

搜索本地项目

type Relevancy

type Relevancy struct {
	Id        int64     `form:"-"`
	ProductId int64     `orm:"null"` //编号
	Relevancy string    `orm:"null"` //标签
	Created   time.Time `orm:"null","auto_now_add;type(datetime)"`
	Updated   time.Time `orm:"null","auto_now_add;type(datetime)"`
}

func GetAllRelevancies

func GetAllRelevancies() (relevancies []*Relevancy, err error)

type RelevancyProduct

type RelevancyProduct struct {
	Relevancy `xorm:"extends"`
	Product   `xorm:"extends"`
}

func GetRelevancy

func GetRelevancy(prodid int64) ([]*RelevancyProduct, error)

根据成果id取得关联文件名称product code 根据关联文件名称product code,取得prod和proj

func GetRelevancybyName

func GetRelevancybyName(relevancy string) ([]*RelevancyProduct, error)

根据关联名称取得关联的成果id及成果code

type Role

type Role struct {
	Id         int64
	Rolename   string `json:"name",orm:"unique"` //这个拼音的简写
	Rolenumber string
	Status     string    `json:"role",orm:"default('0');size(2)"` //,form:"Status",valid:"Range('0','1','2','3','4')"`
	Createtime time.Time `orm:"type(datetime);auto_now_add" `
	Updated    time.Time `orm:"type(datetime);auto_now_add" `
}

角色表

func GetRoleByRoleId

func GetRoleByRoleId(roleid int64) (role Role)

取到一个角色数据,不是数组,所以table无法显示

func GetRoleByRolename

func GetRoleByRolename(name string) (role Role, err error)

由rolename取得角色

func GetRoleByUsername

func GetRoleByUsername(username string) (roles []*Role, count int64, err error)

func GetRolenameByUserId

func GetRolenameByUserId(id int64) (roles []*Role, err error)

由用户id取得所拥有的角色rolename

func GetRoles

func GetRoles() (roles []*Role, err error)

取出所有角色

type Standard

type Standard struct {
	Id       int64
	Number   string //`orm:"unique"`
	Title    string
	Uid      int64
	Category string
	Content  string `orm:"sie(5000)"`
	Route    string
	// AttachmentId int64
	// Attachments     []*Attachment `orm:"reverse(many)"` // fk 的反向关系
	Created time.Time `orm:"auto_now_add;type(datetime)"`
	Updated time.Time `orm:"auto_now;type(datetime)"`
	Views   int64
}

func GetAllStandards

func GetAllStandards() ([]*Standard, error)

func GetStandard

func GetStandard(id int64) (standard Standard, err error)

根据id取得规范

func SearchStandardsName

func SearchStandardsName(name string, isDesc bool) ([]*Standard, error)

由名字模糊搜索

func SearchStandardsNamePage

func SearchStandardsNamePage(limit, offset int64, name string, isDesc bool) ([]*Standard, error)

由名字模糊搜索

func SearchStandardsNumber

func SearchStandardsNumber(number string, isDesc bool) ([]*Standard, error)

由编号模糊搜索

func SearchStandardsNumberPage

func SearchStandardsNumberPage(limit, offset int64, number string, isDesc bool) ([]*Standard, error)

由编号模糊搜索

type Todo

type Todo struct {
	Id        int64  `json:"todoid"`
	Name      string `json:"todoname"`
	UserId    int64
	Completed bool      `json:"completed"`
	Created   time.Time `orm:"auto_now_add;type(date)"`
	Updated   time.Time `orm:"auto_now_add;type(date)"`
}

待办事件

type TodoUser

type TodoUser struct {
	Todo `xorm:"extends"`
	User `xorm:"extends"`
}

func GetTodoUser

func GetTodoUser(limit, offset int) ([]*TodoUser, error)

type Todolog

type Todolog struct {
	Id      int64
	TodoId  int64
	UserId  int64
	Action  string    //'Finish' : 'Restart'
	Created time.Time `orm:"auto_now_add;type(date)"`
}

操作记录

type User

type User struct {
	Id            int64
	Username      string `json:"name",orm:"unique"` //这个拼音的简写
	Nickname      string //中文名,注意这里,很多都要查询中文名才行`orm:"unique;size(32)" form:"Nickname" valid:"Required;MaxSize(20);MinSize(2)"`
	Password      string
	Repassword    string `orm:"-" form:"Repassword" valid:"Required" form:"-"`
	Email         string `orm:"size(32)" form:"Email" valid:"Email"`
	Department    string //分院
	Secoffice     string //科室,这里应该用科室id,才能保证即时重名也不怕。否则,查看科室必须要上溯到分院才能避免科室名称重复问题
	Remark        string `orm:"null;size(200)" form:"Remark" valid:"MaxSize(200)"`
	Ip            string //ip地址
	Port          string
	Status        int       `orm:"default(2)" form:"Status" valid:"Range(1,2)"`
	Lastlogintime time.Time `orm:"type(datetime);auto_now_add" form:"-"`
	Createtime    time.Time `orm:"type(datetime);auto_now_add" `
	Updated       time.Time `orm:"type(datetime);auto_now_add" `
	Role          string    `json:"role"`
}

用户表

func GetAllusers

func GetAllusers(page int64, page_size int64, sort string) (users []*User, count int64)

func GetUname

func GetUname(user User) ([]*User, error)

func GetUserByIp

func GetUserByIp(ip string) (user User, err error)

根据ip查询用户

func GetUserByNickname

func GetUserByNickname(nickname string) (user User)

根据用户nickname取得用户

func GetUserByOpenID

func GetUserByOpenID(openid string) (user User, err error)

根据openid查user

func GetUserByUserId

func GetUserByUserId(userid int64) (user User)

取到一个用户数据,不是数组,所以table无法显示

func GetUserByUsername

func GetUserByUsername(username string) (user User, err error)

###*****这里特别注意,这个是用户名,是汉语拼音,不是Nickname!!!!

func GetUsers

func GetUsers() (users []*User, err error)

********************************************************** 取出所有用户

func GetUsersbySec

func GetUsersbySec(department, secoffice string) (users []*User, count int, err error)

根据分院和科室名称查所有用户,只有状态1的

func GetUsersbySecId

func GetUsersbySecId(secofficeid string) (users []*User, count int, err error)

根据科室id查所有用户

func GetUsersbySecOnly

func GetUsersbySecOnly(department string) (users []*User, count int, err error)

根据分院名称查所有用户——适用于没有科室的部门 查出所有人员,只有分院(部门)而没科室字段的人员,只有状态1的

func (*User) Valid

func (u *User) Valid(v *validation.Validation)

type UserAvatar

type UserAvatar struct {
	Id         int64
	Uid        int64
	AvatarUrl  string
	Createtime time.Time `orm:"type(datetime);auto_now_add" `
}

用户和AvatorUrl对应表,一个用户对应多个AvatorUrl

type UserAvatarUrl

type UserAvatarUrl struct {
	User       `xorm:"extends"`
	UserAvatar `xorm:"extends"`
}

func GetUserAvatorUrl

func GetUserAvatorUrl(uid int64) ([]*UserAvatarUrl, error)

type UserOpenID

type UserOpenID struct {
	Id     int64
	Uid    int64
	OpenID string
}

用户和openid对应表,一个用户对应多个openid

type UserRole

type UserRole struct {
	Id     int64
	UserId int64
	RoleId int64 `xorm:"extends"`
}

func GetRoleByUserId

func GetRoleByUserId(id int64) (roles []*UserRole, err error)

由用户id取得所拥有的角色id

type Wiki

type Wiki struct {
	Id                int64
	Uid               int64
	Title             string
	Content           string `orm:"sie(5000)"`
	Attachment        string
	Created           time.Time `orm:"auto_now_add;type(datetime)"`
	Updated           time.Time `orm:"auto_now;type(datetime)"`
	Views             int64
	Author            string
	ReplyTime         time.Time
	ReplyCount        int64
	ReplyLastUserName string
}

func GetAllWikis

func GetAllWikis(isDesc bool) ([]*Wiki, error)

缺少排序,由项目名称获取项目下所有成果,如果没有项目名称,则获取所有成果

func GetWiki

func GetWiki(tid string) (*Wiki, error)

查看一个文章

func Getwikisbyuname

func Getwikisbyuname(uname string) ([]*Wiki, error)

由用户名取得文章

func ListWikisByOffsetAndLimit

func ListWikisByOffsetAndLimit(set, postsPerPage int) ([]*Wiki, error)

取出分页的wiki

func SearchWikis

func SearchWikis(tuming string, isDesc bool) ([]*Wiki, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL