etehadie removed
This commit is contained in:
@@ -11,7 +11,6 @@ use App\Models\Product;
|
||||
use App\Models\TransactionsAdmin;
|
||||
use App\Models\Withdraw;
|
||||
use App\Services\ConfigService;
|
||||
use App\Services\EtehadiePriceService;
|
||||
use Carbon\Carbon;
|
||||
use Hekmatinasser\Verta\Verta;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -87,13 +86,14 @@ class DashboardController extends Controller
|
||||
|
||||
$gramPrice = (int) ($tallaPrice->price ?? 0);
|
||||
$FPrices = [];
|
||||
if (app(ConfigService::class)->usesEtehadiePricing()) {
|
||||
$etehadie = app(EtehadiePriceService::class)->fetchMainGramPrice();
|
||||
if (($etehadie['price'] ?? 0) > 0) {
|
||||
$gramPrice = (int) round($etehadie['price'] / 10);
|
||||
$mainProductId = app(ConfigService::class)->mainProductId();
|
||||
if ($mainProductId) {
|
||||
$mainProduct = Product::find($mainProductId);
|
||||
if ($mainProduct) {
|
||||
$gramPrice = (int) ($mainProduct->price + ($mainProduct->price_profit ?? 0));
|
||||
$FPrices[] = [
|
||||
'id' => 'etehadie',
|
||||
'name' => 'اتحادیه',
|
||||
'id' => 'main_product',
|
||||
'name' => $mainProduct->title ?? 'محصول اصلی',
|
||||
'price' => $gramPrice,
|
||||
'profit' => 0,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user