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
c8f3979a
Commit
c8f3979a
authored
Aug 18, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'inventory' into test
parents
a277e07a
8da35fb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
GoodsException.php
application/exception/custom/GoodsException.php
+1
-0
MarketingPindanGoodsService.php
application/services/goods/MarketingPindanGoodsService.php
+7
-2
No files found.
application/exception/custom/GoodsException.php
View file @
c8f3979a
...
@@ -65,5 +65,6 @@ class GoodsException extends BaseException
...
@@ -65,5 +65,6 @@ class GoodsException extends BaseException
46
=>
'已经执行过cancel'
,
46
=>
'已经执行过cancel'
,
47
=>
'sku rollback error'
,
47
=>
'sku rollback error'
,
48
=>
'请满足以下条件后提交,售价-分销总金额-手续费>=结算价'
,
48
=>
'请满足以下条件后提交,售价-分销总金额-手续费>=结算价'
,
49
=>
'库存不得小于已售库存'
,
];
];
}
}
\ No newline at end of file
application/services/goods/MarketingPindanGoodsService.php
View file @
c8f3979a
...
@@ -282,7 +282,12 @@ class MarketingPindanGoodsService
...
@@ -282,7 +282,12 @@ class MarketingPindanGoodsService
private
static
function
editGoodsSku
(
$goodsSkuId
,
$skuData
,
$params
=
[])
private
static
function
editGoodsSku
(
$goodsSkuId
,
$skuData
,
$params
=
[])
{
{
$inventoryCount
=
$skuData
[
"inventory_rest"
]
+
$params
[
"inventory_add"
];
$inventoryCount
=
$skuData
[
"inventory_rest"
]
+
$params
[
"inventory_add"
];
//$inventoryCount = $params["inventory"];
$inventoryTotal
=
$skuData
[
"inventory_total"
]
+
$params
[
"inventory_add"
];
if
(
$inventoryTotal
<
$skuData
[
"inventory_lock"
]
+
$skuData
[
"total_amount_order"
])
{
throw
new
GoodsException
([
'cus'
=>
49
]);
}
if
(
$inventoryCount
<
0
)
{
if
(
$inventoryCount
<
0
)
{
throw
new
GoodsException
([
'cus'
=>
18
]);
throw
new
GoodsException
([
'cus'
=>
18
]);
}
}
...
@@ -308,7 +313,7 @@ class MarketingPindanGoodsService
...
@@ -308,7 +313,7 @@ class MarketingPindanGoodsService
"goods_name"
=>
$params
[
"goods_name"
],
"goods_name"
=>
$params
[
"goods_name"
],
"desc_pic_url"
=>
$params
[
"desc_pic_url"
],
"desc_pic_url"
=>
$params
[
"desc_pic_url"
],
"desc"
=>
$params
[
"desc"
],
"desc"
=>
$params
[
"desc"
],
"inventory_total"
=>
$
skuData
[
"inventory_total"
]
+
$params
[
"inventory_add"
]
,
"inventory_total"
=>
$
inventoryTotal
,
"ota_id"
=>
empty
(
$params
[
"ota_id"
])
?
0
:
$params
[
"ota_id"
],
"ota_id"
=>
empty
(
$params
[
"ota_id"
])
?
0
:
$params
[
"ota_id"
],
"inventory_rest"
=>
$inventoryCount
,
"inventory_rest"
=>
$inventoryCount
,
"original_price"
=>
empty
(
$params
[
"original_price"
])
?
""
:
$params
[
"original_price"
]
*
100
,
"original_price"
=>
empty
(
$params
[
"original_price"
])
?
""
:
$params
[
"original_price"
]
*
100
,
...
...
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