Education.php 800 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\api\controller;
  3. use Alipay\EasySDK\Kernel\Base;
  4. use think\facade\Db;
  5. class Education extends Base
  6. {
  7. /**
  8. * 课程列表页面
  9. * @return \think\response\Json
  10. */
  11. public function index()
  12. {
  13. $EducationModel = new \app\model\api\Education();
  14. $where["audit"] = 1;
  15. $type1 = input("type1", "");
  16. if ($type1 !== "") {
  17. $where["type1"] = $type1;
  18. }
  19. $grlist = $EducationModel->getEducationGrList($where, 20, "od asc,recommend desc,gr_id desc");
  20. $recommendList = $EducationModel->getRecommendEducationGrList(9, "od asc,recommend desc,gr_id desc");
  21. $result = [
  22. 'grlist' => $grlist,
  23. 'recommendList' => $recommendList,
  24. ];
  25. return json($result);
  26. }
  27. }