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

Невозможно получить статус заказа #54

Open
Alimgulov opened this issue Nov 19, 2019 · 1 comment
Open

Comments

@Alimgulov
Copy link

Alimgulov commented Nov 19, 2019

$MSOrders = CustomerOrder::query($this->MSClient)->getList()->toArray();
$MSOrders[0]->relations->find(State::class)->fresh();

Не правильно формируется URL для получения статуса заказа
`Array
(
[0] => stdClass Object
(
[error] => Ошибка в адресе запроса
[code] => 1038
[moreInfo] => https://online.moysklad.ru/api/remap/1.1/doc#обработка-ошибок-1038
)

)
`

@smadrom
Copy link

smadrom commented Nov 20, 2019

Возможный вариант:

$MSOrders = CustomerOrder::query($this->MSClient)->getList();
$MSOrders[0]->relations->fresh('state');

Вариант по-лучше:

$MSOrders = CustomerOrder::query($this->MSClient, QuerySpecs::create([
    'maxResults' => 100,
    'expand' => Expand::create(['state']),
]))->getList();

$MSOrders[0]->relations->state...

Работоспособность не проверял, но в теории должно работать.

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

2 participants