From 31a895fa1ae68879d4555d12e47c6247bd4d6d5d Mon Sep 17 00:00:00 2001 From: devil_gong Date: Fri, 14 Jun 2019 11:11:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/plugins/membershiplevel/Hook.php | 12 +++++------- .../plugins/membershiplevel/service/Service.php | 5 ++++- application/service/PluginsAdminService.php | 7 ++----- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/application/plugins/membershiplevel/Hook.php b/application/plugins/membershiplevel/Hook.php index 6e6fd51ea..28a3c0135 100755 --- a/application/plugins/membershiplevel/Hook.php +++ b/application/plugins/membershiplevel/Hook.php @@ -58,7 +58,10 @@ class Hook extends Controller // 商品数据处理后 case 'plugins_service_goods_handle_end' : - $this->GoodsHandleEnd($params['goods']); + if($module_name != 'admin') + { + $this->GoodsHandleEnd($params['goods']); + } break; // 商品规格基础数据 @@ -156,12 +159,7 @@ class Hook extends Controller // 无价格字段则不处理 if(isset($goods['price'])) { - if(empty($goods['original_price'])) - { - $goods['original_price'] = $goods['price']; - } - - // 价格处理 + $goods['original_price'] = $goods['price']; $goods['price'] = Service::PriceCalculate($goods['price'], $level['discount_rate'], 0); $price_title = empty($level['name']) ? '会员价' : $level['name']; $goods['show_field_price_text'] = ''.$price_title.''; diff --git a/application/plugins/membershiplevel/service/Service.php b/application/plugins/membershiplevel/service/Service.php index cbd4bb4b9..05fa5f84b 100755 --- a/application/plugins/membershiplevel/service/Service.php +++ b/application/plugins/membershiplevel/service/Service.php @@ -395,9 +395,12 @@ class Service $base = PluginsService::PluginsData('membershiplevel', Service::$base_config_attachment_field); if(!empty($base['data']['level_list'])) { + // 规则 + $level_rules = isset($base['data']['level_rules']) ? $base['data']['level_rules'] : 0; + // 匹配类型 $value = 0; - switch($base['data']['level_rules']) + switch($level_rules) { // 积分(可用积分) case 0 : diff --git a/application/service/PluginsAdminService.php b/application/service/PluginsAdminService.php index 330f6346d..b2e1be21b 100755 --- a/application/service/PluginsAdminService.php +++ b/application/service/PluginsAdminService.php @@ -1001,9 +1001,6 @@ php; } } - // 去除包名 - $file = substr($file, strpos($file, '/')+1); - // 排除临时文件和临时目录 if(strpos($file, '/.') === false && strpos($file, '__') === false) { @@ -1013,7 +1010,7 @@ php; { if(strpos($file, $dir_key) !== false) { - $file = str_replace($dir_key.'/', '', $dir_value.$file); + $file = str_replace($plugins_name.'/'.$dir_key.'/', '', $dir_value.$file); $is_has_find = true; break; } @@ -1027,7 +1024,7 @@ php; // 截取文件路径 $file_path = substr($file, 0, strrpos($file, '/')); - + // 路径不存在则创建 \base\FileUtil::CreateDir($file_path); -- GitLab