added merge wallet 2
This commit is contained in:
@@ -280,6 +280,28 @@ class Controller extends BaseController
|
||||
return self::productSellTitle(self::metalTypeLabel());
|
||||
}
|
||||
|
||||
/**
|
||||
* آیا محصول به کیف اصلی متصل است؟ (setting: main_wallet_products)
|
||||
* موجودی این محصولات = gold کیف اصلی؛ تراکنشهایشان روی کیف اصلی مینشیند.
|
||||
*/
|
||||
public static function isMainWalletProduct(?int $productId): bool
|
||||
{
|
||||
if (!$productId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return app(ConfigService::class)->isMainWalletProduct((int) $productId);
|
||||
}
|
||||
|
||||
/**
|
||||
* شناسه کیف مؤثر برای تراکنش محصول.
|
||||
* محصولات متصل به کیف اصلی → null (کیف اصلی)؛ بقیه → کیف محصول خودشان.
|
||||
*/
|
||||
public static function effectiveProductWalletId(?int $productId): ?int
|
||||
{
|
||||
return self::isMainWalletProduct($productId) ? null : $productId;
|
||||
}
|
||||
|
||||
/** واحد وزن معاملات فلز — از ستینگ unit؛ پیشفرض گرم */
|
||||
public static function tradeWeightUnit(): string
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user