order
CI / changes (push) Successful in 38s
CI / ad (push) Successful in 32s
CI / admin (push) Successful in 27s
CI / bff (push) Successful in 23s
CI / chore (push) Successful in 24s
CI / equipment (push) Successful in 26s
CI / express (push) Successful in 24s
CI / factory (push) Successful in 22s
CI / payment (push) Successful in 24s
CI / product (push) Successful in 24s
CI / record (push) Successful in 23s
CI / sale (push) Successful in 26s
CI / task (push) Successful in 25s
CI / user (push) Successful in 26s
CI / wecom (push) Successful in 26s

This commit is contained in:
2026-09-16 16:39:14 +08:00
parent 9af9cc6059
commit 647abf73f6
12 changed files with 789 additions and 209 deletions
@@ -37,7 +37,7 @@ func (l *GroupItemsLogic) GroupItems(in *factory.GroupItemsRequest) (*factory.Re
if adminInfo.ID < utils.NumberOne {
return l.fail(utils.ErrorNoLoginInfo)
}
var info []dao.GroupInfo
w := modelbase.Params{
Page: int(in.Page),
+28
View File
@@ -1,10 +1,12 @@
package logic
import (
"lone-services/pkg/modelbase"
"lone-services/pkg/utils"
"lone-services/pkg/validate"
order "lone-services/rpc/order/pb"
"reflect"
"strconv"
jsoniter "github.com/json-iterator/go"
)
@@ -46,3 +48,29 @@ func (l *BaseLogic) ok(data any) (*order.Response, error) {
buf, _ := jsoniter.Marshal(data)
return &order.Response{Code: utils.Ok.Code, Msg: utils.Ok.Msg, Data: string(buf)}, nil
}
func (s BaseLogic) SetWhere(w *modelbase.Params, u utils.UserInfo) {
if u.Type == utils.SaleType {
s.SetGroupWhere(w, u, false)
}
}
func (s BaseLogic) SetGroupWhere(w *modelbase.Params, u utils.UserInfo, checkProvince bool) {
if w.Eq == nil {
w.Eq = make(map[string]string)
}
if u.GroupId < utils.NumberOne {
return
}
//如果是公司销售
if u.Type == utils.SaleType {
w.Eq["group_id"] = strconv.Itoa(int(u.GroupId))
} else if u.SaleProvince > utils.NumberZero {
if checkProvince {
w.Eq["sale_province"] = strconv.Itoa(int(u.SaleProvince))
} else {
w.Eq["group_id"] = strconv.Itoa(int(u.GroupId))
}
}
}
@@ -81,6 +81,8 @@ func (l *ItemsLogic) Items(in *order.OrderItemsRequest) (*order.Response, error)
w.Other["create_time < ?"] = strconv.Itoa(int(in.Time[utils.NumberOne]))
}
l.SetWhere(&w, adminInfo)
items, err := model.OrderModel{}.Init().Page(w, &info)
if err != nil {
l.Logger.Error(err)
-59
View File
@@ -1,59 +0,0 @@
[base]
login_out_time=43200 #api接口超时时间分
login_refresh_out_time=83200
name = "sale-service"
listenOn = "0.0.0.0:10300"
mode = "dev"
[log]
path = "logs"
serviceName = "sale-service"
mode = "file"
encoding = "plain"
level = "info"
keepDays = 7
maxSize = 50
maxBackups = 5
compress = false
[oss]
accessKeyId = "LTAI5t7U8KvxSiPE5auwQUuu"
accessKeySecret = "xjfgbQQRpL4TcIspNuClg6bYADa3pk"
roleArn = "acs:ram::1663896742753915:role/oss-upload"
roleSessionName = "oss-upload"
region = "oss-cn-hangzhou"
bucketName = "lone-images"
endpoint = "https://oss-accelerate.aliyuncs.com"
host = "https://images.ailuowan.com"
dir = "upload/"
expireSeconds = 3600
[mysql]
host = '39.106.171.204'
port = 33066
user = 'root'
password = 'MOLXRZNOU4Y4'
database = 'dms-sale'
charset = 'utf8mb4'
prefix = ''
debug = true
[mysql_read]
host = '39.106.171.204'
port = 33066
user = 'root'
password = 'MOLXRZNOU4Y4'
database = 'dms-sale'
charset = 'utf8mb4'
prefix = ''
[redis]
host = '39.106.171.204'
password = 'lLMLcuPpzSj'
port = 6379
db = 0
[encrypt]
data_key = "u2t9T3luZtoRfhBstkFN6TiIMW38BA8a"
[services]
chore = "chore-service"
user = "user-service"
+2 -1
View File
@@ -1,2 +1,3 @@
run.toml
etc/user.yaml
etc/user.yaml
tmp