细节优化

feat/task1-c-wallet
devil_gong 2019-06-14 11:11:15 +08:00
parent eac6540792
commit 31a895fa1a
3 changed files with 11 additions and 13 deletions

View File

@ -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'] = '<span class="plugins-membershiplevel-goods-price-icon" title="'.$price_title.'">'.$price_title.'</span>';

View File

@ -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 :

View File

@ -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);