Enabled Statusflags in Preorder Api
This commit is contained in:
@@ -1038,13 +1038,13 @@ class PreorderApicontroller extends mfBaseApicontroller {
|
|||||||
$return['orderDate'] = date("Y-m-d",$preorder->order_date);
|
$return['orderDate'] = date("Y-m-d",$preorder->order_date);
|
||||||
}
|
}
|
||||||
$return['status'] = $preorder->status->getApiArray();
|
$return['status'] = $preorder->status->getApiArray();
|
||||||
/*foreach($preorder->statusflags as $sflag) {
|
foreach($preorder->statusflags as $sflag) {
|
||||||
$return['status']['flags'][$sflag->code] = [
|
$return['status']['flags'][$sflag->code] = [
|
||||||
"code" => $sflag->code,
|
"code" => (int)$sflag->code,
|
||||||
"text" => $sflag->name,
|
"text" => $sflag->name,
|
||||||
"value" => ($sflag->value->value == 1)
|
"value" => ($sflag->value->value == 1)
|
||||||
];
|
];
|
||||||
}*/
|
}
|
||||||
if($addon_data) {
|
if($addon_data) {
|
||||||
$return["additionalData"] = $addon_data;
|
$return["additionalData"] = $addon_data;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -603,13 +603,13 @@ class Preorder extends mfBaseModel {
|
|||||||
$campaign = $this->getProperty("campaign");
|
$campaign = $this->getProperty("campaign");
|
||||||
$status = $this->getProperty("status")->getApiArray();
|
$status = $this->getProperty("status")->getApiArray();
|
||||||
|
|
||||||
/*foreach($this->getProperty("statusflags") as $sflag) {
|
foreach($this->getProperty("statusflags") as $sflag) {
|
||||||
$status["flags"][$sflag->code] = [
|
$status["flags"][$sflag->code] = [
|
||||||
"code" => $sflag->code,
|
"code" => (int)$sflag->code,
|
||||||
"text" => $sflag->name,
|
"text" => $sflag->name,
|
||||||
"value" => ($sflag->value->value == 1)
|
"value" => ($sflag->value->value == 1)
|
||||||
];
|
];
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
|
||||||
$a = [];
|
$a = [];
|
||||||
|
|||||||
@@ -915,7 +915,7 @@ class PreorderController extends mfBaseController {
|
|||||||
$return = $this->savePatchpositionApi();
|
$return = $this->savePatchpositionApi();
|
||||||
break;
|
break;
|
||||||
case "setStatusFlag":
|
case "setStatusFlag":
|
||||||
$return = $this->setStatusFlagAction();
|
$return = $this->setStatusFlagApi();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$return = false;
|
$return = false;
|
||||||
@@ -930,7 +930,7 @@ class PreorderController extends mfBaseController {
|
|||||||
$this->returnJson($data);
|
$this->returnJson($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setStatusFlagAction() {
|
private function setStatusFlagApi() {
|
||||||
$preorder_id = $this->request->preorder_id;
|
$preorder_id = $this->request->preorder_id;
|
||||||
$flag_id = $this->request->flag_id;
|
$flag_id = $this->request->flag_id;
|
||||||
$value = $this->request->value;
|
$value = $this->request->value;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class PreorderStatusflagValue extends mfBaseModel {
|
|||||||
"old_value" => property_exists($this->_old_data, "value") ? $this->_old_data->value : null,
|
"old_value" => property_exists($this->_old_data, "value") ? $this->_old_data->value : null,
|
||||||
"new_value" => $this->data->value
|
"new_value" => $this->data->value
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$history->save();
|
$history->save();
|
||||||
$this->getProperty("preorder")->afterSave();
|
$this->getProperty("preorder")->afterSave();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Preorderstatus extends mfBaseModel {
|
|||||||
$a = [];
|
$a = [];
|
||||||
$a['code'] = (int)$this->code;
|
$a['code'] = (int)$this->code;
|
||||||
$a['text'] = $this->name;
|
$a['text'] = $this->name;
|
||||||
//$a['flags'] = [];
|
$a['flags'] = [];
|
||||||
|
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user