lrf 2 ヶ月 前
コミット
c4e3139b8d

+ 36 - 0
src/controller/gsxx.controller.ts

@@ -0,0 +1,36 @@
+import { Controller, Get, Inject, Param } from "@midwayjs/core";
+import { Page, Query } from "../decorator/page.decorator";
+import { RF } from "../response/CustomerResponse";
+import { PartsService } from "../service/parts.service";
+
+@Controller('/gsxx', { tagName: '供水信息' })
+export class GsxxController { 
+  @Inject()
+  service: PartsService;
+  @Get('/list/:type', { routerName: '供水信息各列表' })
+  async list(@Param('type') type: string, @Query() query: object, @Page() page: object) {
+    const configList = [
+      // 水务公告
+      { channel_id: 156, type: 'swggz' },
+      // 水质报告
+      { channel_id: 157, type: 'szbgz' },
+      // 停水信息
+      { channel_id: 158, type: 'tsxxz' },
+      // 管网压力
+      { channel_id: 159, type: 'gwylz' },
+      // 采购价格信息发布
+      { channel_id: 163, type: 'cgjgxxgbz' },
+    ]
+    const config = configList.find(f => f.type === type)
+    if (!config) return { data: null, total: 0 }
+    const { channel_id } = config
+    const data = await this.service.contentList(channel_id, query, page)
+    return RF.success(data);
+  }
+
+  @Get('/detail/:content_id', { routerName: '供水信息各详情' })
+  async detail(@Param('content_id') content_id: string) {
+    const data = await this.service.contentDetail(content_id)
+    return RF.success(data);
+  }
+}

+ 39 - 0
src/controller/index.controller.ts

@@ -0,0 +1,39 @@
+import { Controller, Get, Inject } from "@midwayjs/core";
+import { RF } from "../response/CustomerResponse";
+import { PartsService } from "../service/parts.service";
+
+
+@Controller('/home', { tagName: '首页' })
+export class HomeController {
+  @Inject()
+  service: PartsService;
+
+  @Get('/jtjs', { routerName: "集团介绍" })
+  async jtjs() {
+    const data = await this.service.jtjs();
+    return RF.success(data);
+  }
+
+  @Get('/jtxw', { routerName: '集团新闻' })
+  async jtxw() {
+    const skip = 0;
+    const limit = 3;
+    const configList = [
+      // 党建天地
+      { channel_id: 186, part: 'djtd' },
+      // 政策法规
+      { channel_id: 187, part: 'zcfg' },
+      // 招标采购
+      { channel_id: 188, part: 'zbcg' },
+      // 集团要闻
+      { channel_id: 189, part: 'jtyw' },
+    ]
+    const returnData = {}
+    for (const config of configList) {
+      const { channel_id, part } = config;
+      const { data: list } = await this.service.contentList(channel_id, {}, { skip, limit })
+      returnData[part] = list;
+    }
+    return RF.success(returnData)
+  }
+}

+ 70 - 0
src/controller/jtjs.controller.ts

@@ -0,0 +1,70 @@
+import { Controller, Get, Inject, Param } from "@midwayjs/core";
+import { RF } from "../response/CustomerResponse";
+import { PartsService } from "../service/parts.service";
+
+
+@Controller('/jtjs', { tagName: '集团介绍' })
+export class JtjsController {
+  @Inject()
+  service: PartsService;
+
+  @Get('/jtjs', { routerName: '集团介绍' })
+  async jtjs() {
+    const data = await this.service.jtjs();
+    return RF.success(data);
+  }
+
+  @Get('/jgsz', { routerName: '机构设置' })
+  async jgsz() {
+    const data = await this.service.jgsz();
+    return RF.success(data);
+  }
+
+  @Get('/gsjs', { routerName: '公司介绍' })
+  async gsjs() {
+    const configList = [
+      //长春水务集团自来水有限公司
+      { channel_id: 177, part: 'ccswjtzlsyxgs' },
+      //长春水务集团源水有限责任公司
+      { channel_id: 178, part: 'ccswjtysyxzrgs' },
+      // 长春水务集团城市排水有限责任公司
+      { channel_id: 179, part: 'ccswjtcspsyxzrgs' },
+      // 长春市二次供水有限责任公司
+      { channel_id: 180, part: 'ccsecgsyxzrgs' },
+    ]
+    const returnData = {}
+    for (const config of configList) {
+      const { channel_id, part } = config;
+      const data = await this.service.channelDetail(channel_id)
+      if (data) returnData[part] = data;
+    }
+    return RF.success(returnData)
+  }
+
+  @Get('/scfm', { routerName: '三产风貌' })
+  async scfm() {
+    const configList = [
+      //长春水务集团自来水有限公司
+      { channel_id: 182, part: 'ccsgsgcgs' },
+      //长春水务集团源水有限责任公司
+      { channel_id: 183, part: 'cczlsgssbc' },
+      // 长春水务集团城市排水有限责任公司
+      { channel_id: 184, part: 'ccshhjzazgcyxgs' },
+      // 长春市二次供水有限责任公司
+      { channel_id: 185, part: 'ccshyjdsbazyxgs' },
+    ]
+    const returnData = {}
+    for (const config of configList) {
+      const { channel_id, part } = config;
+      const data = await this.service.channelDetail(channel_id)
+      if (data) returnData[part] = data;
+    }
+    return RF.success(returnData)
+  }
+
+  @Get('/scfm/:channel_id', { routerName: '三产风貌单数据详情' })
+  async scfmDetail(@Param('channel_id') channel_id: string) {
+    const data = await this.service.channelDetail(channel_id)
+    return RF.success(data)
+  }
+}

