动态数据列表优化,新增插件调用控制器方式
parent
e1fc7acd3b
commit
76878f3045
|
|
@ -74,12 +74,16 @@
|
|||
</option>
|
||||
{{/if}}
|
||||
{{if !empty($t['search_config']['data']) and is_array($t['search_config']['data'])}}
|
||||
{{foreach $t['search_config']['data'] as $v}}
|
||||
<option value="{{if isset($t['search_config']['data_key']) and isset($v[$t['search_config']['data_key']])}}{{$v[$t['search_config']['data_key']]}}{{/if}}" {{if !empty($form_params) and isset($form_params[$t['form_key']]) and is_array($form_params[$t['form_key']]) and isset($t['search_config']['data_key']) and in_array($v[$t['search_config']['data_key']], $form_params[$t['form_key']])}}selected{{/if}}>
|
||||
{{if isset($t['search_config']['data_name']) and isset($v[$t['search_config']['data_name']])}}
|
||||
{{$v[$t['search_config']['data_name']]}}
|
||||
{{/if}}
|
||||
</option>
|
||||
{{foreach $t['search_config']['data'] as $k=>$v}}
|
||||
{{if is_array($v)}}
|
||||
<option value="{{if isset($t['search_config']['data_key']) and isset($v[$t['search_config']['data_key']])}}{{$v[$t['search_config']['data_key']]}}{{/if}}" {{if !empty($form_params) and isset($form_params[$t['form_key']]) and is_array($form_params[$t['form_key']]) and isset($t['search_config']['data_key']) and in_array($v[$t['search_config']['data_key']], $form_params[$t['form_key']])}}selected{{/if}}>
|
||||
{{if isset($t['search_config']['data_name']) and isset($v[$t['search_config']['data_name']])}}
|
||||
{{$v[$t['search_config']['data_name']]}}
|
||||
{{/if}}
|
||||
</option>
|
||||
{{else /}}
|
||||
<option value="{{$k}}" {{if !empty($form_params) and isset($form_params[$t['form_key']]) and is_array($form_params[$t['form_key']]) and isset($t['search_config']['data_key']) and in_array($k, $form_params[$t['form_key']])}}selected{{/if}}>{{$v}}</option>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</select>
|
||||
|
|
@ -110,9 +114,19 @@
|
|||
<!-- 从模块加载自定义模块数据 -->
|
||||
{{if !empty($t['search_config']['template'])}}
|
||||
{{if isset($t['search_config']['data'])}}
|
||||
{{:ModuleInclude($t['search_config']['template'], ['data'=>$t['search_config']['data'], 'form_name_key'=>$t['form_key'], 'params'=>isset($form_params) ? $form_params : []])}}
|
||||
{{:ModuleInclude($t['search_config']['template'], [
|
||||
'form'=>$t,
|
||||
'data'=>$t['search_config']['data'],
|
||||
'form_name_key'=>$t['form_key'],
|
||||
'params'=>isset($form_params) ? $form_params : [],
|
||||
])}}
|
||||
{{else /}}
|
||||
{{:ModuleInclude($t['search_config']['template'], ['data'=>[], 'form_name_key'=>$t['form_key'], 'params'=>isset($form_params) ? $form_params : []])}}
|
||||
{{:ModuleInclude($t['search_config']['template'], [
|
||||
'form'=>$t,
|
||||
'data'=>[],
|
||||
'form_name_key'=>$t['form_key'],
|
||||
'params'=>isset($form_params) ? $form_params : [],
|
||||
])}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/case}}
|
||||
|
|
@ -208,7 +222,10 @@
|
|||
{{/case}}
|
||||
{{case module}}
|
||||
<!-- 从模块加载自定义模块数据 -->
|
||||
{{:ModuleInclude($t['view_key'], $data_list[$i], isset($params) ? $params : [])}}
|
||||
{{:ModuleInclude($t['view_key'], $data_list[$i], [
|
||||
'form' => $t,
|
||||
'params' => isset($form_params) ? $form_params : [],
|
||||
])}}
|
||||
{{/case}}
|
||||
{{case status}}
|
||||
<!-- 数据状态操作按钮组件 -->
|
||||
|
|
@ -226,7 +243,10 @@
|
|||
{{case operate}}
|
||||
<!-- 是否操作列 -->
|
||||
<!-- 模块数据 -->
|
||||
{{:ModuleInclude($t['view_key'], $data_list[$i])}}
|
||||
{{:ModuleInclude($t['view_key'], $data_list[$i], [
|
||||
'form' => $t,
|
||||
'params' => isset($form_params) ? $form_params : [],
|
||||
])}}
|
||||
|
||||
<!-- 列表操作钩子 -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
|
|
|
|||
|
|
@ -506,6 +506,25 @@ function PathToParams($key = null, $default = null, $path = '')
|
|||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用控制器调用
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @param [string] $plugins [应用标记]
|
||||
* @param [string] $control [应用控制器]
|
||||
* @param [string] $action [应用方法]
|
||||
* @param [string] $group [应用组(admin, index, api)]
|
||||
* @param [array] $params [输入参数]
|
||||
* @param [int] $is_ret_data [是否直接返回data数据]
|
||||
*/
|
||||
function PluginsControlCall($plugins, $control, $action, $group = 'index', $params = [], $is_ret_data = 0)
|
||||
{
|
||||
$ret = app\service\PluginsService::PluginsControlCall($plugins, $control, $action, $group, $params);
|
||||
return ($is_ret_data == 1) ? $ret['data'] : $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用插件服务层方法 - 获取插件配置信息
|
||||
* @author Devil
|
||||
|
|
|
|||
|
|
@ -74,12 +74,16 @@
|
|||
</option>
|
||||
{{/if}}
|
||||
{{if !empty($t['search_config']['data']) and is_array($t['search_config']['data'])}}
|
||||
{{foreach $t['search_config']['data'] as $v}}
|
||||
<option value="{{if isset($t['search_config']['data_key']) and isset($v[$t['search_config']['data_key']])}}{{$v[$t['search_config']['data_key']]}}{{/if}}" {{if !empty($form_params) and isset($form_params[$t['form_key']]) and is_array($form_params[$t['form_key']]) and isset($t['search_config']['data_key']) and in_array($v[$t['search_config']['data_key']], $form_params[$t['form_key']])}}selected{{/if}}>
|
||||
{{if isset($t['search_config']['data_name']) and isset($v[$t['search_config']['data_name']])}}
|
||||
{{$v[$t['search_config']['data_name']]}}
|
||||
{{/if}}
|
||||
</option>
|
||||
{{foreach $t['search_config']['data'] as $k=>$v}}
|
||||
{{if is_array($v)}}
|
||||
<option value="{{if isset($t['search_config']['data_key']) and isset($v[$t['search_config']['data_key']])}}{{$v[$t['search_config']['data_key']]}}{{/if}}" {{if !empty($form_params) and isset($form_params[$t['form_key']]) and is_array($form_params[$t['form_key']]) and isset($t['search_config']['data_key']) and in_array($v[$t['search_config']['data_key']], $form_params[$t['form_key']])}}selected{{/if}}>
|
||||
{{if isset($t['search_config']['data_name']) and isset($v[$t['search_config']['data_name']])}}
|
||||
{{$v[$t['search_config']['data_name']]}}
|
||||
{{/if}}
|
||||
</option>
|
||||
{{else /}}
|
||||
<option value="{{$k}}" {{if !empty($form_params) and isset($form_params[$t['form_key']]) and is_array($form_params[$t['form_key']]) and isset($t['search_config']['data_key']) and in_array($k, $form_params[$t['form_key']])}}selected{{/if}}>{{$v}}</option>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</select>
|
||||
|
|
@ -110,9 +114,19 @@
|
|||
<!-- 从模块加载自定义模块数据 -->
|
||||
{{if !empty($t['search_config']['template'])}}
|
||||
{{if isset($t['search_config']['data'])}}
|
||||
{{:ModuleInclude($t['search_config']['template'], ['data'=>$t['search_config']['data'], 'form_name_key'=>$t['form_key'], 'params'=>isset($form_params) ? $form_params : []])}}
|
||||
{{:ModuleInclude($t['search_config']['template'], [
|
||||
'form'=>$t,
|
||||
'data'=>$t['search_config']['data'],
|
||||
'form_name_key'=>$t['form_key'],
|
||||
'params'=>isset($form_params) ? $form_params : [],
|
||||
])}}
|
||||
{{else /}}
|
||||
{{:ModuleInclude($t['search_config']['template'], ['data'=>[], 'form_name_key'=>$t['form_key'], 'params'=>isset($form_params) ? $form_params : []])}}
|
||||
{{:ModuleInclude($t['search_config']['template'], [
|
||||
'form'=>$t,
|
||||
'data'=>[],
|
||||
'form_name_key'=>$t['form_key'],
|
||||
'params'=>isset($form_params) ? $form_params : [],
|
||||
])}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/case}}
|
||||
|
|
@ -208,7 +222,10 @@
|
|||
{{/case}}
|
||||
{{case module}}
|
||||
<!-- 从模块加载自定义模块数据 -->
|
||||
{{:ModuleInclude($t['view_key'], $data_list[$i], isset($params) ? $params : [])}}
|
||||
{{:ModuleInclude($t['view_key'], $data_list[$i], [
|
||||
'form' => $t,
|
||||
'params' => isset($form_params) ? $form_params : [],
|
||||
])}}
|
||||
{{/case}}
|
||||
{{case status}}
|
||||
<!-- 数据状态操作按钮组件 -->
|
||||
|
|
@ -226,7 +243,10 @@
|
|||
{{case operate}}
|
||||
<!-- 是否操作列 -->
|
||||
<!-- 模块数据 -->
|
||||
{{:ModuleInclude($t['view_key'], $data_list[$i])}}
|
||||
{{:ModuleInclude($t['view_key'], $data_list[$i], [
|
||||
'form' => $t,
|
||||
'params' => isset($form_params) ? $form_params : [],
|
||||
])}}
|
||||
|
||||
<!-- 列表操作钩子 -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
// +----------------------------------------------------------------------
|
||||
namespace app\module;
|
||||
|
||||
use think\Controller;
|
||||
use think\facade\Hook;
|
||||
use app\service\FormTableService;
|
||||
|
||||
|
|
|
|||
|
|
@ -255,13 +255,13 @@ class PluginsService
|
|||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-01-02
|
||||
* @param [string] $plugins [应用标记]
|
||||
* @param [string] $control [应用控制器]
|
||||
* @param [string] $action [应用方法]
|
||||
* @param [string] $group [应用组(admin, index, api)]
|
||||
* @param [array] $params [输入参数]
|
||||
* @param [string] $plugins [应用标记]
|
||||
* @param [string] $control [应用控制器]
|
||||
* @param [string] $action [应用方法]
|
||||
* @param [string] $group [应用组(admin, index, api)]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function PluginsControlCall($plugins, $control, $action, $group = 'index', $params = [])
|
||||
public static function PluginsControlCall($plugins, $control, $action, $group = 'index', $params = [], $is_return_data = 0)
|
||||
{
|
||||
// 应用校验
|
||||
$ret = self::PluginsCheck($plugins);
|
||||
|
|
@ -291,7 +291,7 @@ class PluginsService
|
|||
{
|
||||
$params = $params['data_request'];
|
||||
}
|
||||
return DataReturn('验证成功', 0, $obj->$action($params));
|
||||
return DataReturn('调用成功', 0, $obj->$action($params));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -32,6 +32,78 @@ return array (
|
|||
'log_write' =>
|
||||
array (
|
||||
),
|
||||
'plugins_service_users_center_left_menu_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
1 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
2 => 'app\\plugins\\signin\\Hook',
|
||||
),
|
||||
'plugins_service_header_navigation_top_right_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
1 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
2 => 'app\\plugins\\signin\\Hook',
|
||||
3 => 'app\\plugins\\exchangerate\\Hook',
|
||||
),
|
||||
'plugins_service_order_status_change_history_success_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
1 => 'app\\plugins\\points\\Hook',
|
||||
),
|
||||
'plugins_service_order_aftersale_audit_handle_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_site_extraction_address_list' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_buy_order_insert_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
1 => 'app\\plugins\\points\\Hook',
|
||||
),
|
||||
'plugins_service_goods_spec_extends_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
1 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_view_admin_user_save' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
1 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_service_user_save_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
1 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_service_goods_handle_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
1 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
2 => 'app\\plugins\\exchangerate\\Hook',
|
||||
3 => 'app\\plugins\\points\\Hook',
|
||||
),
|
||||
'plugins_service_goods_spec_base' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
1 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
2 => 'app\\plugins\\exchangerate\\Hook',
|
||||
),
|
||||
'plugins_view_goods_detail_panel_price_top' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
1 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_module_form_admin_user_index' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_module_form_admin_user_detail' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_css' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\share\\Hook',
|
||||
|
|
@ -63,17 +135,6 @@ return array (
|
|||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\points\\Hook',
|
||||
),
|
||||
'plugins_service_goods_handle_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\exchangerate\\Hook',
|
||||
2 => 'app\\plugins\\points\\Hook',
|
||||
),
|
||||
'plugins_service_goods_spec_base' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\exchangerate\\Hook',
|
||||
),
|
||||
'plugins_service_buy_group_goods_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
|
|
@ -83,26 +144,10 @@ return array (
|
|||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_service_goods_spec_extends_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_view_admin_user_save' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_service_user_save_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_service_goods_save_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_view_goods_detail_panel_price_top' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_view_home_goods_inside_bottom' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
|
|
@ -115,17 +160,6 @@ return array (
|
|||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
),
|
||||
'plugins_service_users_center_left_menu_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\signin\\Hook',
|
||||
),
|
||||
'plugins_service_header_navigation_top_right_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevelvip\\Hook',
|
||||
1 => 'app\\plugins\\signin\\Hook',
|
||||
2 => 'app\\plugins\\exchangerate\\Hook',
|
||||
),
|
||||
'plugins_service_quick_navigation_pc' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\signin\\Hook',
|
||||
|
|
@ -180,13 +214,5 @@ return array (
|
|||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
),
|
||||
'plugins_service_buy_order_insert_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
),
|
||||
'plugins_service_order_status_change_history_success_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\points\\Hook',
|
||||
),
|
||||
);
|
||||
?>
|
||||
Loading…
Reference in New Issue