mirror of
https://github.com/sctn4elk/CustomerRewardsRESTAPI.git
synced 2025-01-09 15:24:30 -06:00
Update with new customer fields
This commit is contained in:
parent
db55067112
commit
706cccdbbc
|
@ -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":
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user