1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package business_trip
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type BusinessApplyApproveReq struct {
- BusinessApplyId int `description:"出差申请id"`
- ApproveStatus int `description:"审批状态:1:通过,2:驳回"`
- RefuseReason string `description:"驳回理由"`
- }
- type BusinessTripApproveView struct {
- BusinessApplyId int `description:"出差申请id"`
- ApplyAdminId int `description:"申请人id"`
- ApplyRealName string `description:"申请人姓名"`
- ArriveDate time.Time `description:"到达日期"`
- ReturnDate time.Time `description:"返程日期"`
- Province string `description:"目的地省"`
- City string `description:"目的地市"`
- Reason string `description:"出差事由"`
- Transportation string `description:"交通工具"`
- PeerPeopleId string `description:"同行人id"`
- PeerPeopleName string `description:"同行人"`
- PeerPeopleList []*PeerItem
- Status string `description:"状态:'待审批','已审批','已驳回','已撤回','已过期'"`
- ApproveId int `description:"审批人id"`
- ApproveName string `description:"审批人姓名"`
- RefuseReason string `description:"拒绝理由"`
- RefuseTime string `description:"拒绝时间"`
- ApproveTime string `description:"审批时间"`
- CreateTime string `description:"创建时间"`
- ModifyTime string `description:"修改时间"`
- DepartmentId int
- GroupName string `description:"分组"`
- DayTotal int `description:"出差天数"`
- }
- type PeerItem struct {
- PeerPeopleId int `description:"同行人id"`
- PeerPeopleName string `description:"同行人"`
- PeerGroupName string
- }
- func GetBusinessTripApproveList(condition string, pars []interface{}) (list []*BusinessTripApproveView, err error) {
- o := orm.NewOrm()
- sql := ` SELECT a.*,b.department_id FROM business_apply AS a
- INNER JOIN admin AS b ON a.apply_admin_id=b.admin_id `
- if condition != "" {
- sql += condition
- }
- sql += ` ORDER BY a.create_time DESC `
- _, err = o.Raw(sql, pars).QueryRows(&list)
- return
- }
|