当前位置: 首页>>代码示例>>PHP>>正文


PHP Application_Model_User::getManagerUser方法代码示例

本文整理汇总了PHP中Application_Model_User::getManagerUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_User::getManagerUser方法的具体用法?PHP Application_Model_User::getManagerUser怎么用?PHP Application_Model_User::getManagerUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Application_Model_User的用法示例。


在下文中一共展示了Application_Model_User::getManagerUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getmanageruserlistAction

 public function getmanageruserlistAction()
 {
     $data = array();
     $user_session = new Zend_Session_Namespace('user');
     $user_id = $user_session->user_info['user_id'];
     $user = new Application_Model_User();
     $manager = $user->getManagerUser($user_id);
     foreach ($manager as $m) {
         array_push($data, array('id' => $m['id'], 'name' => $m['name']));
     }
     echo Zend_Json::encode($data);
     exit;
 }
开发者ID:xindalu,项目名称:evolve,代码行数:13,代码来源:AccountController.php

示例2: overtimeAction

 public function overtimeAction()
 {
     // 返回值数组
     $result = array('success' => true, 'info' => '提交成功');
     // 请求参数
     $request = $this->getRequest()->getParams();
     // 操作类型
     $operate = array('new' => '新建', 'edit' => '编辑', 'delete' => '删除');
     // 操作类别(新建、更新、删除)
     $operate_type = isset($request['operate']) ? $request['operate'] : '';
     $overtime = new Hra_Model_Attendance_Overtime();
     if ($operate_type == 'new_hra' || $operate_type == 'new' || $operate_type == 'edit') {
         $time_from = str_replace('T', ' ', $request['time_from']);
         $time_to = str_replace('T', ' ', $request['time_to']);
         if (date('Y-m', strtotime($time_from)) != date('Y-m', strtotime($time_to))) {
             $result['success'] = false;
             $request['info'] = '不允许跨月申请,请重新填写时间!';
             echo Zend_Json::encode($result);
             exit;
         }
         // 获取加班人员的用工形式(0:弹性,1:非弹性)
         $user = new Application_Model_User();
         $userInfo = $user->getEmployeeInfoById($request['apply_user']);
         $userType = $userInfo['employment_type'];
         $workday = new Hra_Model_Workday();
         // 获取请假区间包含的工作日天数
         $overtimeInfo = $workday->getOvertimeQtyByTimeRange($userType, $request['time_from'], $request['time_to']);
         $overtimeQty = $overtimeInfo['qty'];
         $overtimeQty_hours = $overtimeInfo['qty_hours'];
         /* echo $overtimeQty;
            exit; */
         // 加班类别按起始日期获取
         $overtimeType = $workday->getWorkdayType($userType, date('Y-m-d', strtotime($request['time_from'])));
         if ($overtimeType == 0) {
             $result['success'] = false;
             $request['info'] = '工作日设置错误,请检查工作日设置!';
             echo Zend_Json::encode($result);
             exit;
         }
         // 当编辑请假申请时,检查时间是否重叠需要过滤当前加班申请ID
         $filter_id = null;
         if ($operate_type == 'edit') {
             $filter_id = $request['id'];
         }
         // 检查加班时间范围是否正确
         if ($overtimeQty > 0) {
             // 检查加班时间范围是否跟已有申请(包括已审核和审核中的申请)重叠
             if ($overtime->checkTimeOverlap($request['apply_user'], $request['time_from'], $request['time_to'], $filter_id)) {
                 $result['success'] = false;
                 $result['info'] = '时间设置错误,加班时间重叠,请优先处理未审申请。';
             } else {
                 $now = date('Y-m-d H:i:s');
                 $user_session = new Zend_Session_Namespace('user');
                 $user_id = $user_session->user_info['user_id'];
                 // 当前申请为代申请时,获取申请人真实部门主管
                 if ($request['apply_user'] != $user_id) {
                     // 获取部门主管
                     $manager = $user->getManagerUser($request['apply_user']);
                     $request['review_user_1'] = $manager[0]['id'];
                 }
                 if ($request['review_user_1'] >= 0) {
                     $data = array('type' => $overtimeType, 'apply_user' => $request['apply_user'], 'review_user_1' => $request['review_user_1'], 'time_from' => $request['time_from'], 'time_to' => $request['time_to'], 'qty' => $overtimeQty, 'qty_hours' => $overtimeQty_hours, 'reason' => $request['reason'], 'remark' => $request['remark'], 'update_time' => $now, 'update_user' => $user_id);
                     /* echo '<pre>';
                        print_r($data);
                        exit; */
                     if ($operate_type == 'new_hra') {
                         // HRA手动添加
                         $data['state'] = 3;
                         $data['create_time'] = $now;
                         $data['create_user'] = $user_id;
                         $data['review_info'] = $now . ': ' . $user_session->user_info['user_name'] . ' [手动添加]';
                         try {
                             $overtime_id = $overtime->insert($data);
                             echo Zend_Json::encode($result);
                             exit;
                         } catch (Exception $e) {
                             $result['success'] = false;
                             $result['info'] = $e->getMessage();
                         }
                     } else {
                         if ($operate_type == 'new') {
                             $data['create_time'] = $now;
                             $data['create_user'] = $user_id;
                             $data['review_info'] = $now . ': ' . $user_session->user_info['user_name'] . ' [新建]';
                             try {
                                 $overtime_id = $overtime->insert($data);
                             } catch (Exception $e) {
                                 $result['success'] = false;
                                 $result['info'] = $e->getMessage();
                             }
                         } else {
                             $overtime_id = $request['id'];
                             $review_info = $now . ': ' . $user_session->user_info['user_name'] . ' [修改]';
                             $overtimeData = $overtime->getData(null, $overtime_id);
                             $data['review_info'] = $overtimeData['review_info'] . '<br>' . $review_info;
                             $data['state'] = 0;
                             $data['review_time_1'] = null;
                             //$data['review_time_2'] = null;
                             $data['release_time'] = null;
                             try {
//.........这里部分代码省略.........
开发者ID:xindalu,项目名称:evolve,代码行数:101,代码来源:AttendanceController.php


注:本文中的Application_Model_User::getManagerUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。