|
@@ -35,6 +35,16 @@ func (st *ContractServiceTemplate) List(condition string, pars []interface{}) (l
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func (st *ContractServiceTemplate) OrderList(condition string, pars []interface{}) (list []*ContractServiceTemplate, err error) {
|
|
|
+ list = make([]*ContractServiceTemplate, 0)
|
|
|
+ err = global.DEFAULT_MYSQL.Model(st).
|
|
|
+ Where("is_delete = 0").
|
|
|
+ Where(condition, pars...).
|
|
|
+ Order("sort ASC ").
|
|
|
+ Find(&list).Error
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
type ContractServiceTemplateItem struct {
|
|
|
ServiceTemplateId int `json:"service_template_id" description:"套餐模板ID"`
|
|
|
ProductId int `json:"product_id" description:"产品ID"`
|
|
@@ -89,7 +99,7 @@ func GetContractServiceTemplateAllByProductId(productId int) (items []*ContractS
|
|
|
items = make([]*ContractServiceTemplateItem, 0)
|
|
|
err = global.DEFAULT_MYSQL.Table("contract_service_template").
|
|
|
Where("product_id = ? AND is_delete = 0", productId).
|
|
|
- Order("service_template_id ASC").
|
|
|
+ Order("sort ASC").
|
|
|
Find(&items).Error
|
|
|
return
|
|
|
}
|