Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (2)
Tags (6)
master
develop
4.2
3.9
3.8
3.5
v3.5
3.3
master
Branches (2)
Tags (6)
master
develop
4.2
3.9
3.8
3.5
v3.5
3.3
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (2)
Tags (6)
master
develop
4.2
3.9
3.8
3.5
v3.5
3.3
IBOS
/
system
/
modules
/
assignment
/
model
/
Assignment.php
IBOS
/
system
/
modules
/
assignment
/
model
/
Assignment.php
Assignment.php 4.21 KB
Copy Edit Raw Blame History
zqhong authored 2016年12月08日 20:12 +08:00 . update:版本升级,3.8 -> 3.9
<?php
/**
* 任务指派模块------ assignment表的数据层操作文件
*
* @link http://www.ibos.com.cn/
* @copyright Copyright &copy; 2008-2013 IBOS Inc
* @author gzhzh <gzhzh@ibos.com.cn>
*/
/**
* 任务指派模块------ assignment表的数据层操作类,继承ICModel
* @package application.modules.assignments.model
* @version $Id: Assignment.php 1371 2014年05月15日 09:33:26Z gzhzh $
* @author gzhzh <gzhzh@ibos.com.cn>
*/
namespace application\modules\assignment\model;
use application\core\model\Model;
use application\core\utils\Ibos;
use CDbCriteria;
use CPagination;
class Assignment extends Model
{
public static function model($className = __CLASS__)
{
return parent::model($className);
}
public function tableName()
{
return '{{assignment}}';
}
/**
* 查找指派人是uid所有未完成任务
* @param integer $uid
*/
public function fetchUnfinishedByDesigneeuid($uid)
{
$record = $this->fetchAll(array(
'condition' => sprintf('`designeeuid` = %d AND `status` != 2 AND `status` != 3', $uid),
'order' => 'addtime DESC',
));
return $record;
}
/**
* 查找负责人是uid所有未完成任务
* @param integer $uid
*/
public function fetchUnfinishedByChargeuid($uid)
{
$record = $this->fetchAll(array(
'condition' => sprintf('`chargeuid` = %d AND `status` != 2 AND `status` != 3', $uid),
'order' => 'addtime DESC',
));
return $record;
}
/**
* 查找指派人是uid所有未完成任务
* @param integer $uid
*/
public function fetchUnfinishedByParticipantuid($uid)
{
$record = $this->fetchAll(array(
'condition' => sprintf('FIND_IN_SET(%d, `participantuid`) AND `status` != 2 AND `status` != 3', $uid),
'order' => 'addtime DESC',
));
return $record;
}
/**
* 获得某个用户未完成的任务数据(分为uid指派的、负责的、参与的和用户数据)
* @param integer $uid
* @return array
*/
public function getUnfinishedByUid($uid)
{
$datas = array(
'designeeData' => $this->fetchUnfinishedByDesigneeuid($uid), // 指派的任务
'chargeData' => $this->fetchUnfinishedByChargeuid($uid), // 负责的任务
'participantData' => $this->fetchUnfinishedByParticipantuid($uid) // 参与的任务
);
return $datas;
}
/**
* 分页查找数据
* @param string $conditions 条件
* @param integer $pageSize 每页多少条数据
* @return array
*/
public function fetchAllAndPage($conditions = '', $pageSize = null)
{
$conditionArray = array('condition' => $conditions, 'order' => 'finishtime DESC');
$criteria = new CDbCriteria();
foreach ($conditionArray as $key => $value) {
$criteria->$key = $value;
}
$count = $this->count($criteria);
$pages = new CPagination($count);
$everyPage = is_null($pageSize) ? Ibos::app()->params['basePerPage'] : $pageSize;
$pages->setPageSize(intval($everyPage));
$pages->applyLimit($criteria);
$datas = $this->fetchAll($criteria);
return array('pages' => $pages, 'datas' => $datas, 'count' => $count);
}
/**
* 获得某个uid未完成任务数(包括指派的任务、负责的任务、参与的任务)
* @param integer $uid
* @return type integer
*/
public function getUnfinishCountByUid($uid)
{
$count = $this->count("`status` != 2 AND `status` != 3 AND (`designeeuid` = {$uid} OR `chargeuid` = {$uid} OR FIND_IN_SET({$uid}, `participantuid`) )");
return intval($count);
}
/**
* 根据任务ID查找任务完成状态
* @param integer $assignmentid 任务ID
* @return boolean
*/
public function getStatusByAssignmentid($assignmentid)
{
$record = $this->fetch(array(
'condition' => sprintf('`assignmentid` = %d AND `status` = 2 OR `status` = 3', $assignmentid)
));
if (!empty($record)) {
$bool = true;
} else {
$bool = false;
}
return $bool;
}
}
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

基于Yii和bootstrap的开源OA/协同办公平台,连接全平台覆盖的酷办公客户端(Win,IOS,Android,Mac,Linux),支撑您的企业管理二次开发--作为国内首家开源OA,有的不只是颜值
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/case-code/IBOS.git
git@gitee.com:case-code/IBOS.git
case-code
IBOS
IBOS
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /