Lists.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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");
  14. if ($user_key) {
  15. $accounts = Mail::select([], ['user_key' => $user_key, 'status' => 1]);
  16. }
  17. $names = [];
  18. if (!empty($accounts)) {
  19. foreach ($accounts as $account) {
  20. $names[] = $account['email'] . "@" . $account['domain'];
  21. }
  22. }
  23. $this->showSuccess($names);
  24. }
  25. /**
  26. * Post Method|新增数据
  27. * @return void
  28. */
  29. protected function postData()
  30. {
  31. // TODO: 需要实现 postData() 方法.
  32. }
  33. /**
  34. * Put Method|更新数据
  35. * @return void
  36. */
  37. protected function putData()
  38. {
  39. // TODO: 需要实现 putData() 方法.
  40. }
  41. /**
  42. * Delete Method|删除数据
  43. * @return void
  44. */
  45. protected function deleteData()
  46. {
  47. // TODO: 需要实现 deleteData() 方法.
  48. }
  49. }