querylist sms signName
This commit is contained in:
@@ -16,7 +16,7 @@ VerifyCode:
|
|||||||
AccessKeyID: "LTAI5tKGB3TVJbMHSoZN3yr9"
|
AccessKeyID: "LTAI5tKGB3TVJbMHSoZN3yr9"
|
||||||
AccessKeySecret: "OCQ30GWp4yENMjmfOAaagksE18bp65"
|
AccessKeySecret: "OCQ30GWp4yENMjmfOAaagksE18bp65"
|
||||||
EndpointURL: "dysmsapi.aliyuncs.com"
|
EndpointURL: "dysmsapi.aliyuncs.com"
|
||||||
SignName: "全能查"
|
SignName: "海南省学宇思网络科技"
|
||||||
TemplateCode: "SMS_302641455"
|
TemplateCode: "SMS_302641455"
|
||||||
ValidTime: 300
|
ValidTime: 300
|
||||||
Encrypt:
|
Encrypt:
|
||||||
|
|||||||
@@ -32,34 +32,31 @@ func (l *QueryListLogic) QueryList(req *types.QueryListReq) (resp *types.QueryLi
|
|||||||
if getUidErr != nil {
|
if getUidErr != nil {
|
||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "报告列表查询, 获取用户信息失败, %+v", getUidErr)
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "报告列表查询, 获取用户信息失败, %+v", getUidErr)
|
||||||
}
|
}
|
||||||
build := l.svcCtx.OrderModel.SelectBuilder().Where(squirrel.Eq{
|
|
||||||
|
// 直接构建查询query表的条件
|
||||||
|
build := l.svcCtx.QueryModel.SelectBuilder().Where(squirrel.Eq{
|
||||||
"user_id": userID,
|
"user_id": userID,
|
||||||
}).Where(squirrel.NotEq{
|
|
||||||
"status": []string{"pending", "closed"},
|
|
||||||
})
|
})
|
||||||
orderList, total, err := l.svcCtx.OrderModel.FindPageListByPageWithTotal(l.ctx, build, req.Page, req.PageSize, "create_time DESC")
|
|
||||||
|
// 直接从query表分页查询
|
||||||
|
queryList, total, err := l.svcCtx.QueryModel.FindPageListByPageWithTotal(l.ctx, build, req.Page, req.PageSize, "create_time DESC")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "报告列表查询, 查找订单列表错误, %v", err)
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "报告列表查询, 查找报告列表错误, %+v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var list []types.Query
|
var list []types.Query
|
||||||
if len(orderList) > 0 {
|
if len(queryList) > 0 {
|
||||||
for _, orderModel := range orderList {
|
for _, queryModel := range queryList {
|
||||||
queryModel, findQueryErr := l.svcCtx.QueryModel.FindOneByOrderId(l.ctx, orderModel.Id)
|
|
||||||
if findQueryErr != nil {
|
|
||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告列表查询, 查找报告错误, %+v", findQueryErr)
|
|
||||||
|
|
||||||
}
|
|
||||||
var query types.Query
|
var query types.Query
|
||||||
query.CreateTime = queryModel.CreateTime.Format("2006-01-02 15:04:05")
|
query.CreateTime = queryModel.CreateTime.Format("2006-01-02 15:04:05")
|
||||||
query.UpdateTime = queryModel.UpdateTime.Format("2006-01-02 15:04:05")
|
query.UpdateTime = queryModel.UpdateTime.Format("2006-01-02 15:04:05")
|
||||||
copyErr := copier.Copy(&query, queryModel)
|
copyErr := copier.Copy(&query, queryModel)
|
||||||
if copyErr != nil {
|
if copyErr != nil {
|
||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告列表查询, 报告结构体复制失败, %v", err)
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告列表查询, 报告结构体复制失败, %+v", err)
|
||||||
}
|
}
|
||||||
product, findProductErr := l.svcCtx.ProductModel.FindOne(l.ctx, queryModel.ProductId)
|
product, findProductErr := l.svcCtx.ProductModel.FindOne(l.ctx, queryModel.ProductId)
|
||||||
if findProductErr != nil {
|
if findProductErr != nil {
|
||||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告列表查询, 获取商品信息失败, %v", err)
|
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "报告列表查询, 获取商品信息失败, %+v", err)
|
||||||
}
|
}
|
||||||
query.ProductName = product.ProductName
|
query.ProductName = product.ProductName
|
||||||
list = append(list, query)
|
list = append(list, query)
|
||||||
|
|||||||
Reference in New Issue
Block a user