Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
wallet
token
Commits
d50da49e
Commit
d50da49e
authored
Nov 08, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8ffb3f27
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
30 deletions
+15
-30
IssueCoinController.php
api/controllers/IssueCoinController.php
+2
-21
CoinIssueCoin.php
common/models/psources/CoinIssueCoin.php
+1
-2
IssueChainTransferController.php
console/controllers/IssueChainTransferController.php
+12
-7
No files found.
api/controllers/IssueCoinController.php
View file @
d50da49e
...
...
@@ -70,13 +70,7 @@ class IssueCoinController extends BaseController
goto
doEnd
;
}
$pre_create_tx
=
isset
(
$result
[
'pre_create_tx'
])
?
$result
[
'pre_create_tx'
]
:
''
;
$pre_send_transaction
=
isset
(
$result
[
'pre_send_transaction'
])
?
$result
[
'pre_send_transaction'
]
:
''
;
if
(
false
==
$pre_create_tx
||
false
==
$pre_send_transaction
)
{
$msg
=
'缺少必要的参数'
;
$code
=
-
1
;
goto
doEnd
;
}
$result
=
[
'name'
=>
isset
(
$result
[
'name'
])
?
$result
[
'name'
]
:
''
,
...
...
@@ -101,20 +95,6 @@ class IssueCoinController extends BaseController
$code
=
0
;
$data
=
$model
->
getPrimaryKey
();
$params
=
[
'pre_create_tx'
=>
$pre_create_tx
,
'pre_send_transaction'
=>
$pre_send_transaction
,
'pre_query_transaction'
=>
'standby'
,
'finish_tx'
=>
'standby'
,
'finish_send_transaction'
=>
'standby'
,
'finish_query_transaction'
=>
'standby'
,
'issue_coin_id'
=>
$data
,
];
$transfer_model
=
new
CoinIssueChainRecord
();
$transfer_model
->
setScenario
(
CoinIssueChainRecord
::
SCENARIOS_PRE_CREATE
);
$transfer_model
->
load
(
$params
,
''
);
$transfer_model
->
save
();
doEnd
:
return
[
'code'
=>
$code
,
'msg'
=>
$msg
,
'data'
=>
$data
];
}
...
...
@@ -220,6 +200,7 @@ class IssueCoinController extends BaseController
$id
=
isset
(
$params
[
'id'
])
?
(
int
)
$params
[
'id'
]
:
0
;
$pre_create_tx
=
isset
(
$params
[
'pre_create_tx'
])
?
$params
[
'pre_create_tx'
]
:
''
;
$pre_send_transaction
=
isset
(
$params
[
'pre_send_transaction'
])
?
$params
[
'pre_send_transaction'
]
:
''
;
if
(
false
==
$id
||
false
==
$pre_create_tx
||
false
==
$pre_send_transaction
)
{
$msg
=
'缺少必要的参数'
;
$code
=
-
1
;
...
...
common/models/psources/CoinIssueCoin.php
View file @
d50da49e
...
...
@@ -47,7 +47,6 @@ class CoinIssueCoin extends CommonActiveRecord
[[
'total'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit_id'
],
'integer'
],
[
'introduction'
,
'string'
,
'length'
=>
[
1
,
20
]],
[
'symbol'
,
'string'
,
'length'
=>
[
1
,
6
]],
[
'msg'
,
'string'
,
'length'
=>
[
1
,
10
]],
[
'name'
,
'string'
,
'length'
=>
[
1
,
20
]],
#['status', 'in', 'range' => [1, 2, 0]],
[
'name'
,
'verfiyName'
],
...
...
@@ -60,7 +59,7 @@ class CoinIssueCoin extends CommonActiveRecord
{
$scenarios
=
[
self
::
SCENARIOS_CREATE
=>
[
'name'
,
'symbol'
,
'total'
,
'owner'
,
'introduction'
,
'category'
,
'type'
,
'platform_id'
,
'chain_id'
,
'charge_unit_id'
,
'charge'
],
self
::
SCENARIOS_UPDATE
=>
[
'status'
,
'msg'
],
self
::
SCENARIOS_UPDATE
=>
[
'status'
],
self
::
SCENARIOS_CANCEL
=>
[
'status'
],
];
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
...
...
console/controllers/IssueChainTransferController.php
View file @
d50da49e
...
...
@@ -156,11 +156,13 @@ class IssueChainTransferController extends Controller
$column
=>
'success'
];
if
(
1
==
$step
)
{
$status
=
CoinIssueCoin
::
STATUS_PEDDING
;
if
(
CoinIssueCoin
::
TYPE_YES
)
{
if
(
CoinIssueCoin
::
TYPE_YES
==
$val
->
coin
->
type
)
{
$data
[
'finish_tx'
]
=
'success'
;
$data
[
'finish_send_transaction'
]
=
'success'
;
$data
[
'finish_query_transaction'
]
=
'success'
;
$status
=
CoinIssueCoin
::
STATUS_SUCCESS
;
}
else
{
$status
=
CoinIssueCoin
::
STATUS_PEDDING
;
}
}
else
{
$status
=
CoinIssueCoin
::
STATUS_SUCCESS
;
...
...
@@ -171,11 +173,13 @@ class IssueChainTransferController extends Controller
$column
=>
'success'
];
if
(
1
==
$step
)
{
$status
=
CoinIssueCoin
::
STATUS_PEDDING
;
if
(
CoinIssueCoin
::
TYPE_YES
)
{
if
(
CoinIssueCoin
::
TYPE_YES
==
$val
->
coin
->
type
)
{
$data
[
'finish_tx'
]
=
'success'
;
$data
[
'finish_send_transaction'
]
=
'success'
;
$data
[
'finish_query_transaction'
]
=
'success'
;
$status
=
CoinIssueCoin
::
STATUS_SUCCESS
;
}
else
{
$status
=
CoinIssueCoin
::
STATUS_PEDDING
;
}
}
else
{
$status
=
CoinIssueCoin
::
STATUS_SUCCESS
;
...
...
@@ -197,15 +201,16 @@ class IssueChainTransferController extends Controller
$column
=>
$result
[
'msg'
]
];
}
if
(
CoinIssueCoin
::
TYPE_YES
)
{
if
(
CoinIssueCoin
::
TYPE_YES
==
$val
->
coin
->
type
)
{
$data
[
'finish_tx'
]
=
'failed'
;
$data
[
'finish_send_transaction'
]
=
'failed'
;
$data
[
'finish_query_transaction'
]
=
'failed'
;
}
goto
doEnd
;
}
doEnd
:
#echo json_encode($data).PHP_EOL;
#echo $status.PHP_EOL;exit;
CoinIssueChainRecord
::
updateAll
(
$data
,
[
'id'
=>
$val
->
id
,
]);
...
...
@@ -218,7 +223,7 @@ class IssueChainTransferController extends Controller
}
//1.1查询后,交易成功
if
(
1
==
$step
&&
$status
==
CoinIssueCoin
::
STATUS_PEDDING
)
{
if
(
1
==
$step
)
{
CoinIssueCoin
::
updateAll
([
'status'
=>
$status
],
[
'id'
=>
$val
->
coin
->
id
,
]);
...
...
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