application count

This commit is contained in:
CHIEFSOFT\ameye
2024-09-03 12:23:20 -04:00
parent c7ea06f3b4
commit 2347295e19
+11 -1
View File
@@ -29,7 +29,7 @@ class BkoDash extends BaseController
// LEFT JOIN customers c ON c.uid = a.customer_uid LIMIT 10");
$dash_data["active_loans"] = 0;
$dash_data["applications"] = 0;
$dash_data["applications"] = $this->applicationCount(1);
$dash_data["today_application"] = 0;
$dash_data["curr_month"] = date('F');
@@ -68,6 +68,16 @@ class BkoDash extends BaseController
// return $this->respond([], 200);
}
private function applicationCount($applicationStatus){
$count_status = 0;
$mysqA = "select count(id) AS app_count from applications WHERE status= ".$applicationStatus;
$query2 = $this->db->query($mysqA);
$row2 = $query2->getResult('array');
if ($row2 && count($row2)> 0 ){
$count_status = $row2[0]["app_count"];
}
return $count_status;
}
public function pendingApplication() :ResponseInterface
{
//SELECT uid,loan_amount,payment_month,sales_agent,gender,marital_status,email,address,state,country,status,added,updated FROM applications;