Merge pull request #302 from Ritikeshyadav/RitikeshFreeu

fixed product update issue
This commit is contained in:
Ritikeshyadav
2024-06-13 21:55:44 +05:30
committed by GitHub
5 changed files with 12 additions and 9 deletions

View File

@@ -497,10 +497,10 @@ class ManageFreeUInvestmentController extends Controller
);
}
$count = Fund::where('issuer', $request->issuer)->count();
// $count = Fund::where('issuer', $request->issuer)->count();
$fund = Fund::where('id', $request->fund_id)->update([
'issuer' => $request->issuer,
'slug' => Str::slug($request->issuer).'-'.++$count,
// 'slug' => Str::slug($request->issuer).'-'.++$count,
'fund_name' => $request->fund_name,
'geographic_focus' => $request->geographic_focus,
'fund_type' => $request->fund_type,
@@ -840,10 +840,10 @@ class ManageFreeUInvestmentController extends Controller
);
}
$count = RealEstate::where('property_name',$request->property_name)->count();
// $count = RealEstate::where('property_name',$request->property_name)->count();
$realEstate = RealEstate::where('id', $request->realEstates)->update([
'property_name' => $request->property_name,
'slug' => Str::slug($request->property_name).'-'.++$count,
// 'slug' => Str::slug($request->property_name).'-'.++$count,
'platform_partner' => $request->companies_id,
'geographic_focus' => $request->geographic_focus,
'price_per_sq_ft' => $request->price_per_sq_ft,

View File

@@ -128,10 +128,10 @@ class FractionalRealEstateController extends Controller
);
}
$count = FractionalRealEstate::where('property_name_and_location',$request->property_name_and_location)->count();
// $count = FractionalRealEstate::where('property_name_and_location',$request->property_name_and_location)->count();
$fractionalRealEstate = FractionalRealEstate::where('id', $id)->update([
'slug' => Str::slug($request->property_name_and_location).'-'.++$count,
// 'slug' => Str::slug($request->property_name_and_location).'-'.++$count,
'companies_id' => $request->companies_id,
'geographic_focus' => $request->geographic_focus,
'property_name_and_location' => $request->property_name_and_location,

View File

@@ -131,11 +131,11 @@ class VentureCapitalFundController extends Controller
}
// dd($request->all());
$count = AlternativeInvestmentFund::where('fund_name',$request->fund_name)->count();
// $count = AlternativeInvestmentFund::where('fund_name',$request->fund_name)->count();
$alternativeInvestmentFund = AlternativeInvestmentFund::where('id', $request->id)->update([
'slug' => Str::slug($request->fund_name).'-'.++$count,
// 'slug' => Str::slug($request->fund_name).'-'.$count+1,
'fund_name' => $request->fund_name,
'geographic_focus' => $request->geographic_focus,
'companies_id' => $request->companies_id,

View File

@@ -156,6 +156,7 @@ class AlternativeInvestmentFundController extends Controller
public function ventureCapitalFundProduct($slug)
{
// dd($slug);
$ventureCapitalFund = $this->ventureCapitalData($slug)->getData()->data;
// dd($ventureCapitalFund);
$otherVCP = AlternativeInvestmentFund::query()
@@ -309,6 +310,7 @@ class AlternativeInvestmentFundController extends Controller
public function ventureCapitalData($slug)
{
// dd(AlternativeInvestmentFund::all()->toArray());
// dd(AlternativeInvestmentFund::where('slug', $slug)->first());
try {
return (new VentureCapitalFundResource(AlternativeInvestmentFund::where('slug', $slug)->first()))

View File

@@ -15,6 +15,7 @@ class VentureCapitalFundResource extends JsonResource
*/
public function toArray($request)
{
// dd($this);
$images = ProductImage::where('product_xid', $this->products_id)->get();
$imagePaths = [];
if (!empty($images)) {
@@ -24,7 +25,7 @@ class VentureCapitalFundResource extends JsonResource
}
}
// dd($this);
// dd($this);
return [
'id' => $this->id,
'products_id' => $this->products_id,