Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dex-admin
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
dex-admin
Commits
08fc43c8
Commit
08fc43c8
authored
Jul 05, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b5bd4992
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
app/Service/TradeService.php
+6
-5
No files found.
app/Service/TradeService.php
View file @
08fc43c8
...
@@ -108,7 +108,7 @@ public function updateInscription($data, $order_id = 0)
...
@@ -108,7 +108,7 @@ public function updateInscription($data, $order_id = 0)
// 过滤出铭文信息
// 过滤出铭文信息
preg_match
(
'/{.*}/'
,
$inscription
[
'content_uri'
],
$matches
);
preg_match
(
'/{.*}/'
,
$inscription
[
'content_uri'
],
$matches
);
$content_uri
=
$matches
[
0
];
$content_uri
=
$matches
[
0
];
if
(
$content_uri
&&
$order_id
!=
0
)
{
if
(
$content_uri
&&
$order_id
!=
0
&&
$order_id
)
{
$content_uri
=
json_decode
(
$content_uri
,
true
);
$content_uri
=
json_decode
(
$content_uri
,
true
);
// 获取对应的
// 获取对应的
$inscriptionInfo
=
[];
$inscriptionInfo
=
[];
...
@@ -164,7 +164,6 @@ public function userShelves($payment_address, $hash, $inscription, $price)
...
@@ -164,7 +164,6 @@ public function userShelves($payment_address, $hash, $inscription, $price)
if
(
blank
(
$payment_address
)
||
blank
(
$hash
)
||
blank
(
$inscription
))
{
if
(
blank
(
$payment_address
)
||
blank
(
$hash
)
||
blank
(
$inscription
))
{
throw
new
UserException
(
1
,
'非法操作'
);
throw
new
UserException
(
1
,
'非法操作'
);
}
}
$inscription
=
self
::
updateInscription
(
$inscription
);
// 重复的hash禁止上架
// 重复的hash禁止上架
$is_exist
=
$this
->
model
()
->
where
(
'seller_transfer_inscription_hash'
,
$hash
)
->
first
();
$is_exist
=
$this
->
model
()
->
where
(
'seller_transfer_inscription_hash'
,
$hash
)
->
first
();
if
(
$is_exist
)
{
if
(
$is_exist
)
{
...
@@ -193,6 +192,8 @@ public function userShelves($payment_address, $hash, $inscription, $price)
...
@@ -193,6 +192,8 @@ public function userShelves($payment_address, $hash, $inscription, $price)
];
];
$result
=
$this
->
create
(
$data
);
$result
=
$this
->
create
(
$data
);
if
(
$result
)
{
if
(
$result
)
{
// 创建铭文
$inscription
=
self
::
updateInscription
(
$inscription
,
$result
->
id
);
// 创建日志
// 创建日志
$data
[
'order_id'
]
=
$result
->
id
;
$data
[
'order_id'
]
=
$result
->
id
;
$data
[
'trade_type'
]
=
self
::
TRADE_TYPE_INSCRIPTION
;
$data
[
'trade_type'
]
=
self
::
TRADE_TYPE_INSCRIPTION
;
...
@@ -288,7 +289,7 @@ public function sellerShelvesSuccess($data)
...
@@ -288,7 +289,7 @@ public function sellerShelvesSuccess($data)
$inscription
=
$data
[
'inscription'
]
??
null
;
$inscription
=
$data
[
'inscription'
]
??
null
;
// 更新铭文信息
// 更新铭文信息
if
(
$inscription
)
{
if
(
$inscription
)
{
$inscription
=
self
::
updateInscription
(
$data
[
'inscription'
]);
$inscription
=
self
::
updateInscription
(
$data
[
'inscription'
]
,
$data
[
'id'
]
);
$update
[
'inscription'
]
=
$inscription
;
$update
[
'inscription'
]
=
$inscription
;
}
}
$result
=
$this
->
model
()
->
where
(
'id'
,
$data
[
'id'
])
->
update
(
$update
);
$result
=
$this
->
model
()
->
where
(
'id'
,
$data
[
'id'
])
->
update
(
$update
);
...
@@ -503,7 +504,7 @@ public function platformTransferInscription($status, $hash, $order, $inscription
...
@@ -503,7 +504,7 @@ public function platformTransferInscription($status, $hash, $order, $inscription
$order
->
buyer_status
=
$buyer_status
;
$order
->
buyer_status
=
$buyer_status
;
// 更新铭文数据
// 更新铭文数据
if
(
$inscription
)
{
if
(
$inscription
)
{
$inscription
=
self
::
updateInscription
(
$inscription
);
$inscription
=
self
::
updateInscription
(
$inscription
,
$order
->
id
);
$order
->
inscription
=
$inscription
;
$order
->
inscription
=
$inscription
;
}
}
$order
->
save
();
$order
->
save
();
...
@@ -527,7 +528,7 @@ public function platformTransferInscriptionSeller($status, $hash, $order, $inscr
...
@@ -527,7 +528,7 @@ public function platformTransferInscriptionSeller($status, $hash, $order, $inscr
$order_status
=
self
::
ORDER_STATUS_FAIL
;
$order_status
=
self
::
ORDER_STATUS_FAIL
;
}
}
if
(
$inscription
)
{
if
(
$inscription
)
{
$inscription
=
self
::
updateInscription
(
$inscription
);
$inscription
=
self
::
updateInscription
(
$inscription
,
$order
->
id
);
$order
->
inscription
=
$inscription
;
$order
->
inscription
=
$inscription
;
}
}
$order
->
seller_cancel_hash
=
$hash
;
$order
->
seller_cancel_hash
=
$hash
;
...
...
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