department.php 660 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. $app = require __DIR__ . '/app.php';
  3. /** @var \WeWork\Api\Department $department */
  4. $department = $app->get('department');
  5. try {
  6. $department->create([
  7. 'name' => '广州研发中心',
  8. 'parentid' => 1,
  9. 'order' => 1,
  10. 'id' => 1024
  11. ]);
  12. } catch (Exception $e) {
  13. }
  14. try {
  15. $department->update([
  16. 'id' => 1024,
  17. 'name' => '广州研发中心',
  18. ]);
  19. } catch (Exception $e) {
  20. }
  21. try {
  22. $department->delete(1024);
  23. } catch (Exception $e) {
  24. }
  25. try {
  26. $department->list();
  27. } catch (Exception $e) {
  28. }
  29. try {
  30. $department->list(1);
  31. } catch (Exception $e) {
  32. }