'ID', 'name' => '权限名称', 'explanation' => '权限说明', ]; } public static function resetRightInfo($rightIds = [], $field = '') { $query = self::find()->where(['is_delete' => 0])->orderBy('id ASC'); if (!empty($rightIds)) { $query->andWhere(['id' => $rightIds]); } if (trim($field)) { $query->select($field); } $rightInfo = $query->asArray()->all(); $resetData = []; foreach ($rightInfo as $index => &$item) { if (intval($item['id']) === 3) { $resetData = $item; unset($rightInfo[$index]); } if (intval($item['id']) === 4) { $item['name'] = $resetData['name']; $item['explanation'] = $resetData['explanation']; } } return array_values($rightInfo); } }