* update dept.
This commit is contained in:
@@ -155,17 +155,17 @@ class deptTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function traingoalMemberLinkTest($dept, $planID)
|
||||
{
|
||||
$objects = $this->objectModel->traingoalMemberLink($dept, $planID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function createGroupManageMemberLinkTest($dept, $groupID)
|
||||
/**
|
||||
* function createGroupManageMemberLink test by dept
|
||||
*
|
||||
* @param string $deptID
|
||||
* @param string $groupID
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function createGroupManageMemberLinkTest($deptID, $groupID)
|
||||
{
|
||||
$dept = $this->objectModel->getByID($deptID);
|
||||
$objects = $this->objectModel->createGroupManageMemberLink($dept, $groupID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
@@ -173,8 +173,17 @@ class deptTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function createManageProjectAdminLinkTest($dept, $groupID)
|
||||
/**
|
||||
* function createManageProjectAdminLink test by dept
|
||||
*
|
||||
* @param string $deptID
|
||||
* @param string $groupID
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function createManageProjectAdminLinkTest($deptID, $groupID)
|
||||
{
|
||||
$dept = $this->objectModel->getByID($deptID);
|
||||
$objects = $this->objectModel->createManageProjectAdminLink($dept, $groupID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
@@ -182,20 +191,30 @@ class deptTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getSonsTest($deptID)
|
||||
/**
|
||||
* function getSons test by dept
|
||||
*
|
||||
* @param string $deptID
|
||||
* @param string $count
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getSonsTest($deptID, $count)
|
||||
{
|
||||
$objects = $this->objectModel->getSons($deptID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
if($count == '1') return count($objects);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getAllChildIdTest($deptID)
|
||||
public function getAllChildIdTest($deptID, $count)
|
||||
{
|
||||
$objects = $this->objectModel->getAllChildId($deptID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
if($count == '1') return count($objects);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
$deptIDList = array('2', '5');
|
||||
$groupIDList = array('2', '12');
|
||||
|
||||
r() && p() && e();
|
||||
$dept = new deptTest();
|
||||
r($dept->createGroupManageMemberLinkTest($deptIDList[0], $groupIDList[0])) && p() && e('>开发部<'); //权限分组2开发部链接组成
|
||||
r($dept->createGroupManageMemberLinkTest($deptIDList[1], $groupIDList[1])) && p() && e('>开发部1<'); //权限分组12开发部1链接组成
|
||||
|
||||
@@ -11,6 +11,10 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
$deptIDList = array('2', '5');
|
||||
$groupIDList = array('2', '12');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->createManageProjectAdminLinkTest($deptIDList[0], $groupIDList[0])) && p() && e('开发部'); //权限分组2开发部链接组成
|
||||
r($dept->createManageProjectAdminLinkTest($deptIDList[1], $groupIDList[1])) && p() && e('开发部1'); //权限分组2开发部链接组成
|
||||
|
||||
r() && p() && e();
|
||||
@@ -11,6 +11,11 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
$deptIDList = array('2', '5');
|
||||
$count = array('0', '1');
|
||||
|
||||
r() && p() && e();
|
||||
$dept = new deptTest();
|
||||
r($dept->getAllChildIdTest($deptIDList[0], $count[0])) && p('1') && e('5'); //有子部门查询
|
||||
r($dept->getAllChildIdTest($deptIDList[1], $count[0])[0]) && p() && e('5'); //无子部门查询
|
||||
r($dept->getAllChildIdTest($deptIDList[0], $count[1])) && p() && e('3'); //子部门数量统计
|
||||
r($dept->getAllChildIdTest($deptIDList[1], $count[1])) && p() && e('1'); //无子部门数量统计
|
||||
|
||||
@@ -11,6 +11,10 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
$deptIDList = array('2', '5');
|
||||
$count = array('0', '1');
|
||||
|
||||
r() && p() && e();
|
||||
$dept = new deptTest();
|
||||
r($dept->getSonsTest($deptIDList[0], $count[0])) && p('0:name,parent,path') && e('开发部1,2,,2,5,'); //有子部门查询
|
||||
r($dept->getSonsTest($deptIDList[1], $count[0])) && p() && e('0'); //无子部门查询
|
||||
r($dept->getSonsTest($deptIDList[0], $count[1])) && p() && e('2'); //子部门数量统计
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->traingoalMemberLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
Reference in New Issue
Block a user