swoft-cloud / swoft-component

📦 This is a repository of centralized management of all swoft core components
https://www.swoft.org
Apache License 2.0
96 stars 107 forks source link

Fix aop sorting problem #506

Closed dengkangfa closed 5 years ago

dengkangfa commented 5 years ago

Fix Aop sorting according to order, wrong parameter position when calling array_multisort function sorting

stelin commented 5 years ago

@dengkangfa 提交描述修改成英文

stelin commented 5 years ago

我测试了下,现在排序是正常的

$aspects = [ 'a' => [ 'name' => '1', 'order' => 3, ], 'b' => [ 'name' => '2', 'order' => 1, ], 'c' => [ 'name' => '3', 'order' => 9, ], ];

// Sort aspect by order // Sort aspect by order $temp = array_column($aspects, 'order'); array_multisort($temp, SORT_ASC, $aspects);

var_dump($aspects);