公共详情模块
parent
82222632ec
commit
b081167d19
|
|
@ -122,7 +122,7 @@ class Common extends Controller
|
|||
// 公共底部钩子
|
||||
$this->assign('plugins_admin_view_common_bottom_data', Hook::listen('plugins_admin_view_common_bottom', ['hook_name'=>'plugins_admin_view_common_bottom', 'is_backend'=>true, 'admin'=>$this->admin]));
|
||||
|
||||
// 公共钩子名称动态处理
|
||||
// 公共表格钩子名称动态处理
|
||||
$current = 'plugins_view_admin_'.$this->controller_name;
|
||||
// 内容外部顶部
|
||||
$this->assign('hook_name_content_top', $current.'_content_top');
|
||||
|
|
@ -138,6 +138,16 @@ class Common extends Controller
|
|||
$this->assign('hook_name_form_bottom_operate', $current.'_bottom_operate');
|
||||
// 表格列表后面操作栏
|
||||
$this->assign('hook_name_form_list_operate', $current.'_list_operate');
|
||||
|
||||
// 公共详情页面钩子名称动态处理
|
||||
// 内容外部顶部
|
||||
$this->assign('hook_name_detail_top', $current.'_detail_top');
|
||||
// 内容外部底部
|
||||
$this->assign('hook_name_detail_bottom', $current.'_detail_bottom');
|
||||
// 内容内部顶部
|
||||
$this->assign('hook_name_detail_inside_top', $current.'_detail_inside_top');
|
||||
// 内容内部底部
|
||||
$this->assign('hook_name_detail_inside_bottom', $current.'_detail_inside_bottom');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -89,28 +89,28 @@ class Goods extends Common
|
|||
*/
|
||||
public function Detail()
|
||||
{
|
||||
// 参数
|
||||
$params = input();
|
||||
if(!empty($this->data_request['id']))
|
||||
{
|
||||
// 条件
|
||||
$where = [
|
||||
['is_delete_time', '=', 0],
|
||||
['id', '=', intval($this->data_request['id'])],
|
||||
];
|
||||
|
||||
// 条件
|
||||
$where = GoodsService::GetAdminIndexWhere($params);
|
||||
// 获取列表
|
||||
$data_params = array(
|
||||
'm' => 0,
|
||||
'n' => 1,
|
||||
'where' => $where,
|
||||
'is_category' => 1,
|
||||
);
|
||||
$ret = GoodsService::GoodsList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
|
||||
// 获取列表
|
||||
$data_params = array(
|
||||
'm' => 0,
|
||||
'n' => 1,
|
||||
'where' => $where,
|
||||
'is_category' => 1,
|
||||
);
|
||||
$ret = GoodsService::GoodsList($data_params);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0];
|
||||
$this->assign('data', $data);
|
||||
|
||||
// 是否上下架
|
||||
$this->assign('common_is_shelves_list', lang('common_is_shelves_list'));
|
||||
|
||||
// 参数
|
||||
$this->assign('params', $params);
|
||||
// 是否上下架
|
||||
$this->assign('common_is_shelves_list', lang('common_is_shelves_list'));
|
||||
}
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{{include file="public/header" /}}
|
||||
<!-- 继承公共的 detail -->
|
||||
{{extend name="public/module/detail" /}}
|
||||
|
||||
<!-- content start -->
|
||||
<div class="am-padding-sm">
|
||||
{{if !empty($data)}}
|
||||
<!-- 详情内容 -->
|
||||
{{if !empty($data)}}
|
||||
{{block name="detail_data"}}
|
||||
<dl class="dl-content">
|
||||
<dt>标题名称</dt>
|
||||
<dd>
|
||||
|
|
@ -89,12 +90,5 @@
|
|||
<dt>更新时间</dt>
|
||||
<dd>{{$data.upd_time}}</dd>
|
||||
</dl>
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
{{/block}}
|
||||
{{/if}}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<!-- 继承公共的 form -->
|
||||
{{extend name="public/form" /}}
|
||||
{{extend name="public/module/form" /}}
|
||||
|
||||
<!-- 表单顶部操作栏 -->
|
||||
{{block name="form_operate_top"}}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{{include file="public/header" /}}
|
||||
<!-- 继承公共的 detail -->
|
||||
{{extend name="public/module/detail" /}}
|
||||
|
||||
<!-- content start -->
|
||||
<div class="am-padding-sm">
|
||||
{{if !empty($data)}}
|
||||
<!-- 详情内容 -->
|
||||
{{if !empty($data)}}
|
||||
{{block name="detail_data"}}
|
||||
<dl class="dl-content">
|
||||
<dt>订单号</dt>
|
||||
<dd>
|
||||
|
|
@ -237,12 +238,5 @@
|
|||
<dt>更新时间</dt>
|
||||
<dd>{{$data.upd_time}}</dd>
|
||||
</dl>
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
{{/block}}
|
||||
{{/if}}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
{{include file="public/header" /}}
|
||||
|
||||
<!-- content top hook -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>{{$hook_name_detail_top}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{php}}
|
||||
$hook_data = Hook::listen($hook_name_detail_top, ['hook_name'=>$hook_name_detail_top, 'is_backend'=>true]);
|
||||
if(!empty($hook_data) && is_array($hook_data))
|
||||
{
|
||||
foreach($hook_data as $hook)
|
||||
{
|
||||
if(is_string($hook) || is_int($hook))
|
||||
{
|
||||
echo htmlspecialchars_decode($hook);
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/php}}
|
||||
|
||||
<!-- content start -->
|
||||
<div class="am-padding-sm">
|
||||
<!-- content inside top hook -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>{{$hook_name_detail_inside_top}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{php}}
|
||||
$hook_data = Hook::listen($hook_name_detail_inside_top, ['hook_name'=>$hook_name_detail_inside_top, 'is_backend'=>true]);
|
||||
if(!empty($hook_data) && is_array($hook_data))
|
||||
{
|
||||
foreach($hook_data as $hook)
|
||||
{
|
||||
if(is_string($hook) || is_int($hook))
|
||||
{
|
||||
echo htmlspecialchars_decode($hook);
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/php}}
|
||||
|
||||
{{if !empty($data)}}
|
||||
{{block name="detail_data"}}{{/block}}
|
||||
{{else /}}
|
||||
{{block name="detail_not_data"}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/block}}
|
||||
{{/if}}
|
||||
|
||||
<!-- content inside top hook -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>{{$hook_name_detail_inside_bottom}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{php}}
|
||||
$hook_data = Hook::listen($hook_name_detail_inside_bottom, ['hook_name'=>$hook_name_detail_inside_bottom, 'is_backend'=>true]);
|
||||
if(!empty($hook_data) && is_array($hook_data))
|
||||
{
|
||||
foreach($hook_data as $hook)
|
||||
{
|
||||
if(is_string($hook) || is_int($hook))
|
||||
{
|
||||
echo htmlspecialchars_decode($hook);
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/php}}
|
||||
</div>
|
||||
<!-- content end -->
|
||||
|
||||
<!-- content bottom hook -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
<div class="plugins-tag">
|
||||
<span>{{$hook_name_detail_bottom}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{php}}
|
||||
$hook_data = Hook::listen($hook_name_detail_bottom, ['hook_name'=>$hook_name_detail_bottom, 'is_backend'=>true]);
|
||||
if(!empty($hook_data) && is_array($hook_data))
|
||||
{
|
||||
foreach($hook_data as $hook)
|
||||
{
|
||||
if(is_string($hook) || is_int($hook))
|
||||
{
|
||||
echo htmlspecialchars_decode($hook);
|
||||
}
|
||||
}
|
||||
}
|
||||
{{/php}}
|
||||
|
||||
<!-- footer start -->
|
||||
{{include file="public/footer" /}}
|
||||
<!-- footer end -->
|
||||
|
|
@ -166,6 +166,33 @@ class Common extends Controller
|
|||
|
||||
// 底部导航上面钩子
|
||||
$this->assign('plugins_view_common_footer_top_data', Hook::listen('plugins_view_common_footer_top', ['hook_name'=>'plugins_view_common_footer_top', 'is_backend'=>false, 'user'=>$this->user]));
|
||||
|
||||
// 公共表格钩子名称动态处理
|
||||
$current = 'plugins_view_index_'.$this->controller_name;
|
||||
// 内容外部顶部
|
||||
$this->assign('hook_name_content_top', $current.'_content_top');
|
||||
// 内容外部底部
|
||||
$this->assign('hook_name_content_bottom', $current.'_content_bottom');
|
||||
// 内容内部顶部
|
||||
$this->assign('hook_name_content_inside_top', $current.'_content_inside_top');
|
||||
// 内容内部底部
|
||||
$this->assign('hook_name_content_inside_bottom', $current.'_content_inside_bottom');
|
||||
// 表格列表顶部操作
|
||||
$this->assign('hook_name_form_top_operate', $current.'_top_operate');
|
||||
// 表格列表底部操作
|
||||
$this->assign('hook_name_form_bottom_operate', $current.'_bottom_operate');
|
||||
// 表格列表后面操作栏
|
||||
$this->assign('hook_name_form_list_operate', $current.'_list_operate');
|
||||
|
||||
// 公共详情页面钩子名称动态处理
|
||||
// 内容外部顶部
|
||||
$this->assign('hook_name_detail_top', $current.'_detail_top');
|
||||
// 内容外部底部
|
||||
$this->assign('hook_name_detail_bottom', $current.'_detail_bottom');
|
||||
// 内容内部顶部
|
||||
$this->assign('hook_name_detail_inside_top', $current.'_detail_inside_top');
|
||||
// 内容内部底部
|
||||
$this->assign('hook_name_detail_inside_bottom', $current.'_detail_inside_bottom');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue