Lists.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace Heanup\App\Api\Controller\User;
  3. use Heanup\App\Api\Package\Database\Mail;
  4. use Heanup\App\Api\RestfulController;
  5. class Lists extends RestfulController
  6. {
  7. /**
  8. * Get Method|获取数据
  9. * @return void
  10. */
  11. protected function getData()
  12. {
  13. $user_key=$this->getRequest()->string("a",$_SESSION['user_key']);
  14. // $user_key = $this->getRequest()->string("a");
  15. if ($user_key) {
  16. $accounts = Mail::select([], ['user_key' => $user_key, 'status' => 1]);
  17. }
  18. $names = [];
  19. if (!empty($accounts)) {
  20. foreach ($accounts as $account) {
  21. $names[] = $account['email'] . "@" . $account['domain'];
  22. }
  23. }
  24. $this->showSuccess($names);
  25. }
  26. /**
  27. * Post Method|新增数据
  28. * @return void
  29. */
  30. protected function postData()
  31. {
  32. // TODO: 需要实现 postData() 方法.
  33. }
  34. /**
  35. * Put Method|更新数据
  36. * @return void
  37. */
  38. protected function putData()
  39. {
  40. // TODO: 需要实现 putData() 方法.
  41. }
  42. /**
  43. * Delete Method|删除数据
  44. * @return void
  45. */
  46. protected function deleteData()
  47. {
  48. // TODO: 需要实现 deleteData() 方法.
  49. }
  50. }