Transaction purchase delta hotfix.
This commit is contained in:
parent
ad71c712b9
commit
a66a672968
|
|
@ -46,11 +46,7 @@ class CommentsController extends Controller
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach($comments as $comment) {
|
foreach($comments as $comment) {
|
||||||
$poster = [
|
$poster = $comment->user->userToJson();
|
||||||
'name' => $comment->user->username,
|
|
||||||
'thumbnail' => $comment->user->getHeadshotImageUrl(),
|
|
||||||
'url' => $comment->user->getProfileUrl()
|
|
||||||
];
|
|
||||||
|
|
||||||
$postDate = $comment['updated_at'];
|
$postDate = $comment['updated_at'];
|
||||||
if(Carbon::now()->greaterThan($postDate->copy()->addDays(2)))
|
if(Carbon::now()->greaterThan($postDate->copy()->addDays(2)))
|
||||||
|
|
|
||||||
|
|
@ -69,14 +69,14 @@ class Transaction extends Model
|
||||||
'asset_id' => $asset->id,
|
'asset_id' => $asset->id,
|
||||||
'place_id' => $placeId,
|
'place_id' => $placeId,
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'delta' => $asset->priceInTokens,
|
'delta' => -$asset->priceInTokens,
|
||||||
'seller_id' => $asset->creatorId
|
'seller_id' => $asset->creatorId
|
||||||
];
|
];
|
||||||
|
|
||||||
// XlXi: Assets have a 30% tax.
|
// XlXi: Assets have a 30% tax.
|
||||||
return [
|
return [
|
||||||
self::createPurchase($transaction),
|
self::createPurchase($transaction),
|
||||||
self::createSale(array_merge($transaction, ['delta' => $transaction['delta'] * (1-.3)]))
|
self::createSale(array_merge($transaction, ['delta' => $transaction['delta'] * -(1-.3)]))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue