Podio - PHP SDK - 项目 - 如何过滤多个字段

时间:2021-03-02 09:24:24

标签: php podio

我有一个 Leads 应用程序,两个文本字段分别用于主要电话和辅助电话。我需要通过将电话文本值与主要电话或辅助电话进行匹配来过滤应用。

我首先尝试使用此代码按主要电话进行过滤。如果未找到任何项目,请按辅助电话过滤。

过滤器仅适用于主要手机。不能使用辅助电话。

我的代码是:

// Get Lead ID search by main phone
$responses = PodioItem::filter($leadappid, $attributes = array('filters'=>array($primaryphone => $_REQUEST['From'])));

if ($responses->filtered != 0)  {           
    $response = $responses[0];      
    $leadid   = $response->item_id; 
}

// Get Lead ID search by second phone
if ($responses->filtered == 0)  {   

    $responses = PodioItem::filter($leadappid, $attributes = array('filters'=>array($secondaryphone => $_REQUEST['From'])));
    
    if ($responses->filtered != 0)  {
        $response = $responses[0];      
        $leadid   = $response->item_id; 
    }
}   

我先尝试过滤辅助电话。它也不起作用。

0 个答案:

没有答案
相关问题