sub-admin fixing issue
This commit is contained in:
@@ -164,18 +164,15 @@ class ManageUserProductController extends Controller
|
||||
// making unique custom id
|
||||
$count = MonthlyUpdateMaster::get()->count();
|
||||
$customID = 'JA';
|
||||
$customIDLength = 6;
|
||||
// for($i=0; $i<=strlen((string)$count); $i++)
|
||||
// {
|
||||
$customIDLength = strlen((string)$count) > 6 ? strlen((string)$count) : 6;
|
||||
for($j=$customIDLength; $j>strlen((string)$count); $j--)
|
||||
{
|
||||
$customID .= '0';
|
||||
}
|
||||
$customID .= $count;
|
||||
// dd($customID);
|
||||
|
||||
$companies = Company::active()->get();
|
||||
$data = MonthlyUpdateMaster::get();
|
||||
// dd($data);
|
||||
// return view('Admin.Pages.manage_investors..manage_user_product.manage_user_add', compact('users','aifProductNames','freProductNames','p2pProductNames','ifaProductNames','lbfProductNames','cagaProductNames','vdProductNames','hyfProductNames','sdiProductNames','idProductNames','companies'));
|
||||
return view('Admin.Pages.manage_investors.manage_user_product.manage_user_add', compact('users', 'aifProductNames', 'freProductNames', 'companies','customID','data'));
|
||||
}
|
||||
@@ -811,7 +808,7 @@ class ManageUserProductController extends Controller
|
||||
if ($validationMessage) {
|
||||
return response()->json(['status' => 400, 'message' => $validationMessage]);
|
||||
}
|
||||
$monthlyUpdate = MonthlyUpdateMaster::create([
|
||||
$monthlyUpdate = MonthlyUpdateMaster::insertGetId([
|
||||
'users_id' => $request->user_id,
|
||||
'products_id' => (int)$request->product_id,
|
||||
'categories' => $request->categories,
|
||||
@@ -825,6 +822,15 @@ class ManageUserProductController extends Controller
|
||||
'spv_details' => $request->spv_details,
|
||||
]);
|
||||
|
||||
$checkProductCommission = Product::where('id',(int)$request->product_id)->where('commission_type','One-Time Commission')->where('commission_type','Hybrid Commission')->exists();
|
||||
if($checkProductCommission)
|
||||
{
|
||||
|
||||
// $store = MonthlyUpdateMasterCommission::insert([
|
||||
// 'monthly_id' => $monthlyUpdate,
|
||||
// 'monthly_id' => $monthlyUpdate,
|
||||
// ]);
|
||||
}
|
||||
$statementReportsArray = array();
|
||||
$count = 0;
|
||||
if ($request->statement_reports) {
|
||||
|
||||
Reference in New Issue
Block a user