Update with new customer fields

This commit is contained in:
sctn4elk 2024-04-20 09:33:27 -05:00
parent db55067112
commit 706cccdbbc
2 changed files with 16 additions and 12 deletions

View File

@ -41,10 +41,11 @@ class CustomerController extends BaseController{
$customerModel->email = $arrQueryStringParams['email']; $customerModel->email = $arrQueryStringParams['email'];
$customerModel->phone = $arrQueryStringParams['phone']; $customerModel->phone = $arrQueryStringParams['phone'];
$customerModel->birthday = $arrQueryStringParams['birthday']; $customerModel->birthday = $arrQueryStringParams['birthday'];
$customerModel->loyalty = $arrQueryStringParams['loyalty']; $customerModel->street = $arrQueryStringParams['street'];
$customerModel->city = $arrQueryStringParams['city']; $customerModel->city = $arrQueryStringParams['city'];
$customerModel->state = $arrQueryStringParams['state']; $customerModel->state = $arrQueryStringParams['state'];
$customerModel->zip = $arrQueryStringParams['zip']; $customerModel->zip = $arrQueryStringParams['zip'];
$customerModel->loyalty = $arrQueryStringParams['loyalty'];
$arrCustomer = $customerModel->insertCustomer(); $arrCustomer = $customerModel->insertCustomer();
@ -53,10 +54,11 @@ class CustomerController extends BaseController{
unset($customerModel->email); unset($customerModel->email);
unset($customerModel->phone); unset($customerModel->phone);
unset($customerModel->birthday); unset($customerModel->birthday);
unset($customerModel->loyalty); unset($customerModel->street);
unset($customerModel->city); unset($customerModel->city);
unset($customerModel->state); unset($customerModel->state);
unset($customerModel->zip); unset($customerModel->zip);
unset($customerModel->loyalty);
break; break;
case "update": case "update":

View File

@ -17,6 +17,7 @@
* customer_email varchar(255) * customer_email varchar(255)
* customer_phone varchar(12) * customer_phone varchar(12)
* customer_birthday datetime * customer_birthday datetime
* customer_street varchar(255)
* address_code_id bigint * address_code_id bigint
* loyalty_member tinyint * loyalty_member tinyint
* *
@ -72,16 +73,17 @@ class CustomerModel extends Database {
public function insertCustomer() public function insertCustomer()
{ {
$rowCount = $this->processStatement("CALL insert_new_customer_proc(?,?,?,?,?,?,?,?,?)", $rowCount = $this->processStatement("CALL insert_new_customer_proc(?,?,?,?,?,?,?,?,?,?)",
[$this->first, [$this->first,
$this->last, $this->last,
$this->email, $this->email,
$this->phone, $this->phone,
$this->birthday, $this->birthday,
$this->loyalty, $this->street,
$this->city, $this->city,
$this->state, $this->state,
$this->zip]); $this->zip,
$this->loyalty]);
return $rowCount; return $rowCount;
} }