This commit is contained in:
Shohrat 2023-09-12 17:41:56 +05:00
commit e3dce350d7
4 changed files with 13 additions and 12 deletions

View File

@ -277,8 +277,7 @@ class SellerProduct extends SellerProductController
//$images = json_decode($request['images']['files'][0]);
//\Log::info($images);
//\Log::info($request->all());
\Log::info($request['images']);
\Log::info($request['surats']);
// dd($request->get('images'));
// dd($request['images']);
$data = array(

View File

@ -65,17 +65,18 @@ class Vendors extends V1Controller
public function index()
{
$vendors = $this->vendorRepository->select('marketplace_sellers.id','url','logo','banner','shop_title','brand_attribute_id','ship_time','ship_price','slogan')
$vendors = $this->vendorRepository->select('marketplace_sellers.id','url','logo','banner','shop_title', 'ship_time','ship_price','slogan')
->where('is_approved',true)
->with(['categories:seller_id,categories'])
// ->leftJoin('seller_categories','marketplace_sellers.id','=','seller_categories.seller_id')
->get();
$reviewed_vendors = $vendors->map(function ($item, $key){
$item->review_average = $this->reviewRepository->getAverageRating($item);
return $item;
});
->paginate(15);
return Vendor::collection($reviewed_vendors);
// $reviewed_vendors = $vendors->map(function ($item, $key){
// $item->review_average = $this->reviewRepository->getAverageRating($item);
// return $item;
// });
return Vendor::collection($vendors);
}
public function products(ProductRepository $productRepository,$seller_id){

View File

@ -51,12 +51,13 @@ class Product extends JsonResource
'in_stock' => $product->haveSufficientQuantity(1),
'is_wishlisted' => $this->isWishlisted($product) ,
'is_item_in_cart' => \Cart::hasProduct($product),
//'shop_title' => $this->shop_title,
//'logo' => $this->logo ? Storage::url($this->logo) : null,
'shop_title' => $this->shop_title,
'logo' => $this->logo ? Storage::url($this->logo) : null,
'new' => $this->new,
'featured' => $this->featured,
'qty' => $this->qty,
'status' => $this->status,
'product_number' => $this->product_number,
// 'brand' => $product->brand->name ?? '',

View File

@ -23,7 +23,7 @@ class Vendor extends JsonResource
'banner' => $this->banner_url,
'ship_price' => $this->ship_price,
'ship_time' => $this->ship_time,
'review_average' => $this->review_average,
// 'review_average' => $this->review_average,
'slogan' => $this->slogan,
// 'brand_id' => $this->brand_attribute_id,
// $this->mergeWhen(!empty($this->main_categories) && $this->main_categories->count(),[