CommunityController.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace app\modules\client\controllers\v1\integralAppreciation;
  3. use app\modules\client\controllers\BaseController;
  4. use app\modules\client\models\v1\integralAppreciation\CommunityForm;
  5. class CommunityController extends BaseController
  6. {
  7. /**
  8. * 帖子列表
  9. */
  10. public function actionList() {
  11. $form = new CommunityForm();
  12. $form->attributes = get_params();
  13. $form->store_id = get_store_id();
  14. $form->user = get_user();
  15. return $this->asJson($form->getList());
  16. }
  17. /**
  18. * 添加帖子
  19. */
  20. public function actionSave() {
  21. $form = new CommunityForm();
  22. $form->attributes = post_params();
  23. $form->store_id = get_store_id();
  24. $form->user = get_user();
  25. return $this->asJson($form->save());
  26. }
  27. /**
  28. * 删除帖子
  29. */
  30. public function actionDel() {
  31. $form = new CommunityForm();
  32. $form->attributes = post_params();
  33. $form->store_id = get_store_id();
  34. $form->user = get_user();
  35. return $this->asJson($form->del());
  36. }
  37. }