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


PHP User::setEy方法代码示例

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


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

示例1: addReport

 /**
  * 添加报表
  * @param type $content 表报内容
  * @param type $taskId 任务ID | 主要用于任务日志追加为报表
  * @return type
  */
 public static function addReport($content, $taskId = '')
 {
     $findReport = self::db('report')->where('report_date = :report_date AND user_id = :user_id')->find(array('report_date' => date('Y-m-d'), 'user_id' => $_SESSION['team']['user_id']))['report_id'];
     if (empty($findReport)) {
         $findReport = self::db('report')->insert(array('report_date' => date('Y-m-d'), 'user_id' => $_SESSION['team']['user_id'], 'department_id' => $_SESSION['team']['user_department_id']));
         \Model\User::setEy($_SESSION['team']['user_id'], '1');
     } else {
         //防止由于用户迁移部门,导致获取当天报表失败
         self::db('report')->where('report_id = :report_id')->update(array('department_id' => $_SESSION['team']['user_department_id'], 'noset' => array('report_id' => $findReport)));
     }
     if (!empty($taskId)) {
         $task = \Model\Content::findContent('task', $taskId, 'task_id');
         $data['task_id'] = $task['task_id'];
         $data['task_title'] = $task['task_title'];
         $data['task_status'] = $task['task_status'];
     }
     $data['report_id'] = $findReport;
     $data['report_content'] = $content;
     return $report_content = self::db('report_content')->insert($data);
 }
开发者ID:tarscoding,项目名称:PESCMS-TEAM,代码行数:26,代码来源:Report.class.php

示例2: check

 /**
  * 更改任务状态
  */
 public function check()
 {
     $data['noset']['task_id'] = $this->isP('task_id', '请选择任务');
     $task = $this->db('task AS t')->field("t.*, group_concat(tc.check_user_id) AS check_user_id ")->join("{$this->prefix}task_check AS tc ON tc.task_id = t.task_id")->where('t.task_id = :task_id ')->group('t.task_id')->find(array('task_id' => $data['noset']['task_id']));
     if (empty($task) || $task['task_delete'] == '1') {
         $this->error('任务不存在');
     }
     $checker = explode(',', $task['check_user_id']);
     $data['task_status'] = empty($_POST['task_status']) ? '2' : $this->p('task_status');
     $this->db()->transaction();
     switch ($data['task_status']) {
         case '2':
             if ($_SESSION['team']['user_id'] != $task['task_user_id']) {
                 $this->error('您不是本任务执行人');
             }
             $noticeUser = $checker;
             $noticeType = '3';
             $dynamicType = '3';
             //提交审核,增加EY值
             \Model\User::setEy($_SESSION['team']['user_id'], '1');
             break;
         case '3':
         case '4':
             if (!in_array($_SESSION['team']['user_id'], $checker)) {
                 $this->error('您没有权限处理本任务');
             }
             $noticeUser = array($task['task_user_id']);
             $noticeType = $data['task_status'] == '3' ? '4' : '6';
             $dynamicType = $data['task_status'] == '3' ? '' : '4';
             $eyValue = $data['task_status'] == '3' ? '-2' : '1';
             \Model\User::setEy($task['task_user_id'], $eyValue);
             break;
         default:
             $this->error('未知的任务状态');
     }
     //每个状态变更,都表示一个完成时间
     $data['task_completetime'] = time();
     $updateResultt = $this->db('task')->where('task_id = :task_id')->update($data);
     if (empty($updateResultt)) {
         $this->db()->rollBack();
         $this->error('提交任务失败');
     }
     //状态为3需要判断是否有任务补充说明提交
     if ($data['task_status'] == 3) {
         $supplement['task_id'] = $data['noset']['task_id'];
         $supplement['task_supplement_content'] = $this->p('content');
         $supplement['task_supplement_file'] = !empty($_POST['file']) && is_array($_POST['file']) ? implode(',', $_POST['file']) : '';
         $supplement['task_supplement_time'] = time();
         if (!empty($supplement['task_supplement_content']) || !empty($supplement['task_supplement_file'])) {
             $addSupplement = $this->db('task_supplement')->insert($supplement);
             if (empty($addSupplement)) {
                 $this->db()->rollBack();
                 $this->error('添加任务补充说明失败');
             }
         }
     }
     //生成系统消息
     foreach ($noticeUser as $value) {
         $sendNotice = \Model\Notice::addNotice($value, $data['noset']['task_id'], $noticeType, $task['task_mail']);
         if (empty($sendNotice)) {
             $this->db()->rollBack();
             $this->error('生成系统消息出错!');
         }
     }
     //生成个人动态
     if (!empty($dynamicType)) {
         $addDynamic = \Model\Dynamic::addDynamic($task['task_user_id'], $data['noset']['task_id'], $dynamicType);
         if (empty($addDynamic)) {
             $this->db()->rollBack();
             $this->error('更新用户动态失败');
         }
     }
     $this->db()->commit();
     $this->success('任务状态已更新!', $this->url('Team-Task-view', array('id' => $data['noset']['task_id'])));
 }
