使用 NuSOAP 查询 SugarCRM 中的潜在客户状态

发布于 2024-09-29 10:34:51 字数 1085 浏览 5 评论 0原文

我正在尝试按状态取回潜在客户的条目列表。我使用的查询是“leads.status = 'New'”,但是当我在 php 中尝试此操作时,我也得到了其他状态的线索。

    function get_leads_over_x_days($session_id, $days)
    {
        $daysAgo = date("m/d/Y", strtotime($days . ' days ago'));

        $where = "leads.status='New'";

        $package = array(
                            "session" => $session_id,
                            "module_name" => "Leads",
                            "ids" => "",
                            "query" => $where,
                            "order_by" => "",
                            "select_fields" => "",
                            "max_results" => $max_results,
                            "deleted" => 0,
                        );


        $result = $this->client->call("get_entry_list", $package);

        if (!$this->is_error($result)) {
            return $result["entry_list"];
        }
    }

现在我已经使用 SoapUI (http://www.soapui.org/) 执行了相同的肥皂调用返回的记录正是我所期望的。我不确定我做错了什么,或者这是否是 nuSOAP 问题。

I'm trying to get back an entry list of leads by status. The query I'm using is "leads.status = 'New'" however when I try this in php, I get back leads of other statuses as well.

    function get_leads_over_x_days($session_id, $days)
    {
        $daysAgo = date("m/d/Y", strtotime($days . ' days ago'));

        $where = "leads.status='New'";

        $package = array(
                            "session" => $session_id,
                            "module_name" => "Leads",
                            "ids" => "",
                            "query" => $where,
                            "order_by" => "",
                            "select_fields" => "",
                            "max_results" => $max_results,
                            "deleted" => 0,
                        );


        $result = $this->client->call("get_entry_list", $package);

        if (!$this->is_error($result)) {
            return $result["entry_list"];
        }
    }

Now I have performed the same soap call using SoapUI (http://www.soapui.org/) and the records returned are exactly what I expect. I'm not sure what I'm doing wrong, or if this is a nuSOAP issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽手叙旧 2024-10-06 10:34:51

我能够运行或多或少相同的查询并返回整个列表...

$query = "leads.status = 'New'";
$result = $soapclient->call( 'get_entry_list',
                        array(
                            'session'=>$session_id,
                            'module_name'=>'Leads',
                            'query'=>$query, 
                            'order_by'=>'',
                            'offset'=>0,
                            'select_fields'=>array(),
                            'max_results'=>10
                        )
                    );

您能给我显示调用后 $result var 的 var_dump 吗?另请尝试从您的参数中删除

ids => ""

并再次尝试调用。这可能是问题的根源,因为通常如果您指定一个 ID,调用将尝试获取相应的条目。

但不知道复数形式如何适合这里。值得一试,将其删除。

干杯,
米^e

I was able to run more or less the same query and get back the whole list...

$query = "leads.status = 'New'";
$result = $soapclient->call( 'get_entry_list',
                        array(
                            'session'=>$session_id,
                            'module_name'=>'Leads',
                            'query'=>$query, 
                            'order_by'=>'',
                            'offset'=>0,
                            'select_fields'=>array(),
                            'max_results'=>10
                        )
                    );

Can you show me a var_dump of the $result var following the call? Also try removing the

ids => ""

from your params and try the call again. That could be the root of the problem as usually if you specify an ID the call will try and fetch the corresponding entry.

Don't know how the plural form fits in here though. Worth a try with it removed.

Cheers,
m^e

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文