feat:完善项目

This commit is contained in:
henry
2021-11-04 11:10:51 +08:00
parent 6ef32d16fc
commit 0234324e60
13 changed files with 374 additions and 40 deletions

View File

@ -14,6 +14,11 @@ type Supplier struct{ *service.Session }
type SupplierHandle func(session *service.Session) *Supplier
type (
// SupplierBasic 基本 信息
SupplierBasic struct {
ID string `json:"id"`
Name string `json:"name"`
}
// SupplierInfo 基本信息
SupplierInfo struct {
ID string `json:"id"`
@ -72,12 +77,25 @@ func (c *Supplier) List(name, mobile string, kind model2.ManageSupplierKind, pag
return &basic.PageDataResponse{Data: list, Count: count}, nil
}
func (c *Supplier) Manufacturer() {
// Select 筛选信息
func (c *Supplier) Select(kind int) ([]*SupplierBasic, error) {
out := make([]*model2.ManageSupplier, 0)
}
func (c *Supplier) Partner() {
if err := model2.ScanFields(model.NewManageSupplier().ManageSupplier, &out, []string{"id", "name"},
&model2.ModelWhereOrder{
Where: model2.NewWhere("kind", kind),
}); err != nil {
return nil, err
}
list := make([]*SupplierBasic, 0)
for _, v := range out {
list = append(list, &SupplierBasic{
ID: v.GetEncodeID(),
Name: v.Name,
})
}
return list, nil
}
// Form 数据处理