作者 jinglong
1 个管道 的构建 通过 耗费 0 秒

修改富文本解析

@@ -13,6 +13,7 @@ namespace api\home\controller; @@ -13,6 +13,7 @@ namespace api\home\controller;
13 use cmf\controller\RestBaseController; 13 use cmf\controller\RestBaseController;
14 use think\Db; 14 use think\Db;
15 use think\Validate; 15 use think\Validate;
  16 +use app\portal\model\PortalPostModel;
16 /** 17 /**
17 * @title 产品系列 18 * @title 产品系列
18 */ 19 */
@@ -180,6 +181,10 @@ class SeriesController extends RestBaseController @@ -180,6 +181,10 @@ class SeriesController extends RestBaseController
180 //查找父类名称 181 //查找父类名称
181 $pid = CommonController::findData('type',['id'=>$res['t_id']],'pid'); 182 $pid = CommonController::findData('type',['id'=>$res['t_id']],'pid');
182 $parent_name = CommonController::findData('type',['id'=>$pid['pid']],$flag); 183 $parent_name = CommonController::findData('type',['id'=>$pid['pid']],$flag);
  184 + if($res){
  185 + $contentModel = new PortalPostModel();
  186 + $res['detail'] = $contentModel->getPostContentAttr($res['detail']);
  187 + }
183 $this->success('成功',['data'=>$res,'parent_name'=>$parent_name['name']]); 188 $this->success('成功',['data'=>$res,'parent_name'=>$parent_name['name']]);
184 } 189 }
185 } 190 }
@@ -12,6 +12,7 @@ namespace api\home\controller; @@ -12,6 +12,7 @@ namespace api\home\controller;
12 12
13 use cmf\controller\RestBaseController; 13 use cmf\controller\RestBaseController;
14 use think\Validate; 14 use think\Validate;
  15 +use app\portal\model\PortalPostModel;
15 /** 16 /**
16 * @title 主要服务 17 * @title 主要服务
17 */ 18 */
@@ -75,6 +76,10 @@ class ServiceController extends RestBaseController @@ -75,6 +76,10 @@ class ServiceController extends RestBaseController
75 $field_service = 'id,name,detail'; 76 $field_service = 'id,name,detail';
76 } 77 }
77 $res = CommonController::findData('service',['id'=>$service_id],$field_service); 78 $res = CommonController::findData('service',['id'=>$service_id],$field_service);
  79 + if($res){
  80 + $contentModel = new PortalPostModel();
  81 + $res['detail'] = $contentModel->getPostContentAttr($res['detail']);
  82 + }
78 $this->success('成功',$res); 83 $this->success('成功',$res);
79 } 84 }
80 } 85 }