| @@ 735-746 (lines=12) @@ | ||
| 732 | $result['results'] = array_values($query->all()); |
|
| 733 | } |
|
| 734 | ||
| 735 | if (!empty($result['results']) && 'simple' === $template) { |
|
| 736 | $result['cards'] = array_reduce($result['results'], |
|
| 737 | function ($result, $item) |
|
| 738 | { |
|
| 739 | /** @var array $item */ |
|
| 740 | $result[$item['id']] = \app\modules\shop\widgets\Customer::widget([ |
|
| 741 | 'viewFile' => 'customer/backend_list', |
|
| 742 | 'model' => Customer::findOne(['id' => $item['id']]), |
|
| 743 | ]); |
|
| 744 | return $result; |
|
| 745 | }, []); |
|
| 746 | } |
|
| 747 | ||
| 748 | return $result; |
|
| 749 | } |
|
| @@ 769-782 (lines=14) @@ | ||
| 766 | ->asArray(); |
|
| 767 | $result['results'] = array_merge(array_values($query->all()), $result['results']); |
|
| 768 | ||
| 769 | if (!empty($result['results']) && 'simple' === $template) { |
|
| 770 | $result['cards'] = array_reduce($result['results'], |
|
| 771 | function ($result, $item) |
|
| 772 | { |
|
| 773 | /** @var array $item */ |
|
| 774 | if (!empty($item['id'])) { |
|
| 775 | $result[$item['id']] = \app\modules\shop\widgets\Contragent::widget([ |
|
| 776 | 'viewFile' => 'contragent/backend_list', |
|
| 777 | 'model' => Contragent::findOne(['id' => $item['id']]), |
|
| 778 | ]); |
|
| 779 | } |
|
| 780 | return $result; |
|
| 781 | }, []); |
|
| 782 | } |
|
| 783 | ||
| 784 | return $result; |
|
| 785 | } |
|