<?php
/**
 * Description of GrowthLevelPermissionSetting
 *
 * @author user
 */
class GrowthLevelPermissionSetting {
     public function getData() {
        $growthLevelWayPermission = new GrowthLevelWayPermission();
        $growthLevelPermission = new GrowthLevelPermission();
        $growthLevel = new GrowthLevel();
        $data_info = $growthLevelWayPermission ->findAllByDisplay();
        $arrLevel = $growthLevel->findAllLevelData();
        if (CommonBase::isFullArray($data_info)) {
            foreach($data_info as $key => &$value) {
                $wayId = $value['id'];
                foreach($arrLevel as $k => $v) {
                    $status = $growthLevelPermission->
                            findStatusByWayIdAndlevelId($wayId, $v['level_id']);
                    $strHavePerm = '';
                    if ($status == 1) {
                        $strHavePerm = '¡Ì';
                    }
                    $value['status'] = $status;
                    $value['setPermission' . $v['level_id']] = $strHavePerm;
                }
            }
        }
        return $data_info;
     }
}
