added kashkool
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user