now hours

This commit is contained in:
CHIEFSOFT\ameye
2024-09-03 14:32:27 -04:00
parent f8c0cfe939
commit f272502a88
+12 -1
View File
@@ -33,7 +33,7 @@ class BkoDash extends BaseController
$dash_data["today_application"] = 0;
$dash_data["curr_month"] = date('F');
$dash_data["curr_application_amount"] = "0";
$dash_data["curr_application_amount"] = $this->monthApplicationCount()["amount"];
$dash_data["curr_application_percentage"] = "0";
$dash_data["curr_application_direction"] = "up";
@@ -68,6 +68,17 @@ class BkoDash extends BaseController
// return $this->respond([], 200);
}
private function monthApplicationCount(){
//$status_result = 0;
$mysqlA = "select count(id) AS app_count, sum(loan_amount) AS amount from applications WHERE added BETWEEN '2024-09-01' AND now()";
$query2 = $this->db->query($mysqlA);
$row2 = $query2->getResult('array');
if ($row2 && count($row2)> 0 && $row2[0]["app_count"] > 0 ){
return $row2[0];
}
return ["app_count"=> 0, "amount"=> 0 ];
}
private function applicationCount($applicationStatus){
//$status_result = 0;
$mysqlA = "select count(id) AS app_count, sum(loan_amount) AS amount from applications WHERE status= ".$applicationStatus;