Started Order productchange
This commit is contained in:
@@ -797,8 +797,15 @@ class ContractController extends mfBaseController
|
||||
case "getContract":
|
||||
$return = $this->getContractApi();
|
||||
break;
|
||||
case "findContracts":
|
||||
$return = $this->getContractsApi();
|
||||
break;
|
||||
case "findContract":
|
||||
$return = $this->findContractApi();
|
||||
break;
|
||||
case "":
|
||||
$return = "";
|
||||
break;
|
||||
default:
|
||||
$return = false;
|
||||
}
|
||||
@@ -834,6 +841,23 @@ class ContractController extends mfBaseController
|
||||
return ["contract" => $data, "form_id" => $form_id];
|
||||
}
|
||||
|
||||
private function getContractsApi() {
|
||||
$owner_id = $this->request->owner_id;
|
||||
if(!$owner_id) return false;
|
||||
|
||||
$return = [];
|
||||
|
||||
foreach(ContractModel::search(["owner_id" => $owner_id]) as $contract) {
|
||||
$c = get_object_vars($contract->data);
|
||||
$c["id"] = $contract->id;
|
||||
$return[] = $c;
|
||||
}
|
||||
|
||||
header("Content-type: application/json");
|
||||
echo json_encode($return);
|
||||
exit;
|
||||
}
|
||||
|
||||
private function findContractApi()
|
||||
{
|
||||
$search = trim($this->request->q);
|
||||
|
||||
Reference in New Issue
Block a user