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
c37e14a6
Commit
c37e14a6
authored
Jul 02, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:tcc 是否完成接口
parent
242532e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
7 deletions
+32
-7
GoodsTccIsFinishValidate.php
application/library/Validate/GoodsTccIsFinishValidate.php
+23
-0
Tcc.php
application/modules/Tcc/controllers/Tcc.php
+3
-2
TccService.php
application/services/tcc/TccService.php
+6
-5
No files found.
application/library/Validate/GoodsTccIsFinishValidate.php
0 → 100644
View file @
c37e14a6
<?php
namespace
Validate
;
/**
* Class GoodsTccIsFinishValidate
*
* @package Validate
*/
class
GoodsTccIsFinishValidate
extends
BaseValidate
{
protected
$rule
=
[
'tid'
=>
'require'
,
'goods_sku_id_str'
=>
'require'
,
];
protected
$message
=
[
"tid"
=>
"tcc事务id不能为空"
,
"goods_sku_id_str"
=>
"商品sku_id不能为空"
,
];
}
\ No newline at end of file
application/modules/Tcc/controllers/Tcc.php
View file @
c37e14a6
...
...
@@ -3,6 +3,7 @@
use
App\Base\Base
;
use
App\Exception\custom\GoodsException
;
use
\Validate\GoodsTccValidate
;
use
\Validate\GoodsTccIsFinishValidate
;
use
\App\Services\tcc\TccService
;
...
...
@@ -116,9 +117,9 @@ class TccController extends Base
*/
public
function
tcc_is_finishAction
()
{
(
new
GoodsTccValidate
())
->
validate
();
(
new
GoodsTcc
IsFinish
Validate
())
->
validate
();
$res
=
TccService
::
tccIsFinish
(
$this
->
params
[
"
keys
"
],
$this
->
params
[
"tid"
]);
$res
=
TccService
::
tccIsFinish
(
$this
->
params
[
"
goods_sku_id_str
"
],
$this
->
params
[
"tid"
]);
$this
->
success
([
"result"
=>
$res
]);
}
}
\ No newline at end of file
application/services/tcc/TccService.php
View file @
c37e14a6
...
...
@@ -731,20 +731,21 @@ class TccService
/**
* 判断一个tcc是否完成
* @param $goodsSkuId
* @param $goodsSkuId
Str
* @param $tid
* @return int
*/
public
static
function
tccIsFinish
(
$goodsSkuId
,
$tid
)
public
static
function
tccIsFinish
(
$goodsSkuId
Str
,
$tid
)
{
$tccInfo
=
Tcc
::
getRecord
([
$goodsSkuIds
=
explode
(
","
,
$goodsSkuIdStr
);
$tccInfoList
=
Tcc
::
getRecordMaster
([
"tid"
=>
$tid
,
"goods_sku_id"
=>
$goodsSkuId
,
"goods_sku_id"
=>
$goodsSkuId
s
,
"status"
=>
[
Tcc
::
STATUS_CONFIRM
,
Tcc
::
STATUS_CANCEL
],
"operator_result"
=>
Tcc
::
OPERATOR_RESULT_SUCCESS
,
]);
if
(
!
empty
(
$tccInfo
))
{
if
(
!
empty
(
$tccInfo
List
)
&&
count
(
$tccInfoList
)
==
count
(
$goodsSkuIds
))
{
return
self
::
TCC_RESULT_SUCCESS
;
}
return
self
::
TCC_RESULT_FAIL
;
...
...
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