Blame view

addons/antis/library/wework/examples/department.php 660 Bytes
2db47680   hexiaodong   chore: 初始提交 php 遗...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  <?php

  

  $app = require __DIR__ . '/app.php';

  

  /** @var \WeWork\Api\Department $department */

  $department = $app->get('department');

  

  try {

      $department->create([

          'name' => '广州研发中心',

          'parentid' => 1,

          'order' => 1,

          'id' => 1024

      ]);

  } catch (Exception $e) {

  }

  

  try {

      $department->update([

          'id' => 1024,

          'name' => '广州研发中心',

      ]);

  } catch (Exception $e) {

  }

  

  try {

      $department->delete(1024);

  } catch (Exception $e) {

  }

  

  try {

      $department->list();

  } catch (Exception $e) {

  }

  

  try {

      $department->list(1);

  } catch (Exception $e) {

  }