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
f4a98964
Commit
f4a98964
authored
Nov 25, 2021
by
顾文旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
02bab96b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
Tcc2Service.php
application/services/tcc/Tcc2Service.php
+18
-1
No files found.
application/services/tcc/Tcc2Service.php
View file @
f4a98964
...
@@ -445,6 +445,11 @@ class Tcc2Service
...
@@ -445,6 +445,11 @@ class Tcc2Service
//T时候执行C2,条件加上乐观锁
//T时候执行C2,条件加上乐观锁
if
(
$tccInfo
[
"status"
]
==
Tcc
::
STATUS_C1_SUCCESS
)
{
if
(
$tccInfo
[
"status"
]
==
Tcc
::
STATUS_C1_SUCCESS
)
{
try
{
$goodsSku
=
PindanGoodsSku
::
getRecord
([
"goods_sku_id"
=>
$goodsSkuId
]);
FileLog
::
info
(
"Tcc inventory_rest add start "
,
"tid:"
.
$tid
.
" num:"
.
$num
.
" goods_sku_id"
.
$goodsSkuId
.
" total_amount_order: "
.
$goodsSku
[
'total_amount_order'
]
.
" inventory_rest:"
.
$goodsSku
[
'inventory_rest'
]
.
" total_amount_sold:"
.
$goodsSku
[
'total_amount_sold'
]
.
" inventory_total:"
.
$goodsSku
[
'inventory_total'
]);
$rowCount
=
PindanGoodsSku
::
save
([
$rowCount
=
PindanGoodsSku
::
save
([
"total_amount_order[-]"
=>
$num
,
"total_amount_order[-]"
=>
$num
,
"inventory_rest[+]"
=>
$num
,
"inventory_rest[+]"
=>
$num
,
...
@@ -453,6 +458,18 @@ class Tcc2Service
...
@@ -453,6 +458,18 @@ class Tcc2Service
PindanGoodsSku
::
rollback
();
PindanGoodsSku
::
rollback
();
throw
new
GoodsException
([
"cus"
=>
32
]);
throw
new
GoodsException
([
"cus"
=>
32
]);
}
}
FileLog
::
info
(
"Tcc inventory_rest add end"
,
"tid:"
.
$tid
.
" num:"
.
$num
.
" goods_sku_id"
.
$goodsSkuId
.
" total_amount_order: "
.
$goodsSku
[
'total_amount_order'
]
.
" inventory_rest:"
.
$goodsSku
[
'inventory_rest'
]
.
" total_amount_sold:"
.
$goodsSku
[
'total_amount_sold'
]
.
" inventory_total:"
.
$goodsSku
[
'inventory_total'
]);
if
(
$goodsSku
[
'inventory_rest'
]
+
$goodsSku
[
'total_amount_sold'
]
>
$goodsSku
[
'inventory_total'
])
{
FileLog
::
error
(
"Tcc inventory_rest add error"
,
" inventory_rest:"
.
$goodsSku
[
'inventory_rest'
]
.
" total_amount_sold:"
.
$goodsSku
[
'total_amount_sold'
]
.
" inventory_total:"
.
$goodsSku
[
'inventory_total'
]);
}
}
catch
(
\Exception
$e
)
{
FileLog
::
error
(
"Tcc inventory_rest add Exception"
,
$e
->
getMessage
());
}
}
}
}
}
...
@@ -546,7 +563,7 @@ class Tcc2Service
...
@@ -546,7 +563,7 @@ class Tcc2Service
$num
=
$item
[
"num"
];
$num
=
$item
[
"num"
];
$params
=
[
$params
=
[
"inventory_rest[+]"
=>
$num
,
"inventory_rest[+]"
=>
$num
,
"total_amount_order[-]"
=>
$num
,
"total_amount_order[-]"
=>
$num
,
];
];
$rowCount
=
PindanGoodsSku
::
save
(
$params
,
[
"goods_sku_id"
=>
$item
[
"goods_sku_id"
]]);
$rowCount
=
PindanGoodsSku
::
save
(
$params
,
[
"goods_sku_id"
=>
$item
[
"goods_sku_id"
]]);
if
(
$rowCount
<=
0
)
{
if
(
$rowCount
<=
0
)
{
...
...
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