PortalController.php 990 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020-09-18
  6. * Time: 11:26
  7. */
  8. namespace api\js\controller;
  9. use api\js\model\PortalCategoryModel;
  10. use api\js\model\PortalPostModel;
  11. use cmf\controller\RestBaseController;
  12. class PortalController extends RestBaseController
  13. {
  14. public function getList()
  15. {
  16. $PortalCategoryModel = new PortalCategoryModel();
  17. $id = $this->request->param('id',1);
  18. $list = $PortalCategoryModel->getlist($id);
  19. $this->success('ok',$list);
  20. }
  21. public function getInfo()
  22. {
  23. $id = $this->request->param('id');
  24. $info = PortalPostModel::get($id);
  25. if($id == 7){
  26. $info['video'] = cmf_get_file_download_url($info['video']);
  27. }else{
  28. unset($info['video']);
  29. }
  30. $this->success('ok',$info);
  31. }
  32. }