User.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?php
  2. namespace Main\Src;
  3. use Dever;
  4. use Main\Lib\Core;
  5. class User extends Core
  6. {
  7. //protected $checkUser = true;
  8. # 我的页面
  9. public function my()
  10. {}
  11. # 分享
  12. public function submit_share()
  13. {
  14. $id = Dever::input('id');
  15. if (!$id) {
  16. Dever::alert('错误的ID');
  17. }
  18. $type = Dever::input('type');
  19. if (!$type) {
  20. Dever::alert('错误的类型');
  21. }
  22. Dever::load('act/lib/share')->submit($this->data['uid'], $id, $type);
  23. return array('id' => $id, 'type' => $type);
  24. }
  25. # 回流
  26. public function submit_share_reflux()
  27. {
  28. $source_signature = Dever::input('source_signature');
  29. if (!$source_signature) {
  30. Dever::alert('错误的来源uid');
  31. }
  32. $user = Dever::loginResult($source_signature, false);
  33. if (!isset($user['uid'])) {
  34. //Dever::alert('错误的来源uid');
  35. }
  36. $source_uid = $user['uid'];
  37. $source_uid = 1;
  38. $id = Dever::input('id');
  39. if (!$id) {
  40. Dever::alert('错误的ID');
  41. }
  42. $type = Dever::input('type');
  43. if (!$type) {
  44. Dever::alert('错误的类型');
  45. }
  46. Dever::load('act/lib/share')->submit_reflux($source_uid, $id, $type, $this->data['uid']);
  47. return array('id' => $id, 'type' => $type);
  48. }
  49. # 点赞
  50. public function submit_up()
  51. {
  52. $id = Dever::input('id');
  53. if (!$id) {
  54. Dever::alert('错误的ID');
  55. }
  56. $type = Dever::input('type');
  57. if (!$type) {
  58. Dever::alert('错误的类型');
  59. }
  60. Dever::load('act/lib/like')->submit($this->data['uid'], $id, $type);
  61. return array('id' => $id, 'type' => $type);
  62. }
  63. # 预约提醒
  64. public function submit_note()
  65. {
  66. $id = Dever::input('id');
  67. if (!$id) {
  68. Dever::alert('错误的ID');
  69. }
  70. $type = Dever::input('type');
  71. if (!$type) {
  72. Dever::alert('错误的类型');
  73. }
  74. Dever::load('act/lib/note')->submit($this->data['uid'], $id, $type);
  75. return array('id' => $id, 'type' => $type);
  76. }
  77. # 发布评论
  78. public function submit_comment()
  79. {
  80. $id = Dever::input('id');
  81. if (!$id) {
  82. Dever::alert('错误的ID');
  83. }
  84. $type = Dever::input('type');
  85. if (!$type) {
  86. Dever::alert('错误的类型');
  87. }
  88. $content = Dever::input('content');
  89. if (!$content) {
  90. Dever::alert('错误的内容');
  91. }
  92. Dever::load('act/lib/comment')->submit($this->data['uid'], $id, $type, $content);
  93. return array('id' => $id, 'type' => $type);
  94. }
  95. }