Index.php 1018 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. * 官网首页
  7. */
  8. namespace app\system\controller\home;
  9. use app\common\model\SystemMiniapp;
  10. class Index extends Common{
  11. /**
  12. * 首页
  13. * @return void
  14. */
  15. public function index(){
  16. $view['list'] = SystemMiniapp::where(['is_lock' => 0,'is_diyapp' => 0])->order('id desc')->paginate(9);
  17. return view('/index')->assign($view);
  18. }
  19. /**
  20. * 应用详情
  21. * @return void
  22. */
  23. public function review(int $id){
  24. $view['info'] = SystemMiniapp::where(['id' => $id,'is_lock' => 0,'is_diyapp' => 0])->find();
  25. if(!$view['info']){
  26. return $this->error("404 NOT FOUND");
  27. }
  28. $view['style_pic'] = empty($view['info']['style_pic']) ? [] :json_decode($view['info']['style_pic'],true);
  29. return view('/review')->assign($view);
  30. }
  31. }