added kashkool

This commit is contained in:
2026-06-11 22:08:47 +03:30
parent 779a67a23e
commit 2d177ad581
24 changed files with 1575 additions and 3 deletions
@@ -180,6 +180,26 @@ class ProductController extends SuperController
return response()->json($products);
}
public function ProductById($id)
{
$this->getPrice();
$this->auto_close_open();
$product = Product::with(['file'])
->where('id', $id)
->first();
if ($product) {
$product->similar = Product::with(['file'])
->where('group_type', $product->group_type)
->where('id', '!=', $id)
->get();
} else {
return response()->json(false);
}
return response()->json($product);
}
public function getPrice()
{
app(\App\Services\ProductPriceSyncService::class)->syncAll(true);