Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wang
/
golang-open-platform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c9ad81c1
authored
Feb 24, 2021
by
wang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
去掉page验证
parent
cd95975b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
service/service_sku.go
service/service_sku.go
View file @
c9ad81c1
...
@@ -11,7 +11,6 @@ import (
...
@@ -11,7 +11,6 @@ import (
"golang_open_platform/pkg/common"
"golang_open_platform/pkg/common"
"golang_open_platform/pkg/config"
"golang_open_platform/pkg/config"
"golang_open_platform/pkg/e"
"golang_open_platform/pkg/e"
"math"
"strings"
"strings"
)
)
type
SkuService
struct
{
type
SkuService
struct
{
...
@@ -33,9 +32,9 @@ func (this *SkuService)GetSkuListByClass(req *model.QuerySkuCreq) (rsp *model.Qu
...
@@ -33,9 +32,9 @@ func (this *SkuService)GetSkuListByClass(req *model.QuerySkuCreq) (rsp *model.Qu
}
}
if
(
req
.
Page
>
0
){
if
(
req
.
Page
>
0
){
//验证下page是否有效
//验证下page是否有效
if
(
math
.
Ceil
(
float64
(
pageData
.
Count
/
rsp
.
PageSize
))
<
float64
(
req
.
Page
)){
/*
if(math.Ceil(float64(pageData.Count/rsp.PageSize))<float64(req.Page)){
return nil,e.NewApiError("page invalid",open.PARAM1)
return nil,e.NewApiError("page invalid",open.PARAM1)
}
}
*/
mongoOpenSku
,
err
:=
dao
.
GetMongoOpenSku
(
req
.
ClassId
,
req
.
Page
)
mongoOpenSku
,
err
:=
dao
.
GetMongoOpenSku
(
req
.
ClassId
,
req
.
Page
)
if
(
err
!=
nil
){
if
(
err
!=
nil
){
return
nil
,
e
.
NewApiError
(
"service error"
,
open
.
OTHERERROR
)
return
nil
,
e
.
NewApiError
(
"service error"
,
open
.
OTHERERROR
)
...
@@ -72,10 +71,6 @@ func (this *SkuService) GetSkuListFull(req * model.QuerySkuReq)(rsp *model.Query
...
@@ -72,10 +71,6 @@ func (this *SkuService) GetSkuListFull(req * model.QuerySkuReq)(rsp *model.Query
common
.
PrintStdout
()
.
Printf
(
err
.
Error
())
common
.
PrintStdout
()
.
Printf
(
err
.
Error
())
return
rsp
,
e
.
NewApiError
(
"service error"
,
open
.
REMOTESKUINFO
)
return
rsp
,
e
.
NewApiError
(
"service error"
,
open
.
REMOTESKUINFO
)
}
}
//"class_id1": 10014,
// "class_id2": 10031,
// "class_id1_name": "处理器及微控制器",
// "class_id2_name": "ADI(亚德诺)",
field
:=
[]
string
{
"goods_id"
,
"spu_id"
,
"brand_id"
,
"brand_name"
,
"goods_name"
,
"stock"
,
"moq"
,
"mpq"
,
field
:=
[]
string
{
"goods_id"
,
"spu_id"
,
"brand_id"
,
"brand_name"
,
"goods_name"
,
"stock"
,
"moq"
,
"mpq"
,
"class_id1"
,
"class_id2"
,
"class_id1_name"
,
"class_id2_name"
,
"attrs"
,
"ladder_price"
,
"supplier_name"
}
"class_id1"
,
"class_id2"
,
"class_id1_name"
,
"class_id2_name"
,
"attrs"
,
"ladder_price"
,
"supplier_name"
}
rsp
.
SkuData
=
model
.
SkuFilter
(
*
remoteData
,
field
)
rsp
.
SkuData
=
model
.
SkuFilter
(
*
remoteData
,
field
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment