From 70037ebcde7a38f5477dae698ea2fb66d125c4c7 Mon Sep 17 00:00:00 2001 From: Ritikesh yadav Date: Tue, 4 Jun 2024 14:45:27 +0530 Subject: [PATCH] added product name --- .../Admin/ManageCommissionController.php | 17 ++++++++++++++++- app/Models/MonthlyUpdateMasterCommission.php | 18 ++++++++++++------ public/assets/css/FrontendCss/style.css | 12 ++++++++++++ public/assets/css/style1.css | 11 +++++++++++ public/assets/css/style2.css | 12 ++++++++++++ .../view_user_commission.blade.php | 4 ++-- 6 files changed, 65 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/Admin/ManageCommissionController.php b/app/Http/Controllers/Admin/ManageCommissionController.php index bc622cf..3328cd6 100644 --- a/app/Http/Controllers/Admin/ManageCommissionController.php +++ b/app/Http/Controllers/Admin/ManageCommissionController.php @@ -6,6 +6,8 @@ use App\Models\Product; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use App\Http\Controllers\Controller; +use App\Models\AlternativeInvestmentFund; +use App\Models\FractionalRealEstate; use App\Models\MonthlyUpdateAlternativeInvestmentFund; use App\Models\MonthlyUpdateFractionalRealEstate; use App\Models\MonthlyUpdateIndianFinancialAssets; @@ -192,8 +194,21 @@ class ManageCommissionController extends Controller public function viewUserProduct($id) { + $data = MonthlyUpdateMasterCommission::with('monthlyUpdate')->where('id', $id)->first(); + if($data) + { + if(AlternativeInvestmentFund::where('products_id',$data->monthlyUpdate->products_id)->exists()) + { + $data->product_name = AlternativeInvestmentFund::where('products_id',$data->monthlyUpdate->products_id)->value('fund_name'); + } + if(FractionalRealEstate::where('products_id',$data->monthlyUpdate->products_id)->exists()) + { + $data->product_name = FractionalRealEstate::where('products_id',$data->monthlyUpdate->products_id)->value('property_name_and_location'); + } + } + // dd($data); return view('Admin.Pages.manage_commission.view_user_commission', [ - 'product' => MonthlyUpdateMasterCommission::find($id) + 'product' => $data ]); } diff --git a/app/Models/MonthlyUpdateMasterCommission.php b/app/Models/MonthlyUpdateMasterCommission.php index e7d0330..751721c 100644 --- a/app/Models/MonthlyUpdateMasterCommission.php +++ b/app/Models/MonthlyUpdateMasterCommission.php @@ -11,25 +11,26 @@ class MonthlyUpdateMasterCommission extends Model protected $table = 'monthly_update_commissions'; - protected $fillable = ['monthly_id','total_investment_or_commitment_amount','applicable_rate','type_of_commission','gross_commissioned_earned_inr','gst','tds','net_commission_received']; + protected $fillable = ['monthly_id', 'total_investment_or_commitment_amount', 'applicable_rate', 'type_of_commission', 'gross_commissioned_earned_inr', 'gst', 'tds', 'net_commission_received']; - public function monthlyUpdate(){ - return $this->belongsTo(MonthlyUpdateMaster::class,'monthly_id'); + public function monthlyUpdate() + { + return $this->belongsTo(MonthlyUpdateMaster::class, 'monthly_id'); } public function getTotalInvestmentOrCommitmentAmountAttribute($value) { - return $this->IND_money_format($value) ; + return $this->IND_money_format($value); } public function getGrossCommissionedEarnedInrAttribute($value) { - return $this->IND_money_format($value) ; + return $this->IND_money_format($value); } public function getNetCommissionReceivedAttribute($value) { - return $this->IND_money_format($value) ; + return $this->IND_money_format($value); } function IND_money_format($number) @@ -57,4 +58,9 @@ class MonthlyUpdateMasterCommission extends Model return '₹ ' . $result; } + + public function products() + { + return $this->belongsTo(Product::class, 'products_id'); + } } diff --git a/public/assets/css/FrontendCss/style.css b/public/assets/css/FrontendCss/style.css index fdc71c1..4840c47 100644 --- a/public/assets/css/FrontendCss/style.css +++ b/public/assets/css/FrontendCss/style.css @@ -5703,6 +5703,18 @@ span.color-red { width: 100%; grid-template-columns: repeat(1, 1fr); } + + .categories-card.categories-two-card { + width: 100%; + grid-template-columns: repeat(1, 1fr); + } + .menubar .admin-profile .dropdown-menu { + position: relative !important; + top: -45px !important; + } + .admin-profile .dropdown img.profile-icon { + width: auto; + } } @media (max-width: 600px) { } diff --git a/public/assets/css/style1.css b/public/assets/css/style1.css index 36b7a6f..c519e85 100644 --- a/public/assets/css/style1.css +++ b/public/assets/css/style1.css @@ -1033,4 +1033,15 @@ table.dataTable thead > tr > td.sorting_desc_disabled:after { width: 100%; grid-template-columns: repeat(1, 1fr); } + .categories-card.categories-two-card { + width: 100%; + grid-template-columns: repeat(1, 1fr); + } + .menubar .admin-profile .dropdown-menu { + position: relative !important; + top: -45px !important; + } + .admin-profile .dropdown img.profile-icon { + width: auto; + } } diff --git a/public/assets/css/style2.css b/public/assets/css/style2.css index b83e139..a09d7f6 100644 --- a/public/assets/css/style2.css +++ b/public/assets/css/style2.css @@ -1395,4 +1395,16 @@ a:active { width: 100%; grid-template-columns: repeat(1, 1fr); } + + .categories-card.categories-two-card { + width: 100%; + grid-template-columns: repeat(1, 1fr); + } + .menubar .admin-profile .dropdown-menu { + position: relative !important; + top: -45px !important; + } + .admin-profile .dropdown img.profile-icon { + width: auto; + } } diff --git a/resources/views/Admin/Pages/manage_commission/view_user_commission.blade.php b/resources/views/Admin/Pages/manage_commission/view_user_commission.blade.php index 6d34dea..bb410d0 100644 --- a/resources/views/Admin/Pages/manage_commission/view_user_commission.blade.php +++ b/resources/views/Admin/Pages/manage_commission/view_user_commission.blade.php @@ -23,9 +23,9 @@ - {{-- @dd($product) --}} + + value="{{ $product->product_name }}" readonly>