php bitrix-php crm联系

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php bitrix-php crm联系相关的知识,希望对你有一定的参考价值。

<?php
namespace Bitrix24\CRM\Contact;
$ct = new Bitrix24\CRM\Contact();

/**
 * Get list of contact items
 */
$order = [ "DATE_CREATE": "ASC" ];
$filter = [
  "TYPE_ID": "CLIENT",
  //find by phone number
  "PHONE": "555888"
];
$select = [ "ID", "NAME", "LAST_NAME", "TYPE_ID", "SOURCE_ID" ];
$ct->getList($order, $filter, $select);

/**
 * Add a new contact to CRM
*/
$fields = { 
	"NAME": "John", 
	"SECOND_NAME": "Lancelot", 
	"LAST_NAME": "Doe", 
	"OPENED": "Y", 
	"ASSIGNED_BY_ID": 1, 
	"TYPE_ID": "CLIENT",
	"SOURCE_ID": "SELF",
	"PHOTO": { "fileData": document.getElementById('photo') },
	"PHONE": [ { "VALUE": "555888", "VALUE_TYPE": "WORK" } ] 	
};
$params = { "REGISTER_SONET_EVENT": "Y" };
$ct->add($fields, $params);

//update a contact
$ct->update($id, $fields, $params);

//Get contact
$contact = $ct->get($id);

//delete contact
$ct->delete($id);

以上是关于php bitrix-php crm联系的主要内容,如果未能解决你的问题,请参考以下文章

php bitrix-php crm.company

php bitrix-php crm.deal

php bitrix-php磁盘

php bitrix-php任务

CRM与ERP的区别和联系

删除SAP CRM中的联系人信息