added product name

This commit is contained in:
Ritikesh yadav
2024-06-04 14:45:27 +05:30
parent cc18379ccd
commit 70037ebcde
6 changed files with 65 additions and 9 deletions

View File

@@ -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
]);
}