ContractConfig ausgebaut
This commit is contained in:
@@ -2,10 +2,30 @@
|
||||
|
||||
class ProducttechAttribute extends mfBaseModel {
|
||||
private $producttech;
|
||||
private $contractval;
|
||||
private $contract_id;
|
||||
|
||||
|
||||
public function setContractId($contract_id) {
|
||||
if(!is_numeric($contract_id)) {
|
||||
return false;
|
||||
}
|
||||
$this->contract_id = $contract_id;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
|
||||
if($name == "contractval") {
|
||||
if(!$this->contract_id) {
|
||||
return null;
|
||||
}
|
||||
$this->contractval = ContractconfigValueModel::getFirst(['item_id' => $this->id]);
|
||||
//var_dump($this->contractval);
|
||||
return $this->contractval;
|
||||
}
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
|
||||
@@ -102,6 +102,20 @@ class ProducttechAttributeModel {
|
||||
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
if(array_key_exists("forproduct", $filter)) {
|
||||
$forproduct = $db->escape($filter['forproduct']);
|
||||
if(is_numeric($forproduct)) {
|
||||
$where .= " AND `forproduct` = $forproduct";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("forcontract", $filter)) {
|
||||
$forcontract = $db->escape($filter['forcontract']);
|
||||
if(is_numeric($forcontract)) {
|
||||
$where .= " AND `forcontract` = $forcontract";
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($filter);exit;
|
||||
if(array_key_exists("name", $filter)) {
|
||||
$name = $db->escape($filter['name']);
|
||||
|
||||
Reference in New Issue
Block a user