diff --git a/app/admin/controller/Pluginsadmin.php b/app/admin/controller/Pluginsadmin.php index b051da555..3eea783cc 100755 --- a/app/admin/controller/Pluginsadmin.php +++ b/app/admin/controller/Pluginsadmin.php @@ -27,6 +27,8 @@ use app\service\PluginsUpgradeService; */ class Pluginsadmin extends Base { + private $view_type; + /** * 构造方法 * @author Devil diff --git a/app/admin/form/Answer.php b/app/admin/form/Answer.php index 3c8a5b5f8..6bc8a41d4 100644 --- a/app/admin/form/Answer.php +++ b/app/admin/form/Answer.php @@ -43,6 +43,7 @@ class Answer 'status_field' => 'is_show', 'is_search' => 1, 'is_delete' => 1, + 'is_middle' => 0, 'delete_url' => MyUrl('admin/answer/delete'), 'delete_key' => 'ids', ], diff --git a/app/admin/form/Appcenternav.php b/app/admin/form/Appcenternav.php index a1d207b07..421c7b3a8 100644 --- a/app/admin/form/Appcenternav.php +++ b/app/admin/form/Appcenternav.php @@ -41,6 +41,7 @@ class AppCenterNav 'status_field' => 'is_enable', 'is_search' => 1, 'is_delete' => 1, + 'is_middle' => 0, 'delete_url' => MyUrl('admin/appcenternav/delete'), 'delete_key' => 'ids', ], diff --git a/app/admin/form/Apphomenav.php b/app/admin/form/Apphomenav.php index e0144a51c..7403cc761 100644 --- a/app/admin/form/Apphomenav.php +++ b/app/admin/form/Apphomenav.php @@ -41,6 +41,7 @@ class AppHomeNav 'status_field' => 'is_enable', 'is_search' => 1, 'is_delete' => 1, + 'is_middle' => 0, 'delete_url' => MyUrl('admin/apphomenav/delete'), 'delete_key' => 'ids', ], diff --git a/app/admin/form/Article.php b/app/admin/form/Article.php index fbd15c210..8f61a80f2 100644 --- a/app/admin/form/Article.php +++ b/app/admin/form/Article.php @@ -43,6 +43,7 @@ class Article 'status_field' => 'is_enable', 'is_search' => 1, 'is_delete' => 1, + 'is_middle' => 0, 'delete_url' => MyUrl('admin/article/delete'), 'delete_key' => 'ids', 'detail_title' => '基础信息', diff --git a/app/admin/form/Customview.php b/app/admin/form/Customview.php index 7ed23bab4..b5709116e 100644 --- a/app/admin/form/Customview.php +++ b/app/admin/form/Customview.php @@ -41,6 +41,7 @@ class CustomView 'status_field' => 'is_enable', 'is_search' => 1, 'is_delete' => 1, + 'is_middle' => 0, 'delete_url' => MyUrl('admin/customview/delete'), 'delete_key' => 'ids', 'detail_title' => '基础信息', diff --git a/app/admin/form/Goodscomments.php b/app/admin/form/Goodscomments.php index cd3ccd2a2..b2fb7e993 100644 --- a/app/admin/form/Goodscomments.php +++ b/app/admin/form/Goodscomments.php @@ -58,6 +58,20 @@ class GoodsComments 'align' => 'center', 'width' => 80, ], + [ + 'label' => '用户信息', + 'view_type' => 'module', + 'view_key' => 'lib/module/user', + 'grid_size' => 'sm', + 'is_sort' => 1, + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'user_id', + 'where_type_custom' => 'in', + 'where_value_custom' => 'WhereValueUserInfo', + 'placeholder' => '请输入用户名/昵称/手机/邮箱', + ], + ], [ 'label' => '基础信息', 'view_type' => 'module', @@ -73,20 +87,6 @@ class GoodsComments 'placeholder' => '请输入商品名称/型号', ], ], - [ - 'label' => '用户信息', - 'view_type' => 'module', - 'view_key' => 'lib/module/user', - 'grid_size' => 'sm', - 'is_sort' => 1, - 'search_config' => [ - 'form_type' => 'input', - 'form_name' => 'user_id', - 'where_type_custom' => 'in', - 'where_value_custom' => 'WhereValueUserInfo', - 'placeholder' => '请输入用户名/昵称/手机/邮箱', - ], - ], [ 'label' => '业务类型', 'view_type' => 'field', diff --git a/app/admin/form/Integrallog.php b/app/admin/form/Integrallog.php index 5ca444085..708339bf3 100644 --- a/app/admin/form/Integrallog.php +++ b/app/admin/form/Integrallog.php @@ -41,6 +41,7 @@ class IntegralLog 'base' => [ 'key_field' => 'id', 'is_search' => 1, + 'is_middle' => 0, ], // 表单配置 'form' => [ diff --git a/app/admin/form/Message.php b/app/admin/form/Message.php index f4e429ee0..58bffecc2 100644 --- a/app/admin/form/Message.php +++ b/app/admin/form/Message.php @@ -44,6 +44,7 @@ class Message 'key_field' => 'id', 'is_search' => 1, 'is_delete' => 1, + 'is_middle' => 0, 'delete_url' => MyUrl('admin/message/delete'), 'delete_key' => 'ids', ], diff --git a/app/admin/form/Refundlog.php b/app/admin/form/Refundlog.php index d39893687..6e6bfd4df 100644 --- a/app/admin/form/Refundlog.php +++ b/app/admin/form/Refundlog.php @@ -42,6 +42,7 @@ class RefundLog 'base' => [ 'key_field' => 'id', 'is_search' => 1, + 'is_middle' => 0, ], // 表单配置 'form' => [ diff --git a/app/admin/view/default/answer/save_info.html b/app/admin/view/default/answer/save_info.html index bfcbf4a32..8d8700846 100644 --- a/app/admin/view/default/answer/save_info.html +++ b/app/admin/view/default/answer/save_info.html @@ -14,10 +14,10 @@ {{if !empty($data['user'])}} {{$data.user.user_name_view}} {{else /}} 用户信息异常 diff --git a/app/admin/view/default/goodscomments/save_info.html b/app/admin/view/default/goodscomments/save_info.html index 4372800d2..28d5919bf 100644 --- a/app/admin/view/default/goodscomments/save_info.html +++ b/app/admin/view/default/goodscomments/save_info.html @@ -29,10 +29,10 @@ {{if !empty($data['user'])}} {{$data.user.user_name_view}} {{else /}} 用户信息异常 diff --git a/app/admin/view/default/lib/module/user.html b/app/admin/view/default/lib/module/user.html index 991e2f5fc..2d4ba58ba 100644 --- a/app/admin/view/default/lib/module/user.html +++ b/app/admin/view/default/lib/module/user.html @@ -1,14 +1,23 @@ - -{{if !empty($module_data)}} - {{if !empty($module_data['user'])}} - {{$module_data.user.user_name_view}} - - {{else /}} - 用户信息异常 - {{/if}} +{{if !empty($module_data) and !empty($module_data['user'])}} + {{$module_data.user.user_name_view}} + {{/if}} \ No newline at end of file diff --git a/app/admin/view/default/orderaftersale/module/goods.html b/app/admin/view/default/orderaftersale/module/goods.html index 7c66cfe64..613e033ba 100644 --- a/app/admin/view/default/orderaftersale/module/goods.html +++ b/app/admin/view/default/orderaftersale/module/goods.html @@ -60,12 +60,8 @@ {{if !empty($module_data.order_data.items.model)}} {{$module_data.order_data.items.model}} {{/if}} - {{if !empty($module_data.order_data.items.spec)}} - + {{if !empty($module_data['order_data']['items']['spec_text'])}} +
{{$module_data.order_data.items.spec_text}}
{{/if}} diff --git a/app/admin/view/default/user/module/referrer.html b/app/admin/view/default/user/module/referrer.html index 0701b1042..582818050 100644 --- a/app/admin/view/default/user/module/referrer.html +++ b/app/admin/view/default/user/module/referrer.html @@ -2,9 +2,20 @@ {{if !empty($module_data) and !empty($module_data['referrer_info'])}} {{$module_data.referrer_info.user_name_view}} {{/if}} \ No newline at end of file diff --git a/app/admin/view/default/useraddress/save_info.html b/app/admin/view/default/useraddress/save_info.html index 2d8f11eee..6d0920d39 100644 --- a/app/admin/view/default/useraddress/save_info.html +++ b/app/admin/view/default/useraddress/save_info.html @@ -13,10 +13,10 @@
{{$data.user.user_name_view}}
{{/if}} diff --git a/app/common.php b/app/common.php index 11722540f..2255b1513 100755 --- a/app/common.php +++ b/app/common.php @@ -640,7 +640,7 @@ function GetUrlHost($url) { // 地址解析 $arr = parse_url(strtolower($url)); - $host = (count($arr) == 1) ? $arr['path'] : (empty($arr['host']) ? '' : $arr['host']); + $host = (count($arr) == 1) ? (isset($arr['path']) ? $arr['path'] : '') : (empty($arr['host']) ? '' : $arr['host']); if(empty($host)) { return $url; @@ -662,7 +662,7 @@ function GetUrlHost($url) } // 判断是否是双后缀 - $preg = '/[\w].+\.(com|net|org|gov|ac|bj|sh|tj|cq|he|sn|sx|nm|ln|jl|hl|js|zj|ah|fj|jx|sd|ha|hb|hn|gd|gx|hi|sc|gz|yn|gs|qh|nx|xj|tw|hk|mo|xz|edu|ge|dev|co)\.(cn|nz)$/'; + $preg = '/[\w].+\.(com|net|org|gov|ac|bj|sh|tj|cq|he|sn|sx|nm|ln|jl|hl|js|zj|ah|fj|jx|sd|ha|hb|hn|gd|gx|hi|sc|gz|yn|gs|qh|nx|xj|tw|hk|mo|xz|edu|ge|dev|co)\.(cn|nz|mm)$/'; if(($n > 2) && preg_match($preg, $host)) { // 双后缀取后3位 @@ -2109,35 +2109,47 @@ function ScienceNumToString($num) } /** - * [GetClientIP 客户端ip地址] + * 客户端ip地址 * @author Devil * @blog http://gong.gg/ * @version 0.0.1 * @datetime 2017-02-09T12:53:13+0800 - * @param [boolean] $long [是否将ip转成整数] - * @return [string|int] [ip地址|ip地址整数] + * @param [boolean] $long [是否将ip转成整数] + * @return [string|int] [ip地址|ip地址整数] + * @param [boolean] $is_single[是否仅获取一个ip] */ -function GetClientIP($long = false) +function GetClientIP($long = false, $is_single = true) { - $onlineip = ''; + $ip = ''; if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) { - $onlineip = getenv('HTTP_CLIENT_IP'); + $ip = getenv('HTTP_CLIENT_IP'); } elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) { - $onlineip = getenv('HTTP_X_FORWARDED_FOR'); + $ip = getenv('HTTP_X_FORWARDED_FOR'); } elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) { - $onlineip = getenv('REMOTE_ADDR'); + $ip = getenv('REMOTE_ADDR'); } elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) { - $onlineip = $_SERVER['REMOTE_ADDR']; - } - if($long) - { - $onlineip = sprintf("%u", ip2long($onlineip)); + $ip = $_SERVER['REMOTE_ADDR']; } - return $onlineip; + // 整数或单ip + if($long || $is_single) + { + // 单ip + if($is_single && stripos($ip, ',') !== false) + { + $temp = explode(',', $ip); + $ip = $temp[0]; + } + // 转整数 + if($long) + { + $ip = sprintf("%u", ip2long($ip)); + } + } + return $ip; } /** @@ -2893,7 +2905,7 @@ function Authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) } /** - * [ParamsChecked 参数校验方法] + * 参数校验方法 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 diff --git a/app/index/view/default/buy/index.html b/app/index/view/default/buy/index.html index 9ccf37d05..4f9a6c16b 100755 --- a/app/index/view/default/buy/index.html +++ b/app/index/view/default/buy/index.html @@ -64,13 +64,13 @@ {{if !empty($user_address_list)}} - + {{/if}} {{if !empty($user_address_list)}}