You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
717 B
PHTML
28 lines
717 B
PHTML
6 years ago
|
<?php
|
||
|
|
||
|
class Department
|
||
|
{
|
||
|
public static function createDept($accessToken, $dept)
|
||
|
{
|
||
|
$response = Http::post("/department/create",
|
||
|
array("access_token" => $accessToken),
|
||
|
json_encode($dept));
|
||
|
return $response->id;
|
||
|
}
|
||
|
|
||
|
|
||
|
public static function listDept($accessToken)
|
||
|
{
|
||
|
$response = Http::get("/department/list",
|
||
|
array("access_token" => $accessToken));
|
||
|
return $response->department;
|
||
|
}
|
||
|
|
||
|
|
||
|
public static function deleteDept($accessToken, $id)
|
||
|
{
|
||
|
$response = Http::get("/department/delete",
|
||
|
array("access_token" => $accessToken, "id" => $id));
|
||
|
return $response->errcode == 0;
|
||
|
}
|
||
|
}
|