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['status'] = $preorder->status->getApiArray();
|
||||
/*foreach($preorder->statusflags as $sflag) {
|
||||
foreach($preorder->statusflags as $sflag) {
|
||||
$return['status']['flags'][$sflag->code] = [
|
||||
"code" => $sflag->code,
|
||||
"code" => (int)$sflag->code,
|
||||
"text" => $sflag->name,
|
||||
"value" => ($sflag->value->value == 1)
|
||||
];
|
||||
}*/
|
||||
}
|
||||
if($addon_data) {
|
||||
$return["additionalData"] = $addon_data;
|
||||
}
|
||||
|
||||
@@ -603,13 +603,13 @@ class Preorder extends mfBaseModel {
|
||||
$campaign = $this->getProperty("campaign");
|
||||
$status = $this->getProperty("status")->getApiArray();
|
||||
|
||||
/*foreach($this->getProperty("statusflags") as $sflag) {
|
||||
foreach($this->getProperty("statusflags") as $sflag) {
|
||||
$status["flags"][$sflag->code] = [
|
||||
"code" => $sflag->code,
|
||||
"code" => (int)$sflag->code,
|
||||
"text" => $sflag->name,
|
||||
"value" => ($sflag->value->value == 1)
|
||||
];
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
$a = [];
|
||||
|
||||
@@ -915,7 +915,7 @@ class PreorderController extends mfBaseController {
|
||||
$return = $this->savePatchpositionApi();
|
||||
break;
|
||||
case "setStatusFlag":
|
||||
$return = $this->setStatusFlagAction();
|
||||
$return = $this->setStatusFlagApi();
|
||||
break;
|
||||
default:
|
||||
$return = false;
|
||||
@@ -930,7 +930,7 @@ class PreorderController extends mfBaseController {
|
||||
$this->returnJson($data);
|
||||
}
|
||||
|
||||
private function setStatusFlagAction() {
|
||||
private function setStatusFlagApi() {
|
||||
$preorder_id = $this->request->preorder_id;
|
||||
$flag_id = $this->request->flag_id;
|
||||
$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,
|
||||
"new_value" => $this->data->value
|
||||
]);
|
||||
|
||||
$history->save();
|
||||
$this->getProperty("preorder")->afterSave();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class Preorderstatus extends mfBaseModel {
|
||||
$a = [];
|
||||
$a['code'] = (int)$this->code;
|
||||
$a['text'] = $this->name;
|
||||
//$a['flags'] = [];
|
||||
$a['flags'] = [];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user