切换导航条
此项目
正在载入...
登录
allied-creation
/
allied-creation-cooperation
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
yangfu
3 years ago
提交
77d96b2de77057dcaa78f1ba8225ee200007ad22
1 个父辈
57f75099
商品分页
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
9 行增加
和
2 行删除
pkg/infrastructure/dao/pg_order_good_dao.go
pkg/infrastructure/domain_service/pg_cooperation_company_statistics_service.go
pkg/infrastructure/dao/pg_order_good_dao.go
查看文件 @
77d96b2
...
...
@@ -26,8 +26,11 @@ func (dao *OrderGoodDao) CooperationGoodsStatistics(queryOptions map[string]inte
if
_
,
ok
:=
queryOptions
[
"beginTime"
];
ok
{
queryTime
=
fmt
.
Sprintf
(
"and created_at>='%v' and created_at<'%v'"
,
queryOptions
[
"beginTime"
],
queryOptions
[
"endTime"
])
}
if
_
,
ok
:=
queryOptions
[
"limit"
];
ok
{
queryLimit
=
fmt
.
Sprintf
(
"limit %v"
,
queryOptions
[
"limit"
])
if
v
,
ok
:=
queryOptions
[
"offset"
];
ok
{
queryLimit
+=
fmt
.
Sprintf
(
"offset %v
\n
"
,
v
)
}
if
v
,
ok
:=
queryOptions
[
"limit"
];
ok
{
queryLimit
+=
fmt
.
Sprintf
(
"limit %v
\n
"
,
v
)
}
sql
:=
fmt
.
Sprintf
(
`select order_good_name good_name,sum(coalesce(order_good_amount,0)) good_amount from order_goods
where company_id=? and org_id = ? and deleted_at is null %v
...
...
pkg/infrastructure/domain_service/pg_cooperation_company_statistics_service.go
查看文件 @
77d96b2
...
...
@@ -27,6 +27,7 @@ func (ptr *CooperationStatisticsService) CooperationGoodsStatistics(queryOptions
RankType
int
`json:"rankType" valid:"Required"`
Top
int
`json:"top" valid:"Required"`
Offset
int
`json:"offset"`
Limit
int
`json:"limit"`
}{}
if
err
:=
LoadQueryObject
(
queryOptions
,
&
request
);
err
!=
nil
{
return
nil
,
err
...
...
@@ -50,6 +51,9 @@ func (ptr *CooperationStatisticsService) CooperationGoodsStatistics(queryOptions
if
request
.
Top
>
0
{
queryOptions
[
"limit"
]
=
request
.
Top
}
if
request
.
Limit
>
0
{
queryOptions
[
"limit"
]
=
request
.
Limit
}
if
request
.
Offset
>
0
{
queryOptions
[
"offset"
]
=
request
.
Offset
}
...
...
请
注册
或
登录
后发表评论