fix channel price bug
This commit is contained in:
@@ -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[] = '';
|
||||
|
||||
Reference in New Issue
Block a user