这段代码有什么问题:
$query = "email1 = '{$email}'";
Mage::log($query);
$account = $client->get_entry_list($session_id, 'Accounts', $query);
我无法弄清楚为什么它不起作用并给我一个错误:
looks like we got no XML document
Trace:
#0 /var/www/empresam/app/code/local/Empresam/SugarIntegration/Helper/Methods.php(147): SoapClient->__call('get_entry_list', Array)
#1 /var/www/empresam/app/code/local/Empresam/SugarIntegration/Helper/Methods.php(147): SoapClient->get_entry_list('v12adkskr9va2pe...', 'Accounts', 'email1 = 'magag...')
#2 /var/www/empresam/app/code/local/Empresam/Helloworld/controllers/IndexController.php(17): Empresam_SugarIntegration_Helper_Methods->addAccount('v12adkskr9va2pe...', Object(SoapClient), Object(Mage_Customer_Model_Customer))
#3 /var/www/empresam/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Empresam_Helloworld_IndexController->indexAction()
#4 /var/www/empresam/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#5 /var/www/empresam/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#6 /var/www/empresam/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#7 /var/www/empresam/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#8 /var/www/empresam/index.php(89): Mage::run('', 'store')
#9 {main}
我敢打赌,查询格式错误,但我对“潜在客户”执行了相同的程序,我可以成功返回潜在客户。
Lead 代码是这个:
$oldname = $oldfirstname . ' ' . $oldlastname;
$query = "account_name = '{$oldname}'";
$lead = $client->get_entry_list($session_id, 'Leads', $query);
该值{$email}
是正确的,我已确认将其打印到日志中。我几乎可以肯定错误出在查询格式上,但正如我所说,它适用于 LEAD 为什么它在这里不起作用?
我尝试在查询中使用“account_name”,但结果是一样的。'account_name' 和 'email1' 两个参数都是有效的,因为我可以成功创建帐户,但不能检索它们!