Added addonServices and additionalData to POST /preorder
This commit is contained in:
@@ -302,6 +302,25 @@ class PreorderApicontroller extends mfBaseApicontroller {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* check for addon services
|
||||
*/
|
||||
if(array_key_exists("addonServices", $this->post)) {
|
||||
$addon_services = $this->post['addonServices'];
|
||||
if($addon_services) {
|
||||
$preorder_data['addon_services'] = json_encode($addon_services);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* check for addon data
|
||||
*/
|
||||
if(array_key_exists("additionalData", $this->post)) {
|
||||
$addon_data = $this->post['additionalData'];
|
||||
if($addon_data) {
|
||||
$preorder_data['addon_data'] = json_encode($addon_data);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* create preorder record
|
||||
|
||||
@@ -9,6 +9,12 @@ class Preorder extends mfBaseModel {
|
||||
private $adb_wohneinheit;
|
||||
|
||||
|
||||
public function afterLoad() {
|
||||
if($this->uid === "string") {
|
||||
$this->uid = "";
|
||||
}
|
||||
}
|
||||
|
||||
public function createUcode() {
|
||||
$ucode = $this->generateNewUcode();
|
||||
while(PreorderModel::search(['ucode' => $ucode])) {
|
||||
|
||||
@@ -30,15 +30,12 @@ class PreorderController extends mfBaseController {
|
||||
// pagination defaults
|
||||
$pagination = [];
|
||||
$pagination['start'] = 0;
|
||||
$pagination['count'] = 25;
|
||||
$pagination['count'] = 5;
|
||||
$pagination['maxItems'] = 0;
|
||||
|
||||
if(is_numeric($this->request->s)) {
|
||||
$pagination['start'] = intval($this->request->s);
|
||||
}
|
||||
//var_dump($filter);exit;
|
||||
//$pagination['maxItems'] = AddressModel::count($filter);
|
||||
|
||||
|
||||
$campaign_filter = [];
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ class PreorderModel {
|
||||
public $city;
|
||||
public $phone;
|
||||
public $email;
|
||||
public $addon_services;
|
||||
public $addon_data;
|
||||
public $submit_type;
|
||||
public $submit_request;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user