开发者ID:tarscoding,项目名称:PESCMS-TEAM,代码行数:78,代码来源:Task.class.php

示例3: action

 public function action()
 {
     //创建任务的uid,此处必须注意,$_POST的信息必定是字符串
     $_POST['create_id'] = (string) $_SESSION['team']['user_id'];
     //进行一些基础表单信息入库
     $this->db()->transaction();
     $addResult = \Model\Content::addContent();
     if ($addResult['status'] == false) {
         $this->db()->rollBack();
         $this->error($addResult['mes']);
     }
     //生成任务站内通知,accept_id为1表示本部门,反之需要部门责任人审核任务
     if ($_POST['accept_id'] == '1') {
         $sendNoticeResult = \Model\Notice::addNotice($_POST['user_id'], $addResult['mes'], '1', $_POST['mail']);
         if ($sendNoticeResult == false) {
             $this->db()->rollBack();
             $this->error('生成新任务通知失败');
         }
     } else {
         $department = \Model\Content::findContent('department', $_POST['department_id'], 'department_id');
         if (empty($department['department_header'])) {
             $this->db()->rollBack();
             $this->error('该部门没有负责人,无法创建任务');
         }
         $department_header = explode(',', $department['department_header']);
         foreach ($department_header as $v) {
             $sendNoticeResult = \Model\Notice::addNotice($v, $addResult['mes'], '5', $_POST['mail']);
             if ($sendNoticeResult == false) {
                 $this->db()->rollBack();
                 $this->error('生成部门审核通知失败');
             }
         }
     }
     //添加任务审核人,不论是否设置对应的审核人,部门审核人都将成为审核人之一。
     $checkUserList = empty($department_header) ? explode(',', $_POST['check_user_id']) : array_unique(array_merge_recursive(explode(',', $_POST['check_user_id']), $department_header));
     foreach ($checkUserList as $v) {
         $addCheckResult = $this->db('task_check')->insert(array('task_id' => $addResult['mes'], 'check_user_id' => $v));
         if ($addCheckResult == false) {
             $this->db()->rollBack();
             $this->error('添加审核人失败');
         }
         $sendNoticeResult = \Model\Notice::addNotice($v, $addResult['mes'], '2', $_POST['mail']);
         if ($sendNoticeResult == false) {
             $this->db()->rollBack();
             $this->error('生成指派通知失败');
         }
         \Model\User::setEy($v, '1');
     }
     $addDynamic = \Model\Dynamic::addDynamic($_SESSION['team']['user_id'], $addResult['mes'], '1');
     if (empty($addDynamic)) {
         $this->db()->rollBack();
         $this->error('更新用户动态失败');
     }
     $this->db()->commit();
     if (!empty($_POST['back_url'])) {
         $url = $_POST['back_url'];
     } else {
         $url = $this->url('Team-' . MODULE . '-index');
     }
     $this->success($GLOBALS['_LANG']['CONTENT']['ADD_CONTENT_SUCCESS'], $url);
 }
开发者ID:tarscoding,项目名称:PESCMS-TEAM,代码行数:61,代码来源:Task.class.php


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