本文整理汇总了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);
}