提交 7f8ca297 编写于 作者: D devil_gong

订单列表新增钩子,插件优化

上级 0df51814
......@@ -226,7 +226,7 @@ class Common extends Controller
$default_theme = strtolower(MyC('common_default_theme', 'default', true));
$this->assign('default_theme', $default_theme);
// 当前操作名称, 兼容插件模块名称
// 当前操作名称, 兼容插件模块名称
$module_name = strtolower(request()->module());
$controller_name = strtolower(request()->controller());
$action_name = strtolower(request()->action());
......
......@@ -218,19 +218,26 @@
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:MyUrl('index/order/delete')}}" data-id="{{$data.id}}" data-view="jump" data-value="{{:MyUrl('index/order/index')}}"> 删除</button>
{{/if}}
<!-- 钩子订单操作 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<!-- 订单详情操作钩子 -->
{{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>plugins_service_order_handle_operation_html</span>
<span>plugins_view_index_order_detail_operation</span>
</div>
{{/if}}
{{if !empty($data['plugins_service_order_handle_operation_html']) and is_array($data['plugins_service_order_handle_operation_html'])}}
{{foreach $data.plugins_service_order_handle_operation_html as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
{{php}}
$hook_name = 'plugins_view_index_order_detail_operation';
$hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'id'=>$data['id'], 'data'=>$data]);
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>
{{if in_array($data['status'], [3,4])}}
<div class="logistics">
......
......@@ -234,19 +234,26 @@
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-icon-trash-o am-btn-block submit-delete" data-url="{{:MyUrl('index/order/delete')}}" data-id="{{$order.id}}" data-view="reload"> 删除</button>
{{/if}}
<!-- 钩子订单操作 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<!-- 订单列表操作钩子 -->
{{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>plugins_service_order_handle_operation_html</span>
<span>plugins_view_index_order_list_operation</span>
</div>
{{/if}}
{{if !empty($order['plugins_service_order_handle_operation_html']) and is_array($order['plugins_service_order_handle_operation_html'])}}
{{foreach $order.plugins_service_order_handle_operation_html as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
{{/foreach}}
{{/if}}
{{php}}
$hook_name = 'plugins_view_index_order_list_operation';
$hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'id'=>$order['id'], 'data'=>$order]);
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}}
</td>
{{/if}}
</tr>
......
......@@ -15,7 +15,7 @@
return [
// 开发模式
'is_develop' => false,
'is_develop' => true,
// 默认编码
'default_charset' => 'utf-8',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册