|
|
@@ -2,6 +2,7 @@ package logic
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
+ "encoding/json"
|
|
|
"fmt"
|
|
|
|
|
|
"git.i2edu.net/i2/i2-bill-erp/internal/svc"
|
|
|
@@ -30,12 +31,14 @@ func NewLoadOptionsetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Loa
|
|
|
}
|
|
|
|
|
|
func (l *LoadOptionsetLogic) LoadOptionset(in *transform.OptionsetReq) (*transform.OptionsetRes, error) {
|
|
|
+ values := []*Options{}
|
|
|
var options struct {
|
|
|
- Value []*Options `json:"value"`
|
|
|
+ Value string `db:"value"`
|
|
|
}
|
|
|
l.svcCtx.SqlConn.QueryRowPartial(&options, "select value from sys_optionset where code=?", in.Code)
|
|
|
+ json.Unmarshal([]byte(options.Value), &values)
|
|
|
optionset := make(map[string]string)
|
|
|
- for _, opt := range options.Value {
|
|
|
+ for _, opt := range values {
|
|
|
value := fmt.Sprintf("%v", opt.Value)
|
|
|
optionset[value] = opt.Text
|
|
|
}
|