store and chore
CI / changes (push) Successful in 39s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 25s
CI / chore (push) Successful in 24s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 1s
CI / factory (push) Successful in 0s
CI / payment (push) Successful in 0s
CI / product (push) Successful in 1s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 24s
CI / task (push) Successful in 0s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 0s
CI / changes (push) Successful in 39s
CI / ad (push) Successful in 1s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 25s
CI / chore (push) Successful in 24s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 1s
CI / factory (push) Successful in 0s
CI / payment (push) Successful in 0s
CI / product (push) Successful in 1s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 24s
CI / task (push) Successful in 0s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 0s
This commit is contained in:
@@ -2,9 +2,13 @@ package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"lone-services/pkg/modelbase"
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/rpc/store/pb"
|
||||
"lone-services/services/store/internal/dao"
|
||||
"lone-services/services/store/internal/model"
|
||||
"lone-services/services/store/internal/svc"
|
||||
"strconv"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
@@ -25,7 +29,50 @@ func NewDepositIgnoreItemsLogic(ctx context.Context, svcCtx *svc.ServiceContext)
|
||||
}
|
||||
|
||||
func (l *DepositIgnoreItemsLogic) DepositIgnoreItems(in *store.DepositVerifyRequest) (*store.Response, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
adminInfo := utils.GetUserFromCtx(l.ctx)
|
||||
if adminInfo.ID < utils.NumberOne {
|
||||
return l.fail(utils.ErrorNoLoginInfo)
|
||||
}
|
||||
|
||||
return &store.Response{}, nil
|
||||
var info []dao.DepositInfo
|
||||
w := modelbase.Params{
|
||||
Eq: map[string]string{"status": strconv.Itoa(utils.StatusNotPass)},
|
||||
Page: int(in.Page),
|
||||
Size: int(in.Size),
|
||||
Order: "id desc",
|
||||
}
|
||||
|
||||
storeMap := make(map[int64]string)
|
||||
items, err := model.DepositModel{}.Init().Page(w, &info)
|
||||
if err != nil {
|
||||
l.Logger.Error(err)
|
||||
return l.fail(utils.Fail)
|
||||
}
|
||||
|
||||
if len(storeMap) < utils.NumberOne {
|
||||
var storeIds []string
|
||||
for _, values := range info {
|
||||
storeIds = append(storeIds, strconv.Itoa(int(values.StoreId)))
|
||||
}
|
||||
ww := modelbase.Params{In: map[string][]string{"id": storeIds}}
|
||||
var storeItems []dao.StoreNames
|
||||
err := model.StoreModel{}.Init().Items(ww, &storeItems)
|
||||
if err != nil {
|
||||
l.Logger.Error(err)
|
||||
return l.fail(utils.Fail)
|
||||
}
|
||||
|
||||
for _, item := range storeItems {
|
||||
storeMap[item.Id] = item.Name
|
||||
}
|
||||
}
|
||||
|
||||
for key, val := range info {
|
||||
if name, ok := storeMap[val.StoreId]; ok {
|
||||
info[key].StoreName = name
|
||||
}
|
||||
}
|
||||
|
||||
items.Items = info
|
||||
return l.ok(items)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user