diff --git a/app/common.php b/app/common.php index 6f93d0a44..a1eeeb477 100755 --- a/app/common.php +++ b/app/common.php @@ -1393,7 +1393,7 @@ function SyncJob($url, $port = 80, $time = 30) * @return [json] [json数据] */ function DataReturn($msg = '', $code = 0, $data = '') -{ +{ // 默认情况下,手动调用当前方法 $result = ['msg'=>$msg, 'code'=>$code, 'data'=>$data]; diff --git a/app/index/view/default/goods/index.html b/app/index/view/default/goods/index.html index cc2e0e9ee..81975fced 100755 --- a/app/index/view/default/goods/index.html +++ b/app/index/view/default/goods/index.html @@ -173,7 +173,7 @@ {{foreach $goods.plugins_view_icon_data as $v}} {{if !empty($v) or is_array($v) and !empty($v['name'])}} - {{$v.name}} + {{$v.name}} {{/if}} {{/foreach}} diff --git a/app/service/GoodsService.php b/app/service/GoodsService.php index 24403d936..1ba96de17 100755 --- a/app/service/GoodsService.php +++ b/app/service/GoodsService.php @@ -473,6 +473,15 @@ class GoodsService { if(!empty($data)) { + // 商品列表钩子-前面 + $hook_name = 'plugins_service_goods_list_handle_begin'; + MyEventTrigger($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'params' => &$params, + 'data' => &$data, + ]); + // 其它额外处理 $is_photo = (isset($params['is_photo']) && $params['is_photo'] == true) ? true : false; $is_spec = (isset($params['is_spec']) && $params['is_spec'] == true) ? true : false; @@ -654,11 +663,13 @@ class GoodsService // bg_color 默认(#fff) // br_color 默认(#3bb4f2) // color 默认($3bb4f2) + // url 默认空(手机端请自行调整url地址) // [ // 'name' => 'icon名称', // 'bg_color' => '#fff', // 'br_color' => '#3bb4f2', // 'color' => '#3bb4f2', + // 'url' => 'url地址' // ] $v['plugins_view_icon_data'] = []; @@ -677,6 +688,15 @@ class GoodsService return $ret; } } + + // 商品列表钩子-后面 + $hook_name = 'plugins_service_goods_list_handle_end'; + MyEventTrigger($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'params' => &$params, + 'data' => &$data, + ]); } return DataReturn('success', 0, $data); } diff --git a/app/service/UserService.php b/app/service/UserService.php index 3359093c6..41db35a8c 100755 --- a/app/service/UserService.php +++ b/app/service/UserService.php @@ -139,6 +139,16 @@ class UserService $data = Db::name('User')->where($where)->order($order_by)->field($field)->limit($m, $n)->select()->toArray(); if(!empty($data)) { + // 用户列表钩子-前面 + $hook_name = 'plugins_service_user_list_handle_begin'; + MyEventTrigger($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'params' => &$params, + 'data' => &$data, + ]); + + // 开始处理数据 $common_gender_list = lang('common_gender_list'); $common_user_status_list = lang('common_user_status_list'); foreach($data as &$v) @@ -182,6 +192,15 @@ class UserService $v['status_text'] = $common_user_status_list[$v['status']]['name']; } } + + // 用户列表钩子-后面 + $hook_name = 'plugins_service_user_list_handle_end'; + MyEventTrigger($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'params' => &$params, + 'data' => &$data, + ]); } return DataReturn('处理成功', 0, $data); } diff --git a/public/static/index/default/css/goods.css b/public/static/index/default/css/goods.css index 2cd920d36..aa1994752 100755 --- a/public/static/index/default/css/goods.css +++ b/public/static/index/default/css/goods.css @@ -579,11 +579,11 @@ flex: 1 1 0%;line-height: 16px;cursor: pointer;} /** * 插件公共icon数据 */ -.goods-plugins-view-icon-container span { +.goods-plugins-view-icon-container a { background: #fff; border: 1px solid #3bb4f2; color: #3bb4f2; } -.goods-plugins-view-icon-container span:not(:first-child) { +.goods-plugins-view-icon-container a:not(:first-child) { margin-left: 5px; } \ No newline at end of file