From fcc2181679150ef57403081215049dfc54764580 Mon Sep 17 00:00:00 2001 From: adonis Date: Tue, 7 Jul 2026 18:34:03 +0330 Subject: [PATCH] fix channel price bug --- app/Services/PriceChannelBroadcastService.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Services/PriceChannelBroadcastService.php b/app/Services/PriceChannelBroadcastService.php index 47b7d8b..09be510 100644 --- a/app/Services/PriceChannelBroadcastService.php +++ b/app/Services/PriceChannelBroadcastService.php @@ -24,7 +24,7 @@ class PriceChannelBroadcastService private const SUPPORTED_MESSENGERS = ['bale', 'telegram', 'rubika']; - /** مثقال بازار آبشده (گرم) — وقتی تنظیم change_mesghal خالی باشد */ + /** وزن هر مثقال به گرم — ضریب تبدیل قیمت هر گرم به هر مثقال (مثقال = گرم × این عدد) */ private const DEFAULT_CHANGE_MESGHAL = 4.3318; public function __construct(private readonly ConfigService $config) @@ -256,8 +256,9 @@ class PriceChannelBroadcastService $lines[] = '🔴 خرید ' . $this->formatPrice($low) . ' 🟢 فروش ' . $this->formatPrice($high); if ($this->isGramUnit($product) && $mesghal > 0) { - $lines[] = '💰 هر گرم: ' . $this->formatPrice($low / $mesghal) - . ' / ' . $this->formatPrice($high / $mesghal); + // قیمت پایه «هر گرم» است؛ مثقال = گرم × ضریب (کنوانسیون اپ: مثقال = گرم × 4.3318) + $lines[] = '💰 هر مثقال: ' . $this->formatPrice($low * $mesghal) + . ' / ' . $this->formatPrice($high * $mesghal); } $lines[] = '';