- fix bug len(phoneList) >= 1 in elm orderMessage.

This commit is contained in:
gazebo
2018-07-02 15:25:35 +08:00
parent bddc7acf08
commit 009f67fff5

View File

@@ -33,10 +33,10 @@ func (o *OrderController) OrderMessage(msg *elmapi.CallbackMsg) (retVal *elmapi.
globals2.RoutinePool.CallFun(func() {
if msg.Type == elmapi.MsgTypeOrderValid {
userMobile := ""
if phoneList, ok := innerMsg["phoneList"].([]interface{}); ok && len(phoneList) > 1 {
if phoneList, ok := innerMsg["phoneList"].([]interface{}); ok && len(phoneList) >= 1 {
userMobile = phoneList[0].(string)
} else {
baseapi.SugarLogger.Warnf("can not get mobile info from %v, error:%v", msg, err)
baseapi.SugarLogger.Warnf("elm can not get mobile info from %v, error:%v", msg, err)
}
retVal = o.NewOrder(msg, orderID, userMobile)
} else if msg.Type >= elmapi.MsgTypeMerchantValid && msg.Type <= elmapi.MsgTypeOrderFinished {