本文整理汇总了PHP中Vtiger_Module_Model::getSearchRecordsQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Module_Model::getSearchRecordsQuery方法的具体用法?PHP Vtiger_Module_Model::getSearchRecordsQuery怎么用?PHP Vtiger_Module_Model::getSearchRecordsQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Module_Model
的用法示例。
在下文中一共展示了Vtiger_Module_Model::getSearchRecordsQuery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSearchRecordsQuery
/**
* Function returns query for module record's search
* @param <String> $searchValue - part of record name (label column of crmentity table)
* @param <Integer> $parentId - parent record id
* @param <String> $parentModule - parent module name
* @return <String> - query
*/
function getSearchRecordsQuery($searchValue, $parentId = false, $parentModule = false)
{
if ($parentId && $parentModule == 'Accounts') {
$query = "SELECT * FROM vtiger_crmentity\n\t\t\t\t\t\tINNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n\t\t\t\t\t\tWHERE deleted = 0 AND vtiger_contactdetails.parentid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
} else {
if ($parentId && $parentModule == 'Potentials') {
$query = "SELECT * FROM vtiger_crmentity\n\t\t\t\t\t\tINNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n\t\t\t\t\t\tLEFT JOIN vtiger_contpotentialrel ON vtiger_contpotentialrel.contactid = vtiger_contactdetails.contactid\n\t\t\t\t\t\tWHERE deleted = 0 AND vtiger_contpotentialrel.potentialid = {$parentId}\n\t\t\t\t\t\tAND label like '%{$searchValue}%'";
return $query;
} else {
if ($parentId && $parentModule == 'HelpDesk') {
$query = "SELECT * FROM vtiger_crmentity\n INNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n INNER JOIN vtiger_troubletickets ON vtiger_troubletickets.contact_id = vtiger_contactdetails.contactid\n WHERE deleted=0 AND vtiger_troubletickets.ticketid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
} else {
if ($parentId && $parentModule == 'Campaigns') {
$query = "SELECT * FROM vtiger_crmentity\n INNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n INNER JOIN vtiger_campaigncontrel ON vtiger_campaigncontrel.contactid = vtiger_contactdetails.contactid\n WHERE deleted=0 AND vtiger_campaigncontrel.campaignid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
} else {
if ($parentId && $parentModule == 'Vendors') {
$query = "SELECT vtiger_crmentity.* FROM vtiger_crmentity\n INNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n INNER JOIN vtiger_vendorcontactrel ON vtiger_vendorcontactrel.contactid = vtiger_contactdetails.contactid\n WHERE deleted=0 AND vtiger_vendorcontactrel.vendorid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
} else {
if ($parentId && $parentModule == 'PurchaseOrder') {
$query = "SELECT * FROM vtiger_crmentity\n INNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n INNER JOIN vtiger_purchaseorder ON vtiger_purchaseorder.contactid = vtiger_contactdetails.contactid\n WHERE deleted=0 AND vtiger_purchaseorder.purchaseorderid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
} else {
if ($parentId && $parentModule == 'SalesOrder') {
$query = "SELECT * FROM vtiger_crmentity\n INNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n INNER JOIN vtiger_salesorder ON vtiger_salesorder.contactid = vtiger_contactdetails.contactid\n WHERE deleted=0 AND vtiger_salesorder.salesorderid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
} else {
if ($parentId && $parentModule == 'Invoice') {
$query = "SELECT * FROM vtiger_crmentity\n INNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n INNER JOIN vtiger_invoice ON vtiger_invoice.contactid = vtiger_contactdetails.contactid\n WHERE deleted=0 AND vtiger_invoice.invoiceid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
}
}
}
}
}
}
}
}
return parent::getSearchRecordsQuery($parentId, $parentModule);
}
示例2: getSearchRecordsQuery
/**
* Function returns query for module record's search
* @param <String> $searchValue - part of record name (label column of crmentity table)
* @param <Integer> $parentId - parent record id
* @param <String> $parentModule - parent module name
* @return <String> - query
*/
function getSearchRecordsQuery($searchValue, $parentId = false, $parentModule = false)
{
if ($parentId && $parentModule == 'Accounts') {
$query = "SELECT * FROM vtiger_crmentity\n\t\t\t\t\t\tINNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n\t\t\t\t\t\tWHERE deleted = 0 AND vtiger_contactdetails.parentid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
} else {
if ($parentId && $parentModule == 'HelpDesk') {
$query = "SELECT * FROM vtiger_crmentity\n INNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n INNER JOIN vtiger_troubletickets ON vtiger_troubletickets.contact_id = vtiger_contactdetails.contactid\n WHERE deleted=0 AND vtiger_troubletickets.ticketid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
} else {
if ($parentId && $parentModule == 'Campaigns') {
$query = "SELECT * FROM vtiger_crmentity\n INNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n INNER JOIN vtiger_campaigncontrel ON vtiger_campaigncontrel.contactid = vtiger_contactdetails.contactid\n WHERE deleted=0 AND vtiger_campaigncontrel.campaignid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
} else {
if ($parentId && $parentModule == 'Vendors') {
$query = "SELECT vtiger_crmentity.* FROM vtiger_crmentity\n INNER JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_crmentity.crmid\n INNER JOIN vtiger_vendorcontactrel ON vtiger_vendorcontactrel.contactid = vtiger_contactdetails.contactid\n WHERE deleted=0 AND vtiger_vendorcontactrel.vendorid = {$parentId} AND label like '%{$searchValue}%'";
return $query;
}
}
}
}
return parent::getSearchRecordsQuery($parentId, $parentModule);
}
示例3: getSearchRecordsQuery
/**
* Function returns query for module record's search
* @param <String> $searchValue - part of record name (label column of crmentity table)
* @param <Integer> $parentId - parent record id
* @param <String> $parentModule - parent module name
* @return <String> - query
*/
public function getSearchRecordsQuery($searchValue, $parentId = false, $parentModule = false)
{
if ($parentId && in_array($parentModule, array('Accounts', 'Contacts'))) {
$query = "SELECT * FROM vtiger_crmentity\n\t\t\t\t\t\tINNER JOIN vtiger_potential ON vtiger_potential.potentialid = vtiger_crmentity.crmid\n\t\t\t\t\t\tWHERE deleted = 0 AND vtiger_potential.related_to = {$parentId} AND label like '%{$searchValue}%'";
return $query;
}
return parent::getSearchRecordsQuery($parentId, $parentModule);
}