|
@ -5,10 +5,10 @@ import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"hudongzhuanjia/controllers" |
|
|
"hudongzhuanjia/controllers" |
|
|
"hudongzhuanjia/models" |
|
|
"hudongzhuanjia/models" |
|
|
invitation_service "hudongzhuanjia/services/invitation" |
|
|
|
|
|
"hudongzhuanjia/utils" |
|
|
"hudongzhuanjia/utils" |
|
|
"hudongzhuanjia/utils/code" |
|
|
"hudongzhuanjia/utils/code" |
|
|
"hudongzhuanjia/utils/define" |
|
|
"hudongzhuanjia/utils/define" |
|
|
|
|
|
"strings" |
|
|
|
|
|
|
|
|
"github.com/ouxuanserver/osmanthuswine/src/core" |
|
|
"github.com/ouxuanserver/osmanthuswine/src/core" |
|
|
) |
|
|
) |
|
@ -78,19 +78,17 @@ func (t *OrderEntryCtl) Order() { |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_INVITE_LETTER_NOT_EXIST, "邀请函不存在") |
|
|
t.Assert(exist, code.MSG_INVITE_LETTER_NOT_EXIST, "邀请函不存在") |
|
|
|
|
|
|
|
|
items, err := invitation_service.GetOptionItem(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
|
|
|
|
|
|
values, err := invitation_service.GetOptionValue(items, letter.ExtraData) |
|
|
|
|
|
|
|
|
values := make([]map[string]interface{}, 0) |
|
|
|
|
|
err = json.Unmarshal([]byte(strings.Trim(letter.ExtraData, `"`)), &values) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
var name, phone, address = "", "", "" |
|
|
var name, phone, address = "", "", "" |
|
|
for _, value := range values { |
|
|
for _, value := range values { |
|
|
if v, ok := value["姓名"]; ok { |
|
|
|
|
|
name = fmt.Sprint(v) |
|
|
|
|
|
} else if v, ok := value["手机"]; ok { |
|
|
|
|
|
phone = fmt.Sprint(v) |
|
|
|
|
|
} else if v, ok := value["地址"]; ok { |
|
|
|
|
|
address = fmt.Sprint(v) |
|
|
|
|
|
|
|
|
if value["name"] == "姓名" { |
|
|
|
|
|
name = fmt.Sprint(value["val"]) |
|
|
|
|
|
} else if value["name"] == "手机" { |
|
|
|
|
|
phone = fmt.Sprint(value["val"]) |
|
|
|
|
|
} else if value["name"] == "地址" { |
|
|
|
|
|
address = fmt.Sprint(value["val"]) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|