Some Model Position Query Fixed
This commit is contained in:
parent
5317fedd21
commit
5107b01df8
|
|
@ -56,7 +56,7 @@ class Product extends Model implements ProductContract
|
|||
/**
|
||||
* Loaded attribute values.
|
||||
*
|
||||
* @var $loadedAttributeValues
|
||||
* @var array
|
||||
*/
|
||||
public static $loadedAttributeValues = [];
|
||||
|
||||
|
|
@ -403,8 +403,8 @@ class Product extends Model implements ProductContract
|
|||
*
|
||||
* @param Group $group
|
||||
* @param bool $skipSuperAttribute
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getEditableAttributes($group = null, $skipSuperAttribute = true): Collection
|
||||
|
|
|
|||
|
|
@ -154,7 +154,8 @@ class ProductFlat extends Model implements ProductFlatContract
|
|||
*/
|
||||
public function images()
|
||||
{
|
||||
return $this->hasMany(ProductImageProxy::modelClass(), 'product_id', 'product_id');
|
||||
return $this->hasMany(ProductImageProxy::modelClass(), 'product_id', 'product_id')
|
||||
->orderBy('position');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -222,7 +223,7 @@ class ProductFlat extends Model implements ProductFlatContract
|
|||
/**
|
||||
* Retrieve product attributes.
|
||||
*
|
||||
* @param Group $group
|
||||
* @param Group $group
|
||||
* @param bool $skipSuperAttribute
|
||||
* @return Collection
|
||||
*/
|
||||
|
|
@ -255,7 +256,7 @@ class ProductFlat extends Model implements ProductFlatContract
|
|||
/**
|
||||
* Is product saleable.
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
public function isSaleable()
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
namespace Webkul\Product;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Webkul\Product\Repositories\ProductRepository;
|
||||
use Webkul\Product\Helpers\AbstractProduct;
|
||||
use Webkul\Product\Repositories\ProductRepository;
|
||||
|
||||
class ProductImage extends AbstractProduct
|
||||
{
|
||||
/**
|
||||
* ProductRepository instance
|
||||
* Product repository instance.
|
||||
*
|
||||
* @var \Webkul\Product\Repositories\ProductRepository
|
||||
*/
|
||||
|
|
@ -23,13 +23,12 @@ class ProductImage extends AbstractProduct
|
|||
*/
|
||||
public function __construct(
|
||||
ProductRepository $productRepository
|
||||
)
|
||||
{
|
||||
) {
|
||||
$this->productRepository = $productRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve collection of gallery images
|
||||
* Retrieve collection of gallery images.
|
||||
*
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @return array
|
||||
|
|
@ -87,7 +86,7 @@ class ProductImage extends AbstractProduct
|
|||
* present or not. If not then it will load from the product.
|
||||
*
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
* @param array
|
||||
* @param array
|
||||
* @return array
|
||||
*/
|
||||
public function getProductBaseImage($product, array $galleryImages = null)
|
||||
|
|
@ -126,7 +125,7 @@ class ProductImage extends AbstractProduct
|
|||
return $this->getProductBaseImage($product);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Load product's base image.
|
||||
*
|
||||
* @param \Webkul\Product\Contracts\Product|\Webkul\Product\Contracts\ProductFlat $product
|
||||
|
|
@ -154,4 +153,4 @@ class ProductImage extends AbstractProduct
|
|||
|
||||
return $image;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue