作者 景龙
1 个管道 的构建 通过 耗费 1 秒

增加星球奇境,星域秀场详情页数据的调用

@@ -42,7 +42,7 @@ class AdminRegionNoteController extends AdminBaseController @@ -42,7 +42,7 @@ class AdminRegionNoteController extends AdminBaseController
42 $categoryTree = $portalCategoryModel->adminCategoryTree($categoryId); 42 $categoryTree = $portalCategoryModel->adminCategoryTree($categoryId);
43 $this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : ''); 43 $this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : '');
44 $this->assign('end_time', isset($param['end_time']) ? $param['end_time'] : ''); 44 $this->assign('end_time', isset($param['end_time']) ? $param['end_time'] : '');
45 - $this->assign('post_title', isset($param['post_title']) ? $param['post_title'] : ''); 45 + $this->assign('full_name', isset($param['full_name']) ? $param['full_name'] : '');
46 $this->assign('articles', $articles); 46 $this->assign('articles', $articles);
47 $this->assign('category_tree', $categoryTree); 47 $this->assign('category_tree', $categoryTree);
48 $this->assign('category', $categoryId); 48 $this->assign('category', $categoryId);
@@ -63,11 +63,7 @@ class RegionController extends HomeBaseController @@ -63,11 +63,7 @@ class RegionController extends HomeBaseController
63 $res_djrz = $this->getChildArticle($position,$field,3); 63 $res_djrz = $this->getChildArticle($position,$field,3);
64 foreach($res_djrz as &$value){ 64 foreach($res_djrz as &$value){
65 $more = json_decode($value['more'],true); 65 $more = json_decode($value['more'],true);
66 - if(isset($more['photos']) && !empty($more['photos'])){  
67 - $value['thumbnail'] = $more['photos'][0]['url'];  
68 - }else{  
69 - $value['thumbnail'] = '';  
70 - } 66 + $value['thumbnail'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
71 } 67 }
72 $this->assign('res_djrz',$res_djrz); 68 $this->assign('res_djrz',$res_djrz);
73 69
@@ -159,6 +155,15 @@ class RegionController extends HomeBaseController @@ -159,6 +155,15 @@ class RegionController extends HomeBaseController
159 $this->assign('res',$res); 155 $this->assign('res',$res);
160 } 156 }
161 157
  158 + //明星访谈详情
  159 + public function getStarDetail(){
  160 + $id = $this->request->param('id',0,'intval');
  161 + $field = 'id,thumbnail avatar,full_name,position,trade,post_excerpt,create_time,post_content';
  162 + $starModel = new StarController();
  163 + $res = $starModel->getDetail($id,$field);
  164 + $this->assign('res',$res);
  165 + }
  166 +
162 //星球故事更多 167 //星球故事更多
163 public function getMoreStory(){ 168 public function getMoreStory(){
164 $page = $this->request->param('page',1,'intval'); 169 $page = $this->request->param('page',1,'intval');
@@ -189,4 +194,35 @@ class RegionController extends HomeBaseController @@ -189,4 +194,35 @@ class RegionController extends HomeBaseController
189 $res = $this->getChildArticlePage($position,$field,$page,6); 194 $res = $this->getChildArticlePage($position,$field,$page,6);
190 $this->assign('res',$res); 195 $this->assign('res',$res);
191 } 196 }
  197 +
  198 + //独角快报详情
  199 + public function getNewsDetail(){
  200 + $id = $this->request->param('id',0,'intval');
  201 + $field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content';
  202 + $starModel = new StarController();
  203 + $res = $starModel->getDetail($id,$field);
  204 + $this->assign('res',$res);
  205 + }
  206 +
  207 + //独角日志详情
  208 + public function getNoteDetail(){
  209 + $id = $this->request->param('id',0,'intval');
  210 + $field = 'id,thumbnail avatar,full_name,post_excerpt,create_time,post_content';
  211 + $starModel = new StarController();
  212 + $res = $starModel->getDetail($id,$field);
  213 + $this->assign('res',$res);
  214 + }
  215 +
  216 + //童趣未来详情
  217 + public function getFutureDetail(){
  218 + $id = $this->request->param('id',0,'intval');
  219 + $field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
  220 + $starModel = new StarController();
  221 + $res = $starModel->getDetail($id,$field);
  222 + if($res){
  223 + $more = json_decode($res['more'],true);
  224 + $res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
  225 + }
  226 + $this->assign('res',$res);
  227 + }
192 } 228 }
@@ -27,8 +27,10 @@ class StarController extends HomeBaseController @@ -27,8 +27,10 @@ class StarController extends HomeBaseController
27 $field = 'id,thumbnail,post_excerpt,more'; 27 $field = 'id,thumbnail,post_excerpt,more';
28 $res_xqgs = $this->getChildArticle($position,$field,1); 28 $res_xqgs = $this->getChildArticle($position,$field,1);
29 foreach($res_xqgs as &$value){ 29 foreach($res_xqgs as &$value){
30 - $video = json_decode($value['more'],true);  
31 - $value['audio'] = $video['audio']; 30 + $more = json_decode($value['more'],true);
  31 + if(isset($more['audio']) && !empty($more['audio'])){
  32 + $value['audio'] = $more['audio'];
  33 + }
32 } 34 }
33 $this->assign('res_xqgs',$res_xqgs); 35 $this->assign('res_xqgs',$res_xqgs);
34 36
@@ -119,6 +121,19 @@ class StarController extends HomeBaseController @@ -119,6 +121,19 @@ class StarController extends HomeBaseController
119 $this->assign('res',$res); 121 $this->assign('res',$res);
120 } 122 }
121 123
  124 + //网红美景详情
  125 + public function getSceneryDetail(){
  126 + $id = $this->request->param('id',0,'intval');
  127 + $field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
  128 + $res = $this->getDetail($id,$field);
  129 + if($res){
  130 + $more = json_decode($res['more'],true);
  131 + $res['audio'] = isset($more['audio']) && !empty($more['audio'])?$more['audio']:'';
  132 + $res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
  133 + }
  134 + $this->assign('res',$res);
  135 + }
  136 +
122 //异域珍馐更多 137 //异域珍馐更多
123 public function getMoreFood(){ 138 public function getMoreFood(){
124 $page = $this->request->param('page',1,'intval'); 139 $page = $this->request->param('page',1,'intval');
@@ -130,6 +145,18 @@ class StarController extends HomeBaseController @@ -130,6 +145,18 @@ class StarController extends HomeBaseController
130 $this->assign('res',$res); 145 $this->assign('res',$res);
131 } 146 }
132 147
  148 + //异域珍馐详情
  149 + public function getFoodDetail(){
  150 + $id = $this->request->param('id',0,'intval');
  151 + $field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
  152 + $res = $this->getDetail($id,$field);
  153 + if($res){
  154 + $more = json_decode($res['more'],true);
  155 + $res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
  156 + }
  157 + $this->assign('res',$res);
  158 + }
  159 +
133 //良宿美寝更多 160 //良宿美寝更多
134 public function getMoreHotel(){ 161 public function getMoreHotel(){
135 $page = $this->request->param('page',1,'intval'); 162 $page = $this->request->param('page',1,'intval');
@@ -139,6 +166,18 @@ class StarController extends HomeBaseController @@ -139,6 +166,18 @@ class StarController extends HomeBaseController
139 $this->assign('res',$res); 166 $this->assign('res',$res);
140 } 167 }
141 168
  169 + //良宿美寝详情
  170 + public function getHotelDetail(){
  171 + $id = $this->request->param('id',0,'intval');
  172 + $field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
  173 + $res = $this->getDetail($id,$field);
  174 + if($res){
  175 + $more = json_decode($res['more'],true);
  176 + $res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
  177 + }
  178 + $this->assign('res',$res);
  179 + }
  180 +
142 //活力生态更多 181 //活力生态更多
143 public function getMoreEcology(){ 182 public function getMoreEcology(){
144 $page = $this->request->param('page',1,'intval'); 183 $page = $this->request->param('page',1,'intval');
@@ -148,6 +187,18 @@ class StarController extends HomeBaseController @@ -148,6 +187,18 @@ class StarController extends HomeBaseController
148 $this->assign('res',$res); 187 $this->assign('res',$res);
149 } 188 }
150 189
  190 + //活力生态详情
  191 + public function getEcologyDetail(){
  192 + $id = $this->request->param('id',0,'intval');
  193 + $field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
  194 + $res = $this->getDetail($id,$field);
  195 + if($res){
  196 + $more = json_decode($res['more'],true);
  197 + $res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
  198 + }
  199 + $this->assign('res',$res);
  200 + }
  201 +
151 //便利出行更多 202 //便利出行更多
152 public function getMoreTravel(){ 203 public function getMoreTravel(){
153 $page = $this->request->param('page',1,'intval'); 204 $page = $this->request->param('page',1,'intval');
@@ -156,4 +207,38 @@ class StarController extends HomeBaseController @@ -156,4 +207,38 @@ class StarController extends HomeBaseController
156 $res = $this->getChildArticlePage($position,$field,$page); 207 $res = $this->getChildArticlePage($position,$field,$page);
157 $this->assign('res',$res); 208 $this->assign('res',$res);
158 } 209 }
  210 +
  211 + //便利出行详情
  212 + public function getTravelDetail(){
  213 + $id = $this->request->param('id',0,'intval');
  214 + $field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
  215 + $res = $this->getDetail($id,$field);
  216 + if($res){
  217 + $more = json_decode($res['more'],true);
  218 + $res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
  219 + }
  220 + $this->assign('res',$res);
  221 + }
  222 +
  223 + //获取文章详情
  224 + public function getDetail($id,$field){
  225 + $pre = CityCategoryModel::pre;
  226 + $res = Db::table($pre.'portal_post')
  227 + ->where(['id'=>$id,'delete_time'=>0])
  228 + ->field($field)
  229 + ->find();
  230 + return $res;
  231 + }
  232 +
  233 + //星球故事详情
  234 + public function getStoryDetail(){
  235 + $id = $this->request->param('id',0,'intval');
  236 + $field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
  237 + $res = $this->getDetail($id,$field);
  238 + if($res){
  239 + $more = json_decode($res['more'],true);
  240 + $res['audio'] = isset($more['audio']) && !empty($more['audio'])?$more['audio']:'';
  241 + }
  242 + $this->assign('res',$res);
  243 + }
159 } 244 }
@@ -15,12 +15,10 @@ use think\Validate; @@ -15,12 +15,10 @@ use think\Validate;
15 class AdminRegionNoteValidate extends Validate 15 class AdminRegionNoteValidate extends Validate
16 { 16 {
17 protected $rule = [ 17 protected $rule = [
18 - 'post_title' => 'require',  
19 'post_excerpt' => 'require', 18 'post_excerpt' => 'require',
20 ]; 19 ];
21 protected $message = [ 20 protected $message = [
22 - 'post_title.require' => '文章标题不能为空!',  
23 - 'post_excerpt.require' => '文章简介不能为空!', 21 + 'post_excerpt.require' => '简介不能为空!',
24 ]; 22 ];
25 23
26 protected $scene = [ 24 protected $scene = [
@@ -39,10 +39,10 @@ @@ -39,10 +39,10 @@
39 <input class="form-control" type="hidden" value="{$categories}" name="post[categories]" 39 <input class="form-control" type="hidden" value="{$categories}" name="post[categories]"
40 id="js-categories-id-input"/> 40 id="js-categories-id-input"/>
41 <tr> 41 <tr>
42 - <th width="100">标题<span class="form-required">*</span></th> 42 + <th width="100">姓名<span class="form-required">*</span></th>
43 <td> 43 <td>
44 - <input class="form-control" type="text" name="post[post_title]"  
45 - id="title" required value="" placeholder="请输入标题"/> 44 + <input class="form-control" type="text" name="post[full_name]"
  45 + id="title" required value="" placeholder="请输入姓名"/>
46 </td> 46 </td>
47 </tr> 47 </tr>
48 <tr> 48 <tr>
@@ -43,10 +43,10 @@ @@ -43,10 +43,10 @@
43 <input class="form-control" type="hidden" value="{$categories}" name="post[categories]" 43 <input class="form-control" type="hidden" value="{$categories}" name="post[categories]"
44 id="js-categories-id-input"/> 44 id="js-categories-id-input"/>
45 <tr> 45 <tr>
46 - <th width="100">标题<span class="form-required">*</span></th> 46 + <th width="100">姓名<span class="form-required">*</span></th>
47 <td> 47 <td>
48 - <input class="form-control" type="text" name="post[post_title]"  
49 - required value="{$post.post_title}" placeholder="请输入标题"/> 48 + <input class="form-control" type="text" name="post[full_name]"
  49 + required value="{$post.full_name}" placeholder="请输入姓名"/>
50 </td> 50 </td>
51 </tr> 51 </tr>
52 <tr> 52 <tr>
@@ -12,9 +12,9 @@ @@ -12,9 +12,9 @@
12 <!--<option value='0'>全部</option>--> 12 <!--<option value='0'>全部</option>-->
13 <!--{$category_tree|default=''}--> 13 <!--{$category_tree|default=''}-->
14 <!--</select> &nbsp;&nbsp;--> 14 <!--</select> &nbsp;&nbsp;-->
15 - 标题:  
16 - <input type="text" class="form-control" name="post_title"  
17 - value="{$post_title|default=''}" 15 + 姓名:
  16 + <input type="text" class="form-control" name="full_name"
  17 + value="{$full_name|default=''}"
18 style="width: 140px;">&nbsp;&nbsp; 18 style="width: 140px;">&nbsp;&nbsp;
19 时间: 19 时间:
20 <input type="text" class="form-control js-bootstrap-datetime" name="start_time" 20 <input type="text" class="form-control js-bootstrap-datetime" name="start_time"
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 <!--<th width="50">{:lang('SORT')}</th>--> 41 <!--<th width="50">{:lang('SORT')}</th>-->
42 <!--</notempty>--> 42 <!--</notempty>-->
43 <th width="50">ID</th> 43 <th width="50">ID</th>
44 - <th width="400">标题</th> 44 + <th width="200">姓名</th>
45 <th width="100">头像</th> 45 <th width="100">头像</th>
46 <th width="65">点击量</th> 46 <th width="65">点击量</th>
47 <th width="130">创建时间</th> 47 <th width="130">创建时间</th>
@@ -64,11 +64,7 @@ @@ -64,11 +64,7 @@
64 <!--</notempty>--> 64 <!--</notempty>-->
65 <td><b>{$vo.id}</b></td> 65 <td><b>{$vo.id}</b></td>
66 <td> 66 <td>
67 - <notempty name="category">  
68 - {$vo.post_title}  
69 - <else/>  
70 - {$vo.post_title}  
71 - </notempty> 67 + {$vo.full_name}
72 </td> 68 </td>
73 <td> 69 <td>
74 <notempty name="vo.more.thumbnail"> 70 <notempty name="vo.more.thumbnail">