From 706cccdbbcda02dec28057816a97a594db573380 Mon Sep 17 00:00:00 2001 From: sctn4elk Date: Sat, 20 Apr 2024 09:33:27 -0500 Subject: [PATCH] Update with new customer fields --- Controller/API/CustomerController.php | 6 ++++-- Model/CustomerModel.php | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Controller/API/CustomerController.php b/Controller/API/CustomerController.php index 7c75751..5825188 100644 --- a/Controller/API/CustomerController.php +++ b/Controller/API/CustomerController.php @@ -41,10 +41,11 @@ class CustomerController extends BaseController{ $customerModel->email = $arrQueryStringParams['email']; $customerModel->phone = $arrQueryStringParams['phone']; $customerModel->birthday = $arrQueryStringParams['birthday']; - $customerModel->loyalty = $arrQueryStringParams['loyalty']; + $customerModel->street = $arrQueryStringParams['street']; $customerModel->city = $arrQueryStringParams['city']; $customerModel->state = $arrQueryStringParams['state']; $customerModel->zip = $arrQueryStringParams['zip']; + $customerModel->loyalty = $arrQueryStringParams['loyalty']; $arrCustomer = $customerModel->insertCustomer(); @@ -53,10 +54,11 @@ class CustomerController extends BaseController{ unset($customerModel->email); unset($customerModel->phone); unset($customerModel->birthday); - unset($customerModel->loyalty); + unset($customerModel->street); unset($customerModel->city); unset($customerModel->state); unset($customerModel->zip); + unset($customerModel->loyalty); break; case "update": diff --git a/Model/CustomerModel.php b/Model/CustomerModel.php index 7f30b9f..bb2ef0e 100644 --- a/Model/CustomerModel.php +++ b/Model/CustomerModel.php @@ -17,6 +17,7 @@ * customer_email varchar(255) * customer_phone varchar(12) * customer_birthday datetime + * customer_street varchar(255) * address_code_id bigint * loyalty_member tinyint * @@ -72,16 +73,17 @@ class CustomerModel extends Database { public function insertCustomer() { - $rowCount = $this->processStatement("CALL insert_new_customer_proc(?,?,?,?,?,?,?,?,?)", - [$this->first, - $this->last, - $this->email, - $this->phone, - $this->birthday, - $this->loyalty, - $this->city, - $this->state, - $this->zip]); + $rowCount = $this->processStatement("CALL insert_new_customer_proc(?,?,?,?,?,?,?,?,?,?)", + [$this->first, + $this->last, + $this->email, + $this->phone, + $this->birthday, + $this->street, + $this->city, + $this->state, + $this->zip, + $this->loyalty]); return $rowCount; }