+ 34 - 0
src/controller/jtxw.controller.ts

@@ -0,0 +1,34 @@
+import { Controller, Get, Inject, Param } from "@midwayjs/core";
+import { PartsService } from "../service/parts.service";
+import { Page, Query } from "../decorator/page.decorator";
+import { RF } from "../response/CustomerResponse";
+
+@Controller('/jtxw', { tagName: '集团新闻' })
+export class JtxwController {
+  @Inject()
+  service: PartsService;
+  @Get('/list/:type', { routerName: '集团新闻列表' })
+  async list(@Param('type') type: string, @Query() query: object, @Page() page: object) {
+    const configList = [
+      // 党建天地
+      { channel_id: 186, type: 'djtd' },
+      // 政策法规
+      { channel_id: 187, type: 'zcfg' },
+      // 招标采购
+      { channel_id: 188, type: 'zbcg' },
+      // 集团要闻
+      { channel_id: 189, type: 'jtyw' },
+    ]
+    const config = configList.find(f => f.type === type)
+    if (!config) return { data: null, total: 0 }
+    const { channel_id } = config
+    const data = await this.service.contentList(channel_id, query, page)
+    return RF.success(data);
+  }
+
+  @Get('/detail/:content_id', { routerName: '集团新闻详情' })
+  async detail(@Param('content_id') content_id: string) {
+    const data = await this.service.contentDetail(content_id)
+    return RF.success(data);
+  }
+}

+ 23 - 0
src/controller/myzj.controller.ts

@@ -0,0 +1,23 @@
+import { Controller, Inject, Get, Param } from "@midwayjs/core";
+import { Page, Query } from "../decorator/page.decorator";
+import { PartsService } from "../service/parts.service";
+import { RF } from "../response/CustomerResponse";
+
+@Controller('/myzj', { tagName: '民意征集' })
+export class MyzjController {
+  @Inject()
+  service: PartsService;
+
+  @Get('/list/rdhy', { routerName: '热点回应列表' })
+  async list(@Query() query: object, @Page() page: object) {
+    const channel_id = 197
+    const data = await this.service.contentList(channel_id, query, page)
+    return RF.success(data)
+  }
+
+  @Get('/detail/:content_id', { routerName: '热点回应详情' })
+  async detail(@Param('content_id') content_id: string) {
+    const data = await this.service.contentDetail(content_id)
+    return RF.success(data);
+  }
+}

+ 158 - 0
src/controller/xxgk.controller.ts

@@ -0,0 +1,158 @@
+import { Controller, Get, Inject } from "@midwayjs/core";
+import { PartsService } from "../service/parts.service";
+import { RF } from "../response/CustomerResponse";
+
+@Controller('/xxgk', { tagName: '信息公开' })
+export class XxgkController {
+  @Inject()
+  service: PartsService;
+
+  @Get('/jgsz', { routerName: '机构设置' })
+  async jgsz() {
+    const data = await this.service.jgsz()
+    return RF.success(data)
+  }
+
+  @Get('/psgsxxgk', { routerName: '排水公司信息公开' })
+  async psgsxxgk() {
+    const channel_id = 212;
+    const data = await this.service.channelDetail(channel_id)
+    return RF.success(data);
+  }
+
+  @Get('/schjxxgk', { routerName: '水厂环境信息公开' })
+  async schjxxgk() {
+    const channel_id = 213;
+    const data = await this.service.channelDetail(channel_id)
+    return RF.success(data);
+  }
+
+  @Get('/xyzl', { routerName: '行业自律' })
+  async xyzl() {
+    const channel_id = 214;
+    const data = await this.service.channelDetail(channel_id)
+    return RF.success(data);
+  }
+
+  @Get('/ccswjt2018nzfxxgkndgzbg', { routerName: '长春水务集团2018年政府信息公开年度工作报告' })
+  async ccswjt2018nzfxxgkndgzbg() {
+    const channel_id = 215;
+    const data = await this.service.channelDetail(channel_id)
+    return RF.success(data);
+  }
+
+  @Get('/ccswjt2019ngz', { routerName: '长春水务集团2019年工作' })
+  async ccswjt2019ngz() {
+    const channel_id = 216;
+    const data = await this.service.channelDetail(channel_id)
+    return RF.success(data);
+  }
+
+  @Get('/zhswfw', { routerName: '智慧水务(互联网+供水服务)' })
+  async zhswfw() {
+    const channel_id = 217;
+    const data = await this.service.channelDetail(channel_id)
+    return RF.success(data);
+  }
+  /**
+   * 只有获得用水是channel的数据,剩下的几个都显示的是content列表
+   */
+  @Get('/hdysz', { routerName: '获得用水(用水发展)' })
+  async hdysz() {
+    const channel_id = await this.service.searchChannelIdByCode('hdysz')
+    const channelData = await this.service.channelDetail(channel_id);
+    return RF.success(channelData)
+  }
+
+  @Get('/zhswz', { routerName: '智慧水务' })
+  async zhswz() {
+    const channel_id = await this.service.searchChannelIdByCode('zhswz')
+    const contentList = await this.service.contentList(channel_id)
+    return RF.success(contentList)
+  }
+
+  @Get('/khfwz', { routerName: '客户服务' })
+  async khfwz() {
+    const channel_id = await this.service.searchChannelIdByCode('khfwz')
+    const contentList = await this.service.contentList(channel_id)
+    return RF.success(contentList)
+  }
+
+  @Get('/yscsz', { routerName: '用水常识' })
+  async yscsz() {
+    const channel_id = await this.service.searchChannelIdByCode('yscsz')
+    const contentList = await this.service.contentList(channel_id)
+    return RF.success(contentList)
+  }
+
+  @Get('/xqyshj', { routerName: '新区营商环境' })
+  async xqyshj() {
+    const channel_id = await this.service.searchChannelIdByCode('xqyshj')
+    const contentList = await this.service.contentList(channel_id)
+    return RF.success(contentList)
+  }
+
+  @Get('/fwxx', { routerName: '服务信息' })
+  async fwxx() {
+    const channel_id = await this.service.searchChannelIdByCode('fwxx')
+    const channelData = await this.service.channelDetail(channel_id);
+    return RF.success(channelData)
+  }
+
+  @Get('/fwxm', { routerName: '服务项目' })
+  async fwxm() {
+    const channel_id = await this.service.searchChannelIdByCode('fwxm')
+    const channelData = await this.service.channelDetail(channel_id);
+    return RF.success(channelData)
+  }
+
+  @Get('/fwsf', { routerName: '服务收费' })
+  async fwsf() {
+    const channel_id = await this.service.searchChannelIdByCode('fwsf')
+    const channelData = await this.service.channelDetail(channel_id);
+    return RF.success(channelData)
+  }
+
+  @Get('/fwjd', { routerName: '服务监督' })
+  async fwjd() {
+    const channel_id = await this.service.searchChannelIdByCode('fwjd')
+    const channelData = await this.service.channelDetail(channel_id);
+    return RF.success(channelData)
+  }
+
+  @Get('/yjfwya', { routerName: '应急服务预案' })
+  async yjfwya() {
+    const channel_id = await this.service.searchChannelIdByCode('yjfwya')
+    const channelData = await this.service.channelDetail(channel_id);
+    return RF.success(channelData)
+  }
+
+  @Get('/jcxxgk', { routerName: '决策信息公开' })
+  async jcxxgk() {
+    const channel_id = await this.service.searchChannelIdByCode('jcxxgk')
+    const channelData = await this.service.channelDetail(channel_id);
+    return RF.success(channelData)
+  }
+
+  @Get('/zyzclsqk', { routerName: '重要政策落实情况' })
+  async zyzclsqk() {
+    const channel_id = await this.service.searchChannelIdByCode('zyzclsqk')
+    const channelData = await this.service.channelDetail(channel_id);
+    return RF.success(channelData)
+  }
+
+  @Get('/qyscjyqk', { routerName: '企业生产经营情况' })
+  async qyscjyqk() {
+    const channel_id = await this.service.searchChannelIdByCode('qyscjyqk')
+    const channelData = await this.service.channelDetail(channel_id);
+    return RF.success(channelData)
+  }
+
+  @Get('/qyyxdrdzyjjfs', { routerName: '企业与相对人的争议解决方式' })
+  async qyyxdrdzyjjfs() {
+    const channel_id = await this.service.searchChannelIdByCode('qyyxdrdzyjjfs')
+    const channelData = await this.service.channelDetail(channel_id);
+    return RF.success(channelData)
+  }
+
+}

+ 34 - 0
src/controller/zjsw.controller.ts

@@ -0,0 +1,34 @@
+import { Controller, Inject, Get, Param } from "@midwayjs/core";
+import { PartsService } from "../service/parts.service";
+import { RF } from "../response/CustomerResponse";
+
+@Controller('/zjsw', { tagName: '资质荣誉' })
+export class ZjswController {
+  @Inject()
+  service: PartsService;
+
+  @Get('/:type', { routerName: '资质荣誉各详情' })
+  async zjsw(@Param('type') type: string) {
+    const configList = [
+      // 客服中心
+      { channel_id: 199, type: 'zjswkfzx' },
+      // 水务集团
+      { channel_id: 200, type: 'zjswswjt' },
+      // 信息中心
+      { channel_id: 201, type: 'zjswxxzx' },
+      // 党委工作部
+      { channel_id: 202, type: 'zjswdwgzb' },
+      // 朝阳分公司
+      { channel_id: 203, type: 'zjswcyfgs' },
+      // 第一净水厂
+      { channel_id: 204, type: 'zjswdyjsc' },
+      // 第二净水厂
+      { channel_id: 205, type: 'zjswdejsc' },
+    ]
+    const config = configList.find(f => f.type === type)
+    if (!config) return { data: null }
+    const { channel_id } = config
+    const data = await this.service.channelDetail(channel_id)
+    return RF.success(data);
+  }
+}

+ 26 - 0
src/entity/jc_channel.ts

@@ -0,0 +1,26 @@
+
+import { Column, Entity, PrimaryColumn } from 'typeorm';
+
+@Entity('jc_channel', { comment: 'CMS栏目表' })
+export class JcChannel {
+  @PrimaryColumn()
+  channel_id: number;
+  @Column({ comment: '模型ID' })
+  model_id: number;
+  @Column({ comment: '站点ID' })
+  site_id: number;
+  @Column({ comment: '父栏目ID' })
+  parent_id: number;
+  @Column({ comment: '访问路径' })
+  channel_path: string;
+  @Column({ comment: '树左边' })
+  lft: number;
+  @Column({ comment: '树右边' })
+  rgt: number;
+  @Column({ comment: '排列顺序' })
+  priority: number;
+  @Column({ comment: '是否有内容' })
+  has_content: number;
+  @Column({ comment: '是否显示' })
+  is_display: number;
+}

+ 12 - 0
src/entity/jc_channel_attr.ts

@@ -0,0 +1,12 @@
+
+import { Column, Entity, PrimaryColumn } from 'typeorm';
+
+@Entity('jc_channel_attr', { comment: 'CMS栏目扩展属性表' })
+export class JcChannelAttr {
+  @PrimaryColumn()
+  channel_id: number;
+  @Column({ comment: '名称' })
+  attr_name: string;
+  @Column({ comment: '值' })
+  attr_value: string;
+}

+ 27 - 0
src/entity/jc_channel_count.ts

@@ -0,0 +1,27 @@
+
+import { Column, Entity, PrimaryColumn } from 'typeorm';
+
+@Entity('jc_channel_count', { comment: 'CMS栏目访问量计数表' })
+export class JcChannelAttr {
+  @PrimaryColumn()
+  channel_id: number;
+  @Column({ comment: '总访问数' })
+  views: number;
+  @Column({ comment: '月访问数' })
+  views_month: number;
+  @Column({ comment: '周访问数' })
+  views_week: number;
+  @Column({ comment: '日访问数' })
+  views_day: number;
+  @Column({ comment: '内容发布数' })
+  content_count_total: number;
+  @Column({ comment: '内容今日发布数' })
+  content_count_day: number;
+  @Column({ comment: '内容本周发布数' })
+  content_count_week: number;
+  @Column({ comment: '内容本月发布数' })
+  content_count_month: number;
+  @Column({ comment: '内容今年发布数' })
+  content_count_year: number;
+
+}

+ 73 - 0
src/entity/jc_channel_ext.ts

@@ -0,0 +1,73 @@
+
+import { Column, Entity, PrimaryColumn } from 'typeorm';
+
+@Entity('jc_channel_ext', { comment: 'CMS栏目内容表' })
+export class JcChannelExt {
+  @PrimaryColumn()
+  channel_id: number;
+  @Column({ comment: '名称' })
+  channel_name: string;
+
+  @Column({ comment: '终审级别' })
+  final_step: number;
+  @Column({ comment: '审核后(1:不能修改删除;2:修改后退回;3:修改后不变)' })
+  after_check: number;
+
+  @Column({ comment: '是否栏目静态化' })
+  is_static_channel: string;
+  @Column({ comment: '是否内容静态化' })
+  is_static_content: string;
+  @Column({ comment: '是否使用目录访问' })
+  is_access_by_dir: string;
+  @Column({ comment: '是否使用子栏目列表' })
+  is_list_child: string;
+  @Column({ comment: '每页多少条记录' })
+  page_size: number;
+
+  @Column({ comment: '栏目页生成规则' })
+  channel_rule: string;
+  @Column({ comment: '内容页生成规则' })
+  content_rule: string;
+  @Column({ comment: '外部链接' })
+  link: string;
+  @Column({ comment: '栏目页模板' })
+  tpl_channel: string;
+  @Column({ comment: '内容页模板' })
+  tpl_content: string;
+  @Column({ comment: '缩略图' })
+  title_img: string;
+  @Column({ comment: '内容图' })
+  content_img: string;
+
+  @Column({ comment: '内容是否有缩略图' })
+  has_title_img: number;
+  @Column({ comment: '内容是否有内容图' })
+  has_content_img: number;
+  @Column({ comment: '内容标题图宽度' })
+  title_img_width: number;
+  @Column({ comment: '内容标题图高度' })
+  title_img_height: number;
+
+  @Column({ comment: '内容内容图宽度' })
+  content_img_width: number;
+  @Column({ comment: '内容内容图高度' })
+  content_img_height: number;
+  @Column({ comment: '评论(0:匿名;1:会员一次;2:关闭,3会员多次)' })
+  comment_control: number;
+  @Column({ comment: '顶踩(true: 开放;false: 关闭) ' })
+  allow_updown: number;
+  @Column({ comment: '是否新窗口打开' })
+  is_blank: number;
+  @Column({ comment: 'TITLE' })
+  title: string;
+  @Column({ comment: 'KEYWORDS' })
+  keywords: string;
+  @Column({ comment: 'DESCRIPTION' })
+  description: string;
+  @Column({ comment: '分享(true:开放;false:关闭)' })
+  allow_share: number;
+  @Column({ comment: '评分(true:开放;false:关闭)' })
+  allow_score: number;
+  @Column({ comment: '手机栏目页模板' })
+  tpl_mobile_channel: string;
+}

+ 16 - 0
src/entity/jc_channel_model.ts

@@ -0,0 +1,16 @@
+
+import { Column, Entity, PrimaryColumn } from 'typeorm';
+
+@Entity('jc_channel_model', { comment: '栏目可选内容模型表' })
+export class JcChannelModel {
+  @PrimaryColumn()
+  channel_id: number;
+  @Column({ comment: '模型id' })
+  model_id: number;
+  @Column({ comment: '内容模板' })
+  tpl_content: string;
+  @Column({ comment: '排序' })
+  priority: number;
+  @Column({ comment: '手机内容页模板' })
+  tpl_mobile_content: string;
+}

+ 16 - 0
src/entity/jc_channel_txt.ts

@@ -0,0 +1,16 @@
+
+import { Column, Entity, PrimaryColumn } from 'typeorm';
+
+@Entity('jc_channel_txt', { comment: 'CMS栏目文本表' })
+export class JcChannelTxt {
+  @PrimaryColumn()
+  channel_id: number;
+  @Column({ comment: '栏目内容' })
+  txt: string;
+  @Column({ comment: '扩展内容1' })
+  txt1: string;
+  @Column({ comment: '扩展内容2' })
+  txt2: string;
+  @Column({ comment: '扩展内容3' })
+  txt3: string;
+}

+ 10 - 0
src/entity/jc_channel_user.ts

@@ -0,0 +1,10 @@
+
+import { Column, Entity, PrimaryColumn } from 'typeorm';
+
+@Entity('jc_channel_user', { comment: 'CMS栏目用户关联表' })
+export class JcChannelUser {
+  @PrimaryColumn()
+  channel_id: number;
+  @Column({ comment: '模型id' })
+  user_id: number;
+}

+ 1 - 0
src/entity/jc_site_company.ts

@@ -1,4 +1,5 @@
 import { Column, Entity, PrimaryColumn } from 'typeorm';
+// 没用
 @Entity('jc_site_company', { comment: '公司信息' })
 export class JcSiteCompany {
   @PrimaryColumn()

+ 1 - 1
src/service/frame/common.service.ts

@@ -30,7 +30,7 @@ export class CommonService {
    * @returns data 数据
    */
   async getOne(model: Repository<ObjectLiteral>, query: object) {
-    const data = await model.findOne(query);
+    const data = await model.findOne({ where: query });
     return data;
   }
 

+ 90 - 0
src/service/parts.service.ts

@@ -0,0 +1,90 @@
+import { Inject, Provide } from "@midwayjs/core";
+import { CommonService } from "./frame/common.service";
+import { get } from "lodash";
+
+@Provide()
+export class PartsService {
+  @Inject()
+  service: CommonService;
+  /**
+   * 根据编码查找channel对应的内容,主要是给-信息公开下的:
+   * 获得用水: hdysz
+   * 智慧水务: zhswz
+   * 客户服务: khfwz
+   * 用水常识: yscsz
+   * 新区营商环境: xqyshj
+   * 查找channel_id
+   * @param code channel编码
+   */
+  async searchChannelIdByCode(code) {
+    const channel = this.service.getModel('channel')
+    const channelData = await this.service.getOne(channel, { where: { channel_path: code } })
+    if (!channelData) return
+    const channel_id = get(channelData, 'channel_id')
+    return channel_id;
+  }
+
+
+
+  /**集团介绍 */
+  async jtjs() {
+    const channel_id = 175;
+    const channelTxt = this.service.getModel("jc_channel_txt")
+    const data = await this.service.getOne(channelTxt, { channel_id })
+    return data;
+  }
+  /**机构设置 */
+  async jgsz() {
+    const channel_id = 210;
+    const channelTxt = this.service.getModel("jc_channel_txt")
+    const data = await this.service.getOne(channelTxt, { channel_id })
+    return data;
+  }
+
+
+  /**channel列表查询 */
+  async channelList(channel_id, query = {}, page = {}, others = {}) {
+    const extModel = this.service.getModel("jc_channel_ext")
+    const txtModel = this.service.getModel("jc_channel_txt")
+    let { data, total } = await this.service.search(extModel, { channel_id, ...query }, page, others)
+    for (const ext of data) {
+      const channel_id = get(ext, 'channel_id')
+      const txt = await this.service.getOne(txtModel, { channel_id })
+      if (txt) ext.txt = txt;
+    }
+    return { data, total }
+  }
+
+  /**channel详情查询 */
+  async channelDetail(id) {
+    const extModel = this.service.getModel("jc_channel_ext")
+    const txtModel = this.service.getModel("jc_channel_txt")
+    let ext = await this.service.getOne(extModel, { channel_id: id })
+    const txt = await this.service.getOne(txtModel, { channel_id: id })
+    ext = { ...ext, txt }
+    return ext;
+  }
+
+  /**content列表查询 */
+  async contentList(channel_id, query = {}, page = {}, others = {}) {
+    const extModel = this.service.getModel("jc_content_ext")
+    const txtModel = this.service.getModel("jc_content_txt")
+    let { data, total } = await this.service.search(extModel, { channel_id, ...query }, page, others)
+    for (const ext of data) {
+      const content_id = get(ext, 'content_id')
+      const txt = await this.service.getOne(txtModel, { content_id })
+      if (txt) ext.txt = txt;
+    }
+    return { data, total }
+  }
+
+  /**content详情查询 */
+  async contentDetail(id) {
+    const extModel = this.service.getModel("jc_content_ext")
+    const txtModel = this.service.getModel("jc_content_txt")
+    let ext = await this.service.getOne(extModel, { content_id: id })
+    const txt = await this.service.getOne(txtModel, { content_id: id })
+    ext = { ...ext, txt }
+    return ext;
+  }
+}