Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
goods
Commits
df37fb39
Commit
df37fb39
authored
Aug 23, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: rule_limit判断
parent
f0c07e80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
GoodsException.php
application/exception/custom/GoodsException.php
+2
-0
MarketingPindanGoodsService.php
application/services/goods/MarketingPindanGoodsService.php
+10
-0
No files found.
application/exception/custom/GoodsException.php
View file @
df37fb39
...
...
@@ -14,6 +14,7 @@ class GoodsException extends BaseException
const
PRINTER_ALREADY_EXIST
=
36
;
const
EMPTY_OTA_ID
=
37
;
const
OTA_NOT_EXIST
=
38
;
const
RULE_LIMIT_ERROR
=
50
;
protected
$cus
=
[
0
=>
'商品创建失败,请稍后重试'
,
...
...
@@ -66,5 +67,6 @@ class GoodsException extends BaseException
47
=>
'sku rollback error'
,
48
=>
'请满足以下条件后提交,售价-分销总金额-手续费>=结算价'
,
49
=>
'库存不得小于已售库存'
,
self
::
RULE_LIMIT_ERROR
=>
'单人可买上限填写错误'
,
];
}
\ No newline at end of file
application/services/goods/MarketingPindanGoodsService.php
View file @
df37fb39
...
...
@@ -192,6 +192,12 @@ class MarketingPindanGoodsService
if
(
$checkGoodsDesc
)
{
throw
new
GoodsException
([
'cus'
=>
20
]);
}
//判断是否是整数
if
(
!
empty
(
$skuData
[
"rule_limit"
])
&&
(
!
is_numeric
(
$skuData
[
"rule_limit"
])
||
strpos
(
$skuData
[
"rule_limit"
],
"."
)
!==
false
))
{
throw
new
GoodsException
([
'cus'
=>
GoodsException
::
RULE_LIMIT_ERROR
]);
}
$skuParams
=
[
"goods_sku_id"
=>
$skuId
,
"goods_spu_id"
=>
$spuData
[
"goods_spu_id"
],
...
...
@@ -311,6 +317,10 @@ class MarketingPindanGoodsService
throw
new
GoodsException
([
'cus'
=>
34
]);
}
//判断是否是整数
if
(
!
empty
(
$params
[
"rule_limit"
])
&&
(
!
is_numeric
(
$params
[
"rule_limit"
])
||
strpos
(
$params
[
"rule_limit"
],
"."
)
!==
false
))
{
throw
new
GoodsException
([
'cus'
=>
GoodsException
::
RULE_LIMIT_ERROR
]);
}
$skuParams
=
[
"goods_name"
=>
$params
[
"goods_name"
],
...
...
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