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

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

... ... @@ -42,7 +42,7 @@ class AdminRegionNoteController extends AdminBaseController
$categoryTree = $portalCategoryModel->adminCategoryTree($categoryId);
$this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : '');
$this->assign('end_time', isset($param['end_time']) ? $param['end_time'] : '');
$this->assign('post_title', isset($param['post_title']) ? $param['post_title'] : '');
$this->assign('full_name', isset($param['full_name']) ? $param['full_name'] : '');
$this->assign('articles', $articles);
$this->assign('category_tree', $categoryTree);
$this->assign('category', $categoryId);
... ...
... ... @@ -63,11 +63,7 @@ class RegionController extends HomeBaseController
$res_djrz = $this->getChildArticle($position,$field,3);
foreach($res_djrz as &$value){
$more = json_decode($value['more'],true);
if(isset($more['photos']) && !empty($more['photos'])){
$value['thumbnail'] = $more['photos'][0]['url'];
}else{
$value['thumbnail'] = '';
}
$value['thumbnail'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
}
$this->assign('res_djrz',$res_djrz);
... ... @@ -159,6 +155,15 @@ class RegionController extends HomeBaseController
$this->assign('res',$res);
}
//明星访谈详情
public function getStarDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail avatar,full_name,position,trade,post_excerpt,create_time,post_content';
$starModel = new StarController();
$res = $starModel->getDetail($id,$field);
$this->assign('res',$res);
}
//星球故事更多
public function getMoreStory(){
$page = $this->request->param('page',1,'intval');
... ... @@ -189,4 +194,35 @@ class RegionController extends HomeBaseController
$res = $this->getChildArticlePage($position,$field,$page,6);
$this->assign('res',$res);
}
//独角快报详情
public function getNewsDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content';
$starModel = new StarController();
$res = $starModel->getDetail($id,$field);
$this->assign('res',$res);
}
//独角日志详情
public function getNoteDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail avatar,full_name,post_excerpt,create_time,post_content';
$starModel = new StarController();
$res = $starModel->getDetail($id,$field);
$this->assign('res',$res);
}
//童趣未来详情
public function getFutureDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
$starModel = new StarController();
$res = $starModel->getDetail($id,$field);
if($res){
$more = json_decode($res['more'],true);
$res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
}
$this->assign('res',$res);
}
}
... ...
... ... @@ -27,8 +27,10 @@ class StarController extends HomeBaseController
$field = 'id,thumbnail,post_excerpt,more';
$res_xqgs = $this->getChildArticle($position,$field,1);
foreach($res_xqgs as &$value){
$video = json_decode($value['more'],true);
$value['audio'] = $video['audio'];
$more = json_decode($value['more'],true);
if(isset($more['audio']) && !empty($more['audio'])){
$value['audio'] = $more['audio'];
}
}
$this->assign('res_xqgs',$res_xqgs);
... ... @@ -119,6 +121,19 @@ class StarController extends HomeBaseController
$this->assign('res',$res);
}
//网红美景详情
public function getSceneryDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
$res = $this->getDetail($id,$field);
if($res){
$more = json_decode($res['more'],true);
$res['audio'] = isset($more['audio']) && !empty($more['audio'])?$more['audio']:'';
$res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
}
$this->assign('res',$res);
}
//异域珍馐更多
public function getMoreFood(){
$page = $this->request->param('page',1,'intval');
... ... @@ -130,6 +145,18 @@ class StarController extends HomeBaseController
$this->assign('res',$res);
}
//异域珍馐详情
public function getFoodDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
$res = $this->getDetail($id,$field);
if($res){
$more = json_decode($res['more'],true);
$res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
}
$this->assign('res',$res);
}
//良宿美寝更多
public function getMoreHotel(){
$page = $this->request->param('page',1,'intval');
... ... @@ -139,6 +166,18 @@ class StarController extends HomeBaseController
$this->assign('res',$res);
}
//良宿美寝详情
public function getHotelDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
$res = $this->getDetail($id,$field);
if($res){
$more = json_decode($res['more'],true);
$res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
}
$this->assign('res',$res);
}
//活力生态更多
public function getMoreEcology(){
$page = $this->request->param('page',1,'intval');
... ... @@ -148,6 +187,18 @@ class StarController extends HomeBaseController
$this->assign('res',$res);
}
//活力生态详情
public function getEcologyDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
$res = $this->getDetail($id,$field);
if($res){
$more = json_decode($res['more'],true);
$res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
}
$this->assign('res',$res);
}
//便利出行更多
public function getMoreTravel(){
$page = $this->request->param('page',1,'intval');
... ... @@ -156,4 +207,38 @@ class StarController extends HomeBaseController
$res = $this->getChildArticlePage($position,$field,$page);
$this->assign('res',$res);
}
//便利出行详情
public function getTravelDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
$res = $this->getDetail($id,$field);
if($res){
$more = json_decode($res['more'],true);
$res['image_url'] = isset($more['photos']) && !empty($more['photos'])?$more['photos'][0]['url']:'';
}
$this->assign('res',$res);
}
//获取文章详情
public function getDetail($id,$field){
$pre = CityCategoryModel::pre;
$res = Db::table($pre.'portal_post')
->where(['id'=>$id,'delete_time'=>0])
->field($field)
->find();
return $res;
}
//星球故事详情
public function getStoryDetail(){
$id = $this->request->param('id',0,'intval');
$field = 'id,thumbnail,post_title,post_excerpt,create_time,post_content,more';
$res = $this->getDetail($id,$field);
if($res){
$more = json_decode($res['more'],true);
$res['audio'] = isset($more['audio']) && !empty($more['audio'])?$more['audio']:'';
}
$this->assign('res',$res);
}
}
... ...
... ... @@ -15,12 +15,10 @@ use think\Validate;
class AdminRegionNoteValidate extends Validate
{
protected $rule = [
'post_title' => 'require',
'post_excerpt' => 'require',
];
protected $message = [
'post_title.require' => '文章标题不能为空!',
'post_excerpt.require' => '文章简介不能为空!',
'post_excerpt.require' => '简介不能为空!',
];
protected $scene = [
... ...
... ... @@ -39,10 +39,10 @@
<input class="form-control" type="hidden" value="{$categories}" name="post[categories]"
id="js-categories-id-input"/>
<tr>
<th width="100">标题<span class="form-required">*</span></th>
<th width="100">姓名<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="post[post_title]"
id="title" required value="" placeholder="请输入标题"/>
<input class="form-control" type="text" name="post[full_name]"
id="title" required value="" placeholder="请输入姓名"/>
</td>
</tr>
<tr>
... ...
... ... @@ -43,10 +43,10 @@
<input class="form-control" type="hidden" value="{$categories}" name="post[categories]"
id="js-categories-id-input"/>
<tr>
<th width="100">标题<span class="form-required">*</span></th>
<th width="100">姓名<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="post[post_title]"
required value="{$post.post_title}" placeholder="请输入标题"/>
<input class="form-control" type="text" name="post[full_name]"
required value="{$post.full_name}" placeholder="请输入姓名"/>
</td>
</tr>
<tr>
... ...
... ... @@ -12,9 +12,9 @@
<!--<option value='0'>全部</option>-->
<!--{$category_tree|default=''}-->
<!--</select> &nbsp;&nbsp;-->
标题:
<input type="text" class="form-control" name="post_title"
value="{$post_title|default=''}"
姓名:
<input type="text" class="form-control" name="full_name"
value="{$full_name|default=''}"
style="width: 140px;">&nbsp;&nbsp;
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
... ... @@ -41,7 +41,7 @@
<!--<th width="50">{:lang('SORT')}</th>-->
<!--</notempty>-->
<th width="50">ID</th>
<th width="400">标题</th>
<th width="200">姓名</th>
<th width="100">头像</th>
<th width="65">点击量</th>
<th width="130">创建时间</th>
... ... @@ -64,11 +64,7 @@
<!--</notempty>-->
<td><b>{$vo.id}</b></td>
<td>
<notempty name="category">
{$vo.post_title}
<else/>
{$vo.post_title}
</notempty>
{$vo.full_name}
</td>
<td>
<notempty name="vo.more.thumbnail">
... ...