feat:完善项目

This commit is contained in:
henry
2022-01-15 16:48:49 +08:00
parent 57daf5119d
commit 6d075dab4f
33 changed files with 196 additions and 154 deletions

View File

@ -10,7 +10,7 @@ import (
type Demand struct {
*session.Enterprise
local string
tenantID uint64
}
type (
@ -29,7 +29,7 @@ type (
}
)
type DemandHandle func(session *session.Enterprise, local string) *Demand
type DemandHandle func(session *session.Enterprise, tenantID uint64) *Demand
// List 列表信息
func (c *Demand) List(title string, status, page, pageSize int) (*controller.ReturnPages, error) {
@ -37,7 +37,7 @@ func (c *Demand) List(title string, status, page, pageSize int) (*controller.Ret
where := []*model2.ModelWhereOrder{
&model2.ModelWhereOrder{
Where: model2.NewWhere("local", c.local),
Where: model2.NewWhere("tenant_id", c.tenantID),
Order: model2.NewOrder("id", model2.OrderModeToDesc),
},
&model2.ModelWhereOrder{Where: model2.NewWhere("uid", c.UID)},
@ -116,7 +116,7 @@ func (c *Demand) Form(params *DemandParams) error {
return model2.Updates(mServiceDemand.ServiceDemand, mServiceDemand.ServiceDemand)
}
mServiceDemand.Local.Local = c.local
mServiceDemand.TenantID = c.tenantID
mServiceDemand.UID = c.UID
if params.IsSubmit > 0 {
@ -141,10 +141,10 @@ func (c *Demand) Delete(id uint64) error {
}
func NewDemand() DemandHandle {
return func(session *session.Enterprise, local string) *Demand {
return func(session *session.Enterprise, tenantID uint64) *Demand {
return &Demand{
Enterprise: session,
local: local,
tenantID: tenantID,
}
}
}