Commit 9c406110 by haojie

1

parent 299876bb
...@@ -23,6 +23,7 @@ public function toBuy($address, $hash, $id, $invite_code, $Invitees_box_id) ...@@ -23,6 +23,7 @@ public function toBuy($address, $hash, $id, $invite_code, $Invitees_box_id)
$price = BlindBoxList::query()->where('id', $id)->first(['price']); $price = BlindBoxList::query()->where('id', $id)->first(['price']);
# 检查提交的盲盒id是否存在 # 检查提交的盲盒id是否存在
$box_id_item = BlindBoxList::query()->where('id', $Invitees_box_id)->first(['id']); $box_id_item = BlindBoxList::query()->where('id', $Invitees_box_id)->first(['id']);
if ($price) {
# 判断是否存在邀请人 # 判断是否存在邀请人
if ($invite_code && $box_id_item) { if ($invite_code && $box_id_item) {
# 是分享的链接 # 是分享的链接
...@@ -45,14 +46,15 @@ public function toBuy($address, $hash, $id, $invite_code, $Invitees_box_id) ...@@ -45,14 +46,15 @@ public function toBuy($address, $hash, $id, $invite_code, $Invitees_box_id)
# 创建订单 # 创建订单
UserWallet::query()->create(['user_address' => $address, 'status' => 0, 'price' => $price->price, 'blind_box_id' => $id, 'hash' => $hash]); UserWallet::query()->create(['user_address' => $address, 'status' => 0, 'price' => $price->price, 'blind_box_id' => $id, 'hash' => $hash]);
} }
$address = SetAddress::query()->first(); $address = SetAddress::query()->first();
$to = $address->address; $to = $address->address;
# 添加订单后 # 添加订单后
# 异步检查到账情况 # 异步检查到账情况
dispatch(new CheckArrival($hash, $price->price, $address, $to)); dispatch(new CheckArrival($hash, $price->price, $address, $to));
return true; return true;
} else {
return false;
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment