Coder Social home page Coder Social logo

Comments (11)

tkachev-o avatar tkachev-o commented on August 30, 2024 1

Попробуйте временно исключить эти конструкции if else.

Установите любое значение, к примеру так:
$lead['responsible_user_id'] = 2523706;

from amocrm-php.

aka-87 avatar aka-87 commented on August 30, 2024

Сработало, но как сделать зависимость от выбранного города?

from amocrm-php.

aka-87 avatar aka-87 commented on August 30, 2024

а как это проверить?

from amocrm-php.

aka-87 avatar aka-87 commented on August 30, 2024

вообще, это кастомная форма:
$lead->addCustomField(636487, [ [$_POST['city']], ]);

from amocrm-php.

aka-87 avatar aka-87 commented on August 30, 2024

` custom_fields: [

{
    id: 636487,
    name: "Мiсто",
    values: [
        {
            value: "Чернівці",
            enum: 1169121
        }
    ],
    is_system: false
}

],`

from amocrm-php.

aka-87 avatar aka-87 commented on August 30, 2024

наверное я неправильно составляю конструкцию?

from amocrm-php.

tkachev-o avatar tkachev-o commented on August 30, 2024

Ну скорее всего я бы отказался от нее, хотя бы так для начала:

// Default
$responsibleUserId = 2523706;

switch ($city){
    case 'Івано-Франківськ':
      $responsibleUserId = 2523706;
      break;
    case 'Рівне':
      $responsibleUserId= 2523715;
      break;
}

$amo = new \AmoCRM\Client(getenv('DOMAIN'), getenv('LOGIN'), getenv('HASH'));
...
$lead['responsible_user_id'] = $responsibleUserId;

from amocrm-php.

aka-87 avatar aka-87 commented on August 30, 2024

сейчас попробую, спасибо!

from amocrm-php.

aka-87 avatar aka-87 commented on August 30, 2024

ответственный всё равно не меняется

from amocrm-php.

aka-87 avatar aka-87 commented on August 30, 2024

Мне кажется нужно проверять не $city а custom_fields , но как это сделать правильно я не знаю

from amocrm-php.

aka-87 avatar aka-87 commented on August 30, 2024

проблема решена, проверять нужно было не $city а $_POST['city']

from amocrm-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.