使用 NuSOAP 查询 SugarCRM 中的潜在客户状态
我正在尝试按状态取回潜在客户的条目列表。我使用的查询是“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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够运行或多或少相同的查询并返回整个列表...
您能给我显示调用后 $result var 的 var_dump 吗?另请尝试从您的参数中删除
并再次尝试调用。这可能是问题的根源,因为通常如果您指定一个 ID,调用将尝试获取相应的条目。
但不知道复数形式如何适合这里。值得一试,将其删除。
干杯,
米^e
I was able to run more or less the same query and get back the whole list...
Can you show me a var_dump of the $result var following the call? Also try removing the
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