12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- /**
- * @copyright (C)2016-2099 Hnaoyun Inc.
- * @author XingMeng
- * @email hnxsh@foxmail.com
- * @date 2018年2月14日
- * Sitemap模型
- */
- namespace app\home\model;
-
- use core\basic\Model;
-
- class SitemapModel extends Model
- {
-
- // 分类栏目列表
- public function getSorts()
- {
- $fields = array(
- 'a.id',
- 'a.pcode',
- 'a.scode',
- 'a.name',
- 'a.filename',
- 'a.outlink',
- 'b.type',
- 'b.urlname'
- );
- $join = array(
- 'ay_model b',
- 'a.mcode=b.mcode',
- 'LEFT'
- );
- $where = [
- 'a.scode NOT IN(13,19,26)',
- 'a.pcode NOT IN(13,19,26)',
- ];
- $result = parent::table('ay_content_sort a')->field($fields)
- ->where('a.status=1')
- ->where("a.acode='" . get_lg() . "'")
- ->where($where)
- ->join($join)
- ->order('a.pcode,a.sorting,a.id')
- ->select();
- return $result;
- }
-
- // 指定列表内容
- public function getSortContent($scode)
- {
- $fields = array(
- 'a.id',
- 'a.filename',
- 'a.date',
- 'c.type',
- 'c.urlname',
- 'b.scode',
- 'b.scode as bscode',
- 'b.pcode as bpcode',
- 'b.filename as sortfilename'
- );
- $join = array(
- array(
- 'ay_content_sort b',
- 'a.scode=b.scode',
- 'LEFT'
- ),
- array(
- 'ay_model c',
- 'b.mcode=c.mcode',
- 'LEFT'
- )
- );
-
- $where = array(
- 'b.scode NOT IN(13,19,26)',
- 'b.pcode NOT IN(13,19,26)',
- 'a.status=1',
- 'c.type=2',
- "a.date<'" . date('Y-m-d H:i:s') . "'"
- );
- return parent::table('ay_content a')->field($fields)
- ->where("a.scode='$scode'")
- ->where($where)
- ->join($join)
- ->select();
- }
- }
|