Transaction purchase delta hotfix.

This commit is contained in:
Graphictoria 2023-01-14 21:35:51 -05:00
parent ad71c712b9
commit a66a672968
2 changed files with 3 additions and 7 deletions

View File

@ -46,11 +46,7 @@ class CommentsController extends Controller
];
foreach($comments as $comment) {
$poster = [
'name' => $comment->user->username,
'thumbnail' => $comment->user->getHeadshotImageUrl(),
'url' => $comment->user->getProfileUrl()
];
$poster = $comment->user->userToJson();
$postDate = $comment['updated_at'];
if(Carbon::now()->greaterThan($postDate->copy()->addDays(2)))

View File

@ -69,14 +69,14 @@ class Transaction extends Model
'asset_id' => $asset->id,
'place_id' => $placeId,
'user_id' => $user->id,
'delta' => $asset->priceInTokens,
'delta' => -$asset->priceInTokens,
'seller_id' => $asset->creatorId
];
// XlXi: Assets have a 30% tax.
return [
self::createPurchase($transaction),
self::createSale(array_merge($transaction, ['delta' => $transaction['delta'] * (1-.3)]))
self::createSale(array_merge($transaction, ['delta' => $transaction['delta'] * -(1-.3)]))
];
}
}