protected function _GetInnerWhere($table, $keywordField) { $fqClassName = $this->FQNamespace . $table; // var_dump($fqClassName::$SearchableFields); $nestedWhere = $this->SearchObj->GetWhere($table, $fqClassName::$SearchableFields); $fieldPhrase = GetFieldList(['ID'], $table); $query = <<<SQL SELECT {$fieldPhrase} FROM `{$table}` {$nestedWhere} SQL; $where = parent::_GetInnerWhere($table, $keywordField); return $where . " AND `{$table}`.`ID` NOT IN( {$query} )"; }
function ProcessDBF($AName) { $vResult = 0; $vHandle = dbase_open($AName, 0); if ($vHandle === FALSE) { throw new Exception('Невозможно открыть файл базы данных'); } try { $vFieldList = GetFieldList($vHandle); $vSurgeryIDIdx = FindFieldIdx($vFieldList, 'MYSURGERYID', false); $vCaseIDIdx = FindFieldIdx($vFieldList, 'MYCASEID'); $vDateIdx = FindFieldIdx($vFieldList, 'DATEIN'); $vSendIdx = FindFieldIdx($vFieldList, 'SEND'); $vErrorIdx = FindFieldIdx($vFieldList, 'ERROR'); $vCnt = dbase_numrecords($vHandle); for ($i = 1; $i <= $vCnt; $i++) { $vRecord = dbase_get_record($vHandle, $i); ProcessDBFRecord(trim(@$vRecord[$vSurgeryIDIdx]), trim(@$vRecord[$vCaseIDIdx]), DBF2Date(trim(@$vRecord[$vDateIdx])), trim(@$vRecord[$vSendIdx]), iconv('CP866', 'UTF-8', trim(@$vRecord[$vErrorIdx]))); $vResult++; } } catch (Exception $e) { dbase_close($vHandle); throw $e; } dbase_close($vHandle); return $vResult; }