111
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

76 lines
1.6 KiB

  1. <?php
  2. /**
  3. * @copyright (C)2016-2099 Hnaoyun Inc.
  4. * @author XingMeng
  5. * @email hnxsh@foxmail.com
  6. * @date 2018年2月14日
  7. * Sitemap模型
  8. */
  9. namespace app\home\model;
  10. use core\basic\Model;
  11. class SitemapModel extends Model
  12. {
  13. // 分类栏目列表
  14. public function getSorts()
  15. {
  16. $fields = array(
  17. 'a.id',
  18. 'a.pcode',
  19. 'a.scode',
  20. 'a.name',
  21. 'b.type',
  22. 'a.filename',
  23. 'a.outlink'
  24. );
  25. $join = array(
  26. 'ay_model b',
  27. 'a.mcode=b.mcode',
  28. 'LEFT'
  29. );
  30. $result = parent::table('ay_content_sort a')->field($fields)
  31. ->where("a.acode='" . get_lg() . "'")
  32. ->where('a.status=1')
  33. ->join($join)
  34. ->order('a.pcode,a.sorting,a.id')
  35. ->select();
  36. return $result;
  37. }
  38. // 指定列表内容
  39. public function getList($scode)
  40. {
  41. $fields = array(
  42. 'a.id',
  43. 'a.filename',
  44. 'a.date',
  45. 'c.type'
  46. );
  47. $join = array(
  48. array(
  49. 'ay_content_sort b',
  50. 'a.scode=b.scode',
  51. 'LEFT'
  52. ),
  53. array(
  54. 'ay_model c',
  55. 'b.mcode=c.mcode',
  56. 'LEFT'
  57. )
  58. );
  59. $where = array(
  60. "a.acode='" . get_lg() . "'",
  61. 'a.status=1',
  62. 'c.type=2'
  63. );
  64. return parent::table('ay_content a')->field($fields)
  65. ->where("a.scode='$scode'")
  66. ->where($where)
  67. ->join($join)
  68. ->select();
  69. }
  70. }