fixed product name issue in user commission
This commit is contained in:
@@ -58,30 +58,24 @@ class ManageCommissionController extends Controller
|
||||
// ->orderBy('products.created_at')
|
||||
->latest('products.created_at')
|
||||
->get();
|
||||
// dd($products);
|
||||
$products->each(function($value){
|
||||
$monthlyData = MonthlyUpdateMaster::where('products_id',$value->id)->get();
|
||||
// dd($products);
|
||||
$products->each(function ($value) {
|
||||
$monthlyData = MonthlyUpdateMaster::where('products_id', $value->id)->get();
|
||||
$totalCommission = 0;
|
||||
$totalInvestment = 0;
|
||||
if($monthlyData->isNotEmpty())
|
||||
{
|
||||
foreach($monthlyData as $monthlyDataRow)
|
||||
{
|
||||
if(MonthlyUpdateFractionalRealEstate::where('custom_id',$monthlyDataRow->custom_id)->exists())
|
||||
{
|
||||
$freData = MonthlyUpdateFractionalRealEstate::where('custom_id',$monthlyDataRow->custom_id)->first();
|
||||
if ($monthlyData->isNotEmpty()) {
|
||||
foreach ($monthlyData as $monthlyDataRow) {
|
||||
if (MonthlyUpdateFractionalRealEstate::where('custom_id', $monthlyDataRow->custom_id)->exists()) {
|
||||
$freData = MonthlyUpdateFractionalRealEstate::where('custom_id', $monthlyDataRow->custom_id)->first();
|
||||
$totalInvestment += floatval($freData->getRawOriginal()['investment_value']);
|
||||
}
|
||||
if(MonthlyUpdateAlternativeInvestmentFund::where('custom_id',$monthlyDataRow->custom_id)->exists())
|
||||
{
|
||||
$aifData = MonthlyUpdateAlternativeInvestmentFund::where('custom_id',$monthlyDataRow->custom_id)->first();
|
||||
if (MonthlyUpdateAlternativeInvestmentFund::where('custom_id', $monthlyDataRow->custom_id)->exists()) {
|
||||
$aifData = MonthlyUpdateAlternativeInvestmentFund::where('custom_id', $monthlyDataRow->custom_id)->first();
|
||||
$totalInvestment += floatval($aifData->getRawOriginal()['commitment_amount']);
|
||||
}
|
||||
$data = MonthlyUpdateMasterCommission::where('monthly_id',$monthlyDataRow->id)->get();
|
||||
if($data->isNotEmpty())
|
||||
{
|
||||
foreach($data as $dataRow)
|
||||
{
|
||||
$data = MonthlyUpdateMasterCommission::where('monthly_id', $monthlyDataRow->id)->get();
|
||||
if ($data->isNotEmpty()) {
|
||||
foreach ($data as $dataRow) {
|
||||
$totalCommission += floatval($dataRow->getRawOriginal()['gross_commissioned_earned_inr']);
|
||||
}
|
||||
}
|
||||
@@ -193,6 +187,12 @@ class ManageCommissionController extends Controller
|
||||
if (!$check) {
|
||||
abort(404);
|
||||
}
|
||||
// $data = MonthlyUpdateMasterCommission::query()
|
||||
// ->with('monthlyUpdate.products.fractional_real_estate')
|
||||
// ->latest()
|
||||
// ->get();
|
||||
// // ->select('*');
|
||||
// dd($data->toArray());
|
||||
return view('Admin.Pages.manage_commission.user_commission');
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ class ManageCommissionController extends Controller
|
||||
return '<div class="text-center">' . $row->monthlyUpdate->investor_name . ' </div>';
|
||||
})
|
||||
->editColumn('product_sold', function ($row) {
|
||||
return '<div class="text-center">' . 'ABC' . '</div>';
|
||||
return '<div class="text-center">' . $row->monthlyUpdate->product_name . '</div>';
|
||||
})
|
||||
->editColumn('month', function ($row) {
|
||||
return '<div class="text-center">' . $row->created_at->format('M') . ' </div>';
|
||||
@@ -283,11 +283,11 @@ class ManageCommissionController extends Controller
|
||||
<a href=$view>
|
||||
<i class='fa-regular fa-eye'></i>
|
||||
</a>
|
||||
<a href=$edit style='float:right'>
|
||||
<i class='fa-solid fa-pen-to-square'></i>
|
||||
</a>
|
||||
</div>
|
||||
";
|
||||
// <a href=$edit style='float:right'>
|
||||
// <i class='fa-solid fa-pen-to-square'></i>
|
||||
// </a>
|
||||
return $btn;
|
||||
})
|
||||
->rawColumns(['investor_name', 'product_sold', 'month', 'total_investment', 'applicable_rate', 'commission_type', 'created_at', 'action'])
|
||||
@@ -298,8 +298,7 @@ class ManageCommissionController extends Controller
|
||||
public function trailCommission()
|
||||
{
|
||||
$check = checkSidebarAccess('trail-commission');
|
||||
if(!$check)
|
||||
{
|
||||
if (!$check) {
|
||||
abort(404);
|
||||
}
|
||||
return view('Admin.Pages.manage_commission.trail_commission', [
|
||||
|
||||
Reference in New Issue
Block a user