Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Зная id-сделки получить id контакта #83

Open
Aligan opened this issue Feb 12, 2019 · 3 comments
Open

Зная id-сделки получить id контакта #83

Aligan opened this issue Feb 12, 2019 · 3 comments

Comments

@Aligan
Copy link

Aligan commented Feb 12, 2019

Как получить id конаткта, зная id-сделки?

@waspmax1
Copy link

waspmax1 commented Feb 19, 2019

Как получить id конаткта, зная id-сделки?

$amo = new \AmoCRM\Client(getenv('DOMAIN'), getenv('LOGIN'), getenv('HASH'));

public function getLeadContacts($leadId)
{
    $contacts = [];
    for($limit = 0; $limit < time(); $limit += 500){
        $contact = $amo->contact->apiList([
            'limit_rows' => 500,
            'limit_offset' => $limit
        ]);
        if(!empty($contact)){
            $contacts[] = $contact;
        }else{
            break;
        }
    }
    $contacts = array_reduce($contacts, 'array_merge', array());
    $contacts = array_filter($contacts, function($arr) use($leadId){
        return  in_array($leadId, $arr['linked_leads_id']);
    });
    $contacts = array_values($contacts);
    return $contacts;
}

@shmidtelson
Copy link

shmidtelson commented Jun 14, 2019

DeepinScreenshot_выберите-область_20190614103138
Сначала получить информацию по сделке. Потом найти поле
Тыц

@shmidtelson
Copy link

Как получить id конаткта, зная id-сделки?

Решилась проблемка то?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants