FIX_all dashboard issued date changed

This commit is contained in:
sanjeev.p 2025-12-09 17:53:53 +05:30
parent f471fbd1da
commit 859ffeac6b

View File

@ -565,7 +565,7 @@ class DashboardController extends ResourceController
$manager_id = $this->request->getGet('manager_id');
// Initialize the details array to ensure the final output is always structured.
$details = [ 'StaffWise' => [], 'ProductWise' => []];
$details = [ 'StaffWise' => []];
$code = 200;
$message = "Productivity Dashboard Data Retrieved Successfully";
@ -966,14 +966,9 @@ class DashboardController extends ResourceController
$builder = $this->db->table('partner_policy pp');
$builder->select("
DATE_FORMAT(CURRENT_DATE(), '%b') AS curr_month,
YEAR(CURRENT_DATE()) AS year_of_curr_month,
DATE_FORMAT(DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH), '%b') AS pre_month,
YEAR(DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH)) AS year_of_last_month,
pa.sales_executive_id,
pse.name as sales_executive_name,
pp.manager_id,
pp.vehicle_type AS vechile_type,
COUNT(
CASE
@ -1035,17 +1030,9 @@ class DashboardController extends ResourceController
if (!isset($final[$se_id])) {
$final[$se_id] = [
"curr_month" => $row["curr_month"],
"year_of_curr_month" => $row["year_of_curr_month"],
"pre_month" => $row["pre_month"],
"year_of_last_month" => $row["year_of_last_month"],
"sales_executive_id" => $row["sales_executive_id"],
"sales_executive_name" => $row["sales_executive_name"],
"manager_id" => $row["manager_id"],
"products_list" => [],
"total_products" => 0
];
}