Added Borderpoint status to Preorder
This commit is contained in:
@@ -305,6 +305,8 @@ class PreorderController extends mfBaseController {
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($new_filter);exit;
|
||||
|
||||
return $new_filter;
|
||||
}
|
||||
|
||||
@@ -1066,6 +1068,9 @@ class PreorderController extends mfBaseController {
|
||||
case "addWorkorderRemark":
|
||||
$return = $this->addWorkorderRemarkApi();
|
||||
break;
|
||||
case "saveBorderpointStatus":
|
||||
$return = $this->saveBorderpointStatusApi();
|
||||
break;
|
||||
case "saveOrderdate":
|
||||
$return = $this->saveOrderdateApi();
|
||||
break;
|
||||
@@ -1083,9 +1088,38 @@ class PreorderController extends mfBaseController {
|
||||
$data = ["status" => "error"];
|
||||
$this->returnJson($data);
|
||||
}
|
||||
$data['status'] = "OK";
|
||||
$data['result'] = $return;
|
||||
$this->returnJson($data);
|
||||
|
||||
if(mfResponse::isResponse($return)) {
|
||||
$this->returnJson($return);
|
||||
} else {
|
||||
$data['status'] = "OK";
|
||||
$data['result'] = $return;
|
||||
$this->returnJson($data);
|
||||
}
|
||||
}
|
||||
|
||||
protected function saveBorderpointStatusApi() {
|
||||
$preorder_id = $this->request->preorder_id;
|
||||
$status_type = $this->request->status_type;
|
||||
$value = $this->request->value;
|
||||
|
||||
$preorder = new Preorder($preorder_id);
|
||||
if(!$preorder->id) {
|
||||
return mfResponse::NotFound(["message" => "Preorder not found"]);
|
||||
}
|
||||
|
||||
if(!$value) {
|
||||
$preorder->update(["borderpoint_status" => null]);
|
||||
} else {
|
||||
$preorder->update(["borderpoint_status" => $status_type]);
|
||||
}
|
||||
|
||||
$this->log->debug(__METHOD__.": $preorder_id - borderpoint status updated to $status_type");
|
||||
$preorder->save();
|
||||
|
||||
return mfResponse::Ok();
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function getFCPsForCampaignApi(): array {
|
||||
|
||||
Reference in New Issue
Block a user