Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
blind-box-api
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
blind-box-api
Commits
e824fc2c
Commit
e824fc2c
authored
Mar 08, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4d6b7112
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
7 deletions
+1
-7
app/Http/Controllers/API/BlindBox/BuyBlindBoxController.php
+1
-7
No files found.
app/Http/Controllers/API/BlindBox/BuyBlindBoxController.php
View file @
e824fc2c
...
@@ -65,6 +65,7 @@ public function CheckCallback($hash, $status)
...
@@ -65,6 +65,7 @@ public function CheckCallback($hash, $status)
}
}
# 更新订单状态
# 更新订单状态
UserWallet
::
query
()
->
where
(
'hash'
,
$hash
)
->
update
([
'status'
=>
$status
]);
UserWallet
::
query
()
->
where
(
'hash'
,
$hash
)
->
update
([
'status'
=>
$status
]);
if
(
$status
==
1
)
{
# 获取当前hash的购买地址-和盲盒id
# 获取当前hash的购买地址-和盲盒id
$item
=
UserWallet
::
query
()
->
where
(
'hash'
,
$hash
)
->
first
();
$item
=
UserWallet
::
query
()
->
where
(
'hash'
,
$hash
)
->
first
();
#获取已购买列表
#获取已购买列表
...
@@ -100,13 +101,6 @@ public function CheckCallback($hash, $status)
...
@@ -100,13 +101,6 @@ public function CheckCallback($hash, $status)
array_push
(
$list
,
$obj
);
array_push
(
$list
,
$obj
);
BlindBoxList
::
query
()
->
where
(
'id'
,
$item
->
blind_box_id
)
->
update
([
'purchased'
=>
json_encode
(
$list
)]);
BlindBoxList
::
query
()
->
where
(
'id'
,
$item
->
blind_box_id
)
->
update
([
'purchased'
=>
json_encode
(
$list
)]);
}
}
# 再次获取购买人数
$purchased
=
BlindBoxList
::
query
()
->
where
(
'id'
,
$item
->
blind_box_id
)
->
first
([
'purchased'
,
'min_participants_num'
]);
# 当购买人数达到最低购买人数时,计算中奖几率
$buy_list
=
json_decode
(
$purchased
->
purchased
);
if
(
count
(
$buy_list
)
>
$purchased
->
min_participants_num
)
{
# 这里只要处理平均分--后续邀请增加购买几率在购买接口
}
}
return
''
;
return
''
;
}
}
...
...
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