本文整理匯總了PHP中Opportunity::create_list_query方法的典型用法代碼示例。如果您正苦於以下問題:PHP Opportunity::create_list_query方法的具體用法?PHP Opportunity::create_list_query怎麽用?PHP Opportunity::create_list_query使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Opportunity
的用法示例。
在下文中一共展示了Opportunity::create_list_query方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testcreate_export_query
public function testcreate_export_query()
{
$opportunity = new Opportunity();
//test with empty string params
$expected = "SELECT \n accounts.id as account_id,\n accounts.name as account_name,\n accounts.assigned_user_id account_id_owner,\n users.user_name as assigned_user_name ,opportunities_cstm.* ,opportunities.*\n FROM opportunities LEFT JOIN users\n ON opportunities.assigned_user_id=users.id LEFT JOIN accounts_opportunities\n ON opportunities.id=accounts_opportunities.opportunity_id\n LEFT JOIN accounts\n ON accounts_opportunities.account_id=accounts.id LEFT JOIN opportunities_cstm ON opportunities.id = opportunities_cstm.id_c where \n\t\t\t(accounts_opportunities.deleted is null OR accounts_opportunities.deleted=0)\n\t\t\tAND (accounts.deleted is null OR accounts.deleted=0)\n\t\t\tAND opportunities.deleted=0 ORDER BY opportunities.name";
$actual = $opportunity->create_list_query('', '');
$this->assertSame($expected, $actual);
//test with valid string params
$expected = "SELECT \n accounts.id as account_id,\n accounts.name as account_name,\n accounts.assigned_user_id account_id_owner,\n users.user_name as assigned_user_name ,opportunities_cstm.* ,opportunities.*\n FROM opportunities LEFT JOIN users\n ON opportunities.assigned_user_id=users.id LEFT JOIN accounts_opportunities\n ON opportunities.id=accounts_opportunities.opportunity_id\n LEFT JOIN accounts\n ON accounts_opportunities.account_id=accounts.id LEFT JOIN opportunities_cstm ON opportunities.id = opportunities_cstm.id_c where (accounts.name=\"\") AND \n\t\t\t(accounts_opportunities.deleted is null OR accounts_opportunities.deleted=0)\n\t\t\tAND (accounts.deleted is null OR accounts.deleted=0)\n\t\t\tAND opportunities.deleted=0 ORDER BY accounts.id";
$actual = $opportunity->create_list_query('accounts.id', 'accounts.name=""');
$this->assertSame($expected, $actual);
}