added price_offset_percent
This commit is contained in:
+10
-8
@@ -2,6 +2,7 @@
|
||||
|
||||
use App\Models\Customer;
|
||||
use App\Models\Product;
|
||||
use App\Services\ProductPriceService;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
@@ -33,19 +34,20 @@ Route::get('/refPricer', function () {
|
||||
if ($RPrice['name'] == 'گلد دات ای از آبشده - رسمی - نقد فردا') {
|
||||
$RPrice['price'] = $RPrice['price'] / 4.3318;
|
||||
}
|
||||
$p = Product::where('id', $product->id)->update([
|
||||
'price' => $RPrice['price'],
|
||||
'price_profit' => $RPrice['profit'],
|
||||
]);
|
||||
ProductPriceService::syncFromReference(
|
||||
$product,
|
||||
(int) $RPrice['price'],
|
||||
(int) ($RPrice['profit'] ?? 0)
|
||||
);
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (isset($copper) && isset($dollar)) {
|
||||
$cp = ($copper / 1000000) * $dollar;
|
||||
$p = Product::where('id', 33)->update([
|
||||
'price' => $cp,
|
||||
'price_profit' => 0,
|
||||
]);
|
||||
$copperProduct = Product::find(33);
|
||||
if ($copperProduct) {
|
||||
ProductPriceService::syncFromReference($copperProduct, (int) round($cp), 0);
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json(true);
|
||||
|
||||
Reference in New Issue
Block a user