From d914952e15d34098034988cd8e826dea8b0268d5 Mon Sep 17 00:00:00 2001 From: Devil Date: Thu, 5 Aug 2021 16:18:59 +0800 Subject: [PATCH 01/57] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Request.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Request.php b/app/Request.php index 8a9dd237e..1544ddfe8 100644 --- a/app/Request.php +++ b/app/Request.php @@ -13,5 +13,6 @@ namespace app; // 应用请求对象类 class Request extends \think\Request { - + // 全局参数过滤 + protected $filter = ['htmlspecialchars']; } -- Gitee From 2b9aff0aae9d3c8ad4d1b2cbf90174c849fd98c7 Mon Sep 17 00:00:00 2001 From: Devil Date: Thu, 5 Aug 2021 16:20:40 +0800 Subject: [PATCH 02/57] =?UTF-8?q?=E7=95=99=E8=A8=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/default/answer/save_info.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/admin/view/default/answer/save_info.html b/app/admin/view/default/answer/save_info.html index 9a6892de8..84abf3ab2 100644 --- a/app/admin/view/default/answer/save_info.html +++ b/app/admin/view/default/answer/save_info.html @@ -26,7 +26,7 @@
- +
@@ -34,7 +34,7 @@
- +
@@ -42,11 +42,11 @@
- +
- +
-- Gitee From 77383a4c6c7840c02de125de130ac70c93f2923f Mon Sep 17 00:00:00 2001 From: Devil Date: Thu, 5 Aug 2021 18:24:36 +0800 Subject: [PATCH 03/57] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=88=B7=E6=96=B0=E7=88=B6=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/common/js/common.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index 3d53cb103..b1d4afee7 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -509,7 +509,13 @@ function FromInit(form_name) Prompt(result.msg, 'success'); setTimeout(function() { - window.location.reload(); + // 等于parent则刷新父窗口 + if(request_value == 'parent') + { + parent.location.reload(); + } else { + window.location.reload(); + } }, 1500); break; -- Gitee From 4c824e0543639a7fcdcfcb822780671dab1d9fc2 Mon Sep 17 00:00:00 2001 From: Devil Date: Fri, 6 Aug 2021 13:18:55 +0800 Subject: [PATCH 04/57] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/admin/default/js/packageinstall.js | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/public/static/admin/default/js/packageinstall.js b/public/static/admin/default/js/packageinstall.js index 0d2843bb1..7e2b26b7a 100644 --- a/public/static/admin/default/js/packageinstall.js +++ b/public/static/admin/default/js/packageinstall.js @@ -84,7 +84,26 @@ function RequestHandle(key, opt, msg) { $progress.addClass('am-hide'); $error.removeClass('am-hide'); - $error.find('.msg-text').text(HtmlToString(xhr.responseText) || '异常错误'); + var data = null; + if((xhr.responseJSON || null) != null && (xhr.responseJSON.msg || null) != null) + { + data = xhr.responseJSON; + } else { + if(xhr.responseText.substr(0, 1) == '{') + { + var json = JSON.parse(xhr.responseText); + if((json.msg || null) != null) + { + data = json; + } else { + data = xhr.responseText; + } + } else { + data = xhr.responseText; + } + } + var msg = (typeof(data) == 'object') ? data.msg : data; + $error.find('.msg-text').text(msg || '异常错误'); } }); } -- Gitee From ca4f2dddab031454c9dabc1b693937315b5297bc Mon Sep 17 00:00:00 2001 From: Devil Date: Fri, 6 Aug 2021 13:19:51 +0800 Subject: [PATCH 05/57] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9D=A1=E4=BB=B6=E5=A4=84=E7=90=86=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/module/FormHandleModule.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/app/module/FormHandleModule.php b/app/module/FormHandleModule.php index 92e128d20..04d0c1812 100644 --- a/app/module/FormHandleModule.php +++ b/app/module/FormHandleModule.php @@ -481,6 +481,8 @@ class FormHandleModule $where_symbol = $this->WhereSymbolHandle($form_key, $where_custom, $where_type); // 是否自定义条件处理方法 $value_custom = isset($v['search_config']['where_value_custom']) ? $v['search_config']['where_value_custom'] : ''; + // 是否自定义条件处理类对象(默认表格定义文件的对象) + $object_custom = isset($v['search_config']['where_object_custom']) ? $v['search_config']['where_object_custom'] : null; // 根据条件类型处理 switch($where_type) @@ -499,7 +501,7 @@ class FormHandleModule $this->where_params[$form_key] = $value; // 条件值处理 - $value = $this->WhereValueHandle($value, $value_custom); + $value = $this->WhereValueHandle($value, $value_custom, $object_custom); if($value !== null && $value !== '') { // 是否 like 条件 @@ -527,7 +529,7 @@ class FormHandleModule $this->where_params[$form_key] = $value; // 条件 - $value = $this->WhereValueHandle($value, $value_custom); + $value = $this->WhereValueHandle($value, $value_custom, $object_custom); // in条件必须存在值也必须是数组 if($where_symbol == 'in') { @@ -555,7 +557,7 @@ class FormHandleModule $this->where_params[$key_min] = $value; // 条件 - $value = $this->WhereValueHandle($value, $value_custom, ['is_min'=>1]); + $value = $this->WhereValueHandle($value, $value_custom, $object_custom, ['is_min'=>1]); if($value !== null && $value !== '') { $this->where[] = [$where_name, '>=', $value]; @@ -568,7 +570,7 @@ class FormHandleModule $this->where_params[$key_max] = $value; // 条件 - $value = $this->WhereValueHandle($value, $value_custom, ['is_end'=>1]); + $value = $this->WhereValueHandle($value, $value_custom, $object_custom, ['is_end'=>1]); if($value !== null && $value !== '') { $this->where[] = [$where_name, '<=', $value]; @@ -588,7 +590,7 @@ class FormHandleModule $this->where_params[$key_start] = $value; // 条件 - $value = $this->WhereValueHandle(strtotime($value), $value_custom, ['is_start'=>1]); + $value = $this->WhereValueHandle(strtotime($value), $value_custom, $object_custom, ['is_start'=>1]); if($value !== null && $value !== '') { $this->where[] = [$where_name, '>=', $value]; @@ -601,7 +603,7 @@ class FormHandleModule $this->where_params[$key_end] = $value; // 条件 - $value = $this->WhereValueHandle(strtotime($value), $value_custom, ['is_end'=>1]); + $value = $this->WhereValueHandle(strtotime($value), $value_custom, $object_custom, ['is_end'=>1]); if($value !== null && $value !== '') { $this->where[] = [$where_name, '<=', $value]; @@ -735,16 +737,18 @@ class FormHandleModule * @version 1.0.0 * @date 2020-06-04 * @desc description - * @param [mixed] $value [条件值] - * @param [string] $action [自定义处理方法名称] - * @param [array] $params [输入参数] + * @param [mixed] $value [条件值] + * @param [string] $action_custom [自定义处理方法名称] + * @param [object] $object_custom [自定义处理类对象] + * @param [array] $params [输入参数] */ - public function WhereValueHandle($value, $action = '', $params = []) + public function WhereValueHandle($value, $action_custom = '', $object_custom = null, $params = []) { // 模块是否自定义条件值方法处理条件 - if(!empty($action) && method_exists($this->module_obj, $action)) + $obj = is_object($object_custom) ? $object_custom : $this->module_obj; + if(!empty($action_custom) && method_exists($obj, $action_custom)) { - return $this->module_obj->$action($value, $params); + return $obj->$action_custom($value, $params); } // 默认直接返回值 -- Gitee From d430ec929b85fb7c652651ec95d40b3cca773d35 Mon Sep 17 00:00:00 2001 From: Devil Date: Fri, 6 Aug 2021 15:33:35 +0800 Subject: [PATCH 06/57] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Plugins.php | 2 +- app/index/controller/Plugins.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/controller/Plugins.php b/app/admin/controller/Plugins.php index 78354cb7f..24c8eb2d0 100755 --- a/app/admin/controller/Plugins.php +++ b/app/admin/controller/Plugins.php @@ -101,7 +101,7 @@ class Plugins extends Common // ajax 返回的都是数组、使用统一api返回处理 if(IS_AJAX) { - return ApiService::ApiDataReturn($ret['data']); + return ApiService::ApiDataReturn(($ret['code'] == 0) ? $ret['data'] : $ret); } if($ret['code'] == 0) diff --git a/app/index/controller/Plugins.php b/app/index/controller/Plugins.php index 73af1079c..e8773af77 100755 --- a/app/index/controller/Plugins.php +++ b/app/index/controller/Plugins.php @@ -89,7 +89,7 @@ class Plugins extends Common // ajax 返回的都是数组、使用统一api返回处理 if(IS_AJAX) { - return ApiService::ApiDataReturn($ret['data']); + return ApiService::ApiDataReturn(($ret['code'] == 0) ? $ret['data'] : $ret); } if($ret['code'] == 0) -- Gitee From 9ce29bfe03a9feac84e80d646830d9ecc9dac20d Mon Sep 17 00:00:00 2001 From: Devil Date: Sat, 7 Aug 2021 00:41:33 +0800 Subject: [PATCH 07/57] =?UTF-8?q?=E9=92=A9=E5=AD=90+=E5=95=86=E5=93=81icon?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 2 +- app/index/view/default/goods/index.html | 2 +- app/service/GoodsService.php | 20 ++++++++++++++++++++ app/service/UserService.php | 19 +++++++++++++++++++ public/static/index/default/css/goods.css | 4 ++-- 5 files changed, 43 insertions(+), 4 deletions(-) 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 -- Gitee From c110cc145a581ebcac3047c06f11bb5641b3eb41 Mon Sep 17 00:00:00 2001 From: Devil Date: Sat, 7 Aug 2021 00:41:45 +0800 Subject: [PATCH 08/57] debug --- public/static/common/lib/ueditor/dialogs/map/map.html | 2 +- public/static/common/lib/ueditor/dialogs/map/show.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/static/common/lib/ueditor/dialogs/map/map.html b/public/static/common/lib/ueditor/dialogs/map/map.html index 58f416bac..8a6259b1c 100755 --- a/public/static/common/lib/ueditor/dialogs/map/map.html +++ b/public/static/common/lib/ueditor/dialogs/map/map.html @@ -4,7 +4,7 @@ - + - + -- Gitee From b26eb788bd2ba300445bb05b8f4468a5610677f5 Mon Sep 17 00:00:00 2001 From: Devil Date: Sat, 7 Aug 2021 01:40:40 +0800 Subject: [PATCH 09/57] update --- app/Request.php | 1 + app/provider.php | 1 + app/service.php | 1 + 3 files changed, 3 insertions(+) diff --git a/app/Request.php b/app/Request.php index 1544ddfe8..074ed0423 100644 --- a/app/Request.php +++ b/app/Request.php @@ -16,3 +16,4 @@ class Request extends \think\Request // 全局参数过滤 protected $filter = ['htmlspecialchars']; } +?> \ No newline at end of file diff --git a/app/provider.php b/app/provider.php index 8ca8a5396..7643897db 100644 --- a/app/provider.php +++ b/app/provider.php @@ -16,3 +16,4 @@ return [ 'think\Request' => Request::class, 'think\exception\Handle' => ExceptionHandle::class, ]; +?> \ No newline at end of file diff --git a/app/service.php b/app/service.php index eb56e202c..eaad32abc 100644 --- a/app/service.php +++ b/app/service.php @@ -15,3 +15,4 @@ use app\AppService; return [ AppService::class, ]; +?> \ No newline at end of file -- Gitee From 40ddae0d41b7a6eecfaf13f4b1bad7eda350fdf9 Mon Sep 17 00:00:00 2001 From: Devil Date: Sat, 7 Aug 2021 20:07:01 +0800 Subject: [PATCH 10/57] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=A4=84=E7=90=86=E9=81=BF=E5=85=8DXSS?= =?UTF-8?q?=E6=B3=A8=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Order.php | 10 +++++- .../view/default/order/payment_popup.html | 4 +-- app/service/OrderService.php | 34 +++++++++++++++++++ 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/app/index/controller/Order.php b/app/index/controller/Order.php index cfce5b7d1..0b748891f 100755 --- a/app/index/controller/Order.php +++ b/app/index/controller/Order.php @@ -76,6 +76,9 @@ class Order extends Common ]; $ret = OrderService::OrderList($data_params); + // 支付参数 + $pay_params = OrderService::PayParamsHandle($this->data_request); + // 发起支付 - 支付方式 MyViewAssign('buy_payment_list', PaymentService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1])); @@ -86,9 +89,10 @@ class Order extends Common MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('我的订单', 1)); // 基础参数赋值 - MyViewAssign('params', $this->data_request); MyViewAssign('page_html', $page->GetPageHtml()); MyViewAssign('data_list', $ret['data']); + MyViewAssign('pay_params', $pay_params); + MyViewAssign('params', $this->data_request); return MyView(); } @@ -112,6 +116,9 @@ class Order extends Common $site_fictitious = ConfigService::SiteFictitiousConfig(); MyViewAssign('site_fictitious', $site_fictitious['data']); + // 支付参数 + $pay_params = OrderService::PayParamsHandle($this->data_request); + // 加载百度地图api MyViewAssign('is_load_baidu_map_api', 1); @@ -120,6 +127,7 @@ class Order extends Common // 数据赋值 MyViewAssign('data', $data); + MyViewAssign('pay_params', $pay_params); MyViewAssign('params', $this->data_request); return MyView(); } diff --git a/app/index/view/default/order/payment_popup.html b/app/index/view/default/order/payment_popup.html index 9cf4925b7..d77f4a070 100644 --- a/app/index/view/default/order/payment_popup.html +++ b/app/index/view/default/order/payment_popup.html @@ -27,8 +27,8 @@ {{/if}}
- - + +
diff --git a/app/service/OrderService.php b/app/service/OrderService.php index 1d795cf07..b131446d6 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -2209,5 +2209,39 @@ class OrderService return DataReturn('支付中', -300); } + /** + * 订单支付参数处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-07 + * @desc description + * @param [array] $params [输入参数] + */ + public static function PayParamsHandle($params = []) + { + // 支付方式 + $payment_id = empty($params['payment_id']) ? '' : intval($params['payment_id']); + + // 支付订单id、多个订单id以英文逗号分割[ , ] + // 严格处理参数,避免非法数据 + $order_ids = ''; + if(!empty($params['ids'])) + { + $ids = array_filter(array_map(function($v) + { + return intval($v); + }, explode(',', urldecode($params['ids'])))); + if(!empty($ids)) + { + $order_ids = implode(',', $ids); + } + } + + return [ + 'payment_id' => $payment_id, + 'order_ids' => $order_ids, + ]; + } } ?> \ No newline at end of file -- Gitee From fcef7f07123f2e1fb7a70cedc4a8c4707be244f8 Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 8 Aug 2021 22:02:11 +0800 Subject: [PATCH 11/57] =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=AD=90=E6=94=AF=E6=8C=81=E9=92=A9?= =?UTF-8?q?=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Common.php | 2 ++ .../default/public/module/form_table.html | 27 +++++++++++++++++++ app/index/controller/Common.php | 2 ++ .../default/public/module/form_table.html | 27 +++++++++++++++++++ app/module/FormHandleModule.php | 16 +++++++++++ 5 files changed, 74 insertions(+) diff --git a/app/admin/controller/Common.php b/app/admin/controller/Common.php index eaf8e5922..a04691588 100755 --- a/app/admin/controller/Common.php +++ b/app/admin/controller/Common.php @@ -394,6 +394,8 @@ class Common extends BaseController } } + // 表格列表公共标识 + MyViewAssign('hook_name_form_list', $current.'_list'); // 内容外部顶部 MyViewAssign('hook_name_content_top', $current.'_content_top'); // 内容外部底部 diff --git a/app/admin/view/default/public/module/form_table.html b/app/admin/view/default/public/module/form_table.html index b6ffedfd4..180be5eee 100644 --- a/app/admin/view/default/public/module/form_table.html +++ b/app/admin/view/default/public/module/form_table.html @@ -298,6 +298,33 @@ {{/if}} {{/case}} {{/switch}} + + + {{if !empty($t['unique_key']) and $t['view_type'] neq 'operate'}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
+ {{$hook_name_form_list}}_grid_{{$t.unique_key}} +
+ {{/if}} + {{php}} + $hook_data = MyEventTrigger($hook_name_form_list.'_grid_'.$t['unique_key'], [ + 'hook_name' => $hook_name_form_list.'_grid_'.$t['unique_key'], + 'is_backend' => true, + 'id' => isset($data_list[$i][$form_table['base']['key_field']]) ? $data_list[$i][$form_table['base']['key_field']] : 0, + 'data' => $data_list[$i], + ]); + if(!empty($hook_data) && is_array($hook_data)) + { + foreach($hook_data as $hook) + { + if(is_string($hook) || is_int($hook)) + { + echo htmlspecialchars_decode($hook); + } + } + } + {{/php}} + {{/if}} {{/if}} {{/if}} diff --git a/app/index/controller/Common.php b/app/index/controller/Common.php index 54d1bf7c6..21344f1f9 100755 --- a/app/index/controller/Common.php +++ b/app/index/controller/Common.php @@ -554,6 +554,8 @@ class Common extends BaseController } } + // 表格列表公共标识 + MyViewAssign('hook_name_form_list', $current.'_list'); // 内容外部顶部 MyViewAssign('hook_name_content_top', $current.'_content_top'); // 内容外部底部 diff --git a/app/index/view/default/public/module/form_table.html b/app/index/view/default/public/module/form_table.html index b6ffedfd4..180be5eee 100644 --- a/app/index/view/default/public/module/form_table.html +++ b/app/index/view/default/public/module/form_table.html @@ -298,6 +298,33 @@ {{/if}} {{/case}} {{/switch}} + + + {{if !empty($t['unique_key']) and $t['view_type'] neq 'operate'}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
+ {{$hook_name_form_list}}_grid_{{$t.unique_key}} +
+ {{/if}} + {{php}} + $hook_data = MyEventTrigger($hook_name_form_list.'_grid_'.$t['unique_key'], [ + 'hook_name' => $hook_name_form_list.'_grid_'.$t['unique_key'], + 'is_backend' => true, + 'id' => isset($data_list[$i][$form_table['base']['key_field']]) ? $data_list[$i][$form_table['base']['key_field']] : 0, + 'data' => $data_list[$i], + ]); + if(!empty($hook_data) && is_array($hook_data)) + { + foreach($hook_data as $hook) + { + if(is_string($hook) || is_int($hook)) + { + echo htmlspecialchars_decode($hook); + } + } + } + {{/php}} + {{/if}} {{/if}} {{/if}} diff --git a/app/module/FormHandleModule.php b/app/module/FormHandleModule.php index 04d0c1812..63e555f0b 100644 --- a/app/module/FormHandleModule.php +++ b/app/module/FormHandleModule.php @@ -620,6 +620,22 @@ class FormHandleModule { $this->order_by['field'] = empty($v['sort_field']) ? $form_name : $v['sort_field']; } + + // 唯一key,避免是模块路径、直接取最后一段 + $unique_key = ''; + if(!empty($v['view_key'])) + { + // 多字段情况下 + if(is_array($v['view_key'])) + { + $unique_key = isset($v['view_key'][0]) ? $v['view_key'][0] : ''; + } else { + // 字段名称、模块路径 + $temp = explode('/', $v['view_key']); + $unique_key = empty($temp) ? '' : end($temp); + } + } + $v['unique_key'] = $unique_key; } } -- Gitee From f8141855b0616b15b7b10912b6aaeea4df91c62c Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 8 Aug 2021 22:03:09 +0800 Subject: [PATCH 12/57] =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=8E=92=E9=99=A4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/base/Page.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/extend/base/Page.php b/extend/base/Page.php index 966e41740..ec0990177 100755 --- a/extend/base/Page.php +++ b/extend/base/Page.php @@ -24,6 +24,7 @@ class Page private $number; private $bt_number; private $where; + private $not_fields; private $page_total; private $url; private $html; @@ -31,19 +32,21 @@ class Page /** * [__construct description] - * @param [int] $param['total'] [数据总数] - * @param [int] $param['number'] [每页数据条数] - * @param [int] $param['bt_number'] [分页显示按钮个数] - * @param [array] $param['where'] [额外条件(键值对)] - * @param [string] $param['url'] [url地址] + * @param [int] $params['total'] [数据总数] + * @param [int] $params['number'] [每页数据条数] + * @param [int] $params['bt_number'] [分页显示按钮个数] + * @param [array] $params['where'] [额外条件(键值对)] + * @param [array] $params['not_fields'] [不参与条件拼接的字段] + * @param [string] $params['url'] [url地址] */ - public function __construct($params = array()) + public function __construct($params = []) { $this->page = max(1, isset($params['page']) ? intval($params['page']) : 1); $this->total = max(1, isset($params['total']) ? intval($params['total']) : 1); $this->number = max(1, isset($params['number']) ? intval($params['number']) : 1); $this->bt_number = isset($params['bt_number']) ? intval($params['bt_number']) : 2; $this->where = (isset($params['where']) && is_array($params['where'])) ? $params['where'] : ''; + $this->not_fields = (!empty($params['not_fields']) && is_array($params['not_fields'])) ? $params['not_fields'] : []; $this->url = isset($params['url']) ? $params['url'] : ''; $this->page_total = 1; $this->html = ''; @@ -70,7 +73,7 @@ class Page $tmp = true; foreach($this->where as $k=>$v) { - if(!is_array($v)) + if(!in_array($k, $this->not_fields) && !is_array($v)) { if($k == 'page') continue; -- Gitee From 0754f42ef0a9b08fae23b7fb654436c2b9775323 Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 8 Aug 2021 22:05:58 +0800 Subject: [PATCH 13/57] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/common/css/common.css | 1 + public/static/index/default/css/goods.css | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css index 028650708..f400fbbad 100755 --- a/public/static/common/css/common.css +++ b/public/static/common/css/common.css @@ -802,6 +802,7 @@ button.colorpicker-submit img { .pagination-input { width: 50px; vertical-align: inherit !important; + padding: 5px; } /** diff --git a/public/static/index/default/css/goods.css b/public/static/index/default/css/goods.css index aa1994752..1c19f42cd 100755 --- a/public/static/index/default/css/goods.css +++ b/public/static/index/default/css/goods.css @@ -585,5 +585,5 @@ flex: 1 1 0%;line-height: 16px;cursor: pointer;} color: #3bb4f2; } .goods-plugins-view-icon-container a:not(:first-child) { - margin-left: 5px; + margin-left: 2px; } \ No newline at end of file -- Gitee From 95e5c67d971ee1a998111ba32137e266ad7bb64d Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 8 Aug 2021 22:06:17 +0800 Subject: [PATCH 14/57] =?UTF-8?q?=20=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E8=8E=B7=E5=8F=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/UserService.php | 43 ++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/app/service/UserService.php b/app/service/UserService.php index 41db35a8c..064b140af 100755 --- a/app/service/UserService.php +++ b/app/service/UserService.php @@ -38,33 +38,36 @@ class UserService */ public static function LoginUserInfo() { - // 参数 - $params = input(); - - // 用户数据处理 - $user = null; - if(APPLICATION == 'web') + // 静态数据避免重复读取 + static $user_login_info = null; + if($user_login_info === null) { - // web用户session - $user = MySession(self::$user_login_key); + // 参数 + $params = input(); - // 用户信息为空,指定了token则设置登录信息 - if(empty($user) && !empty($params['token'])) + // 用户数据处理 + if(APPLICATION == 'web') { - $user = self::UserTokenData($params['token']); - if($user !== null && isset($user['id'])) + // web用户session + $user_login_info = MySession(self::$user_login_key); + + // 用户信息为空,指定了token则设置登录信息 + if(empty($user_login_info) && !empty($params['token'])) { - self::UserLoginRecord($user['id']); + $user_login_info = self::UserTokenData($params['token']); + if($user_login_info !== null && isset($user_login_info['id'])) + { + self::UserLoginRecord($user_login_info['id']); + } + } + } else { + if(!empty($params['token'])) + { + $user_login_info = self::UserTokenData($params['token']); } - } - } else { - if(!empty($params['token'])) - { - $user = self::UserTokenData($params['token']); } } - - return $user; + return $user_login_info; } /** -- Gitee From b55c61723a688681f7f0aa64510c312d465c5791 Mon Sep 17 00:00:00 2001 From: Devil Date: Mon, 9 Aug 2021 16:13:30 +0800 Subject: [PATCH 15/57] =?UTF-8?q?=20=E6=94=AF=E4=BB=98=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=94=9F=E7=94=9F=E6=88=90=E6=A0=B9=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/PaymentService.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/service/PaymentService.php b/app/service/PaymentService.php index c38db48a7..39fe9a4fa 100755 --- a/app/service/PaymentService.php +++ b/app/service/PaymentService.php @@ -808,15 +808,15 @@ namespace think; // 支付模块标记 define('PAYMENT_TYPE', '{$params["payment"]}'); +// 根目录入口 +define('IS_ROOT_ACCESS', true); + // 引入公共入口文件 require __DIR__.'/public/core.php'; // 加载基础文件 require __DIR__ . '/vendor/autoload.php'; -// 根目录入口 -define('IS_ROOT_ACCESS', true); - // 执行HTTP应用并响应 \$http = (new App())->http; \$response = \$http->name('{$module_notify}')->run(); @@ -840,15 +840,15 @@ namespace think; // 支付模块标记 define('PAYMENT_TYPE', '{$params["payment"]}'); +// 根目录入口 +define('IS_ROOT_ACCESS', true); + // 引入公共入口文件 require __DIR__.'/public/core.php'; // 加载基础文件 require __DIR__ . '/vendor/autoload.php'; -// 根目录入口 -define('IS_ROOT_ACCESS', true); - // 执行HTTP应用并响应 \$http = (new App())->http; \$response = \$http->name('{$module_respond}')->run(); -- Gitee From a3352e827c984cfb8f895e218bf052de961c9600 Mon Sep 17 00:00:00 2001 From: Devil Date: Mon, 9 Aug 2021 16:14:07 +0800 Subject: [PATCH 16/57] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Common.php | 2 +- app/admin/controller/Plugins.php | 2 +- .../view/default/public/module/detail.html | 27 +++++++++++++++++++ .../default/public/module/form_table.html | 8 +++--- app/index/controller/Common.php | 2 +- app/index/controller/Plugins.php | 2 +- .../view/default/public/module/detail.html | 27 +++++++++++++++++++ .../default/public/module/form_table.html | 8 +++--- 8 files changed, 66 insertions(+), 12 deletions(-) diff --git a/app/admin/controller/Common.php b/app/admin/controller/Common.php index a04691588..23658af51 100755 --- a/app/admin/controller/Common.php +++ b/app/admin/controller/Common.php @@ -395,7 +395,7 @@ class Common extends BaseController } // 表格列表公共标识 - MyViewAssign('hook_name_form_list', $current.'_list'); + MyViewAssign('hook_name_form_grid', $current.'_grid'); // 内容外部顶部 MyViewAssign('hook_name_content_top', $current.'_content_top'); // 内容外部底部 diff --git a/app/admin/controller/Plugins.php b/app/admin/controller/Plugins.php index 24c8eb2d0..7079eff64 100755 --- a/app/admin/controller/Plugins.php +++ b/app/admin/controller/Plugins.php @@ -112,7 +112,7 @@ class Plugins extends Common // 调用失败 MyViewAssign('msg', $ret['msg']); - return MyView(); + return MyView('public/tips_error'); } /** diff --git a/app/admin/view/default/public/module/detail.html b/app/admin/view/default/public/module/detail.html index 4b702ff12..3e611c546 100644 --- a/app/admin/view/default/public/module/detail.html +++ b/app/admin/view/default/public/module/detail.html @@ -120,6 +120,33 @@ {{/if}} {{/case}} {{/switch}} + + + {{if !empty($t['unique_key']) and $t['view_type'] neq 'operate'}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ {{$hook_name_form_grid}}_{{$t.unique_key}} +
+ {{/if}} + {{php}} + $hook_data = MyEventTrigger($hook_name_form_grid.'_'.$t['unique_key'], [ + 'hook_name' => $hook_name_form_grid.'_'.$t['unique_key'], + 'is_backend' => true, + 'id' => isset($data[$form_table['base']['key_field']]) ? $data[$form_table['base']['key_field']] : 0, + 'data' => $data, + ]); + if(!empty($hook_data) && is_array($hook_data)) + { + foreach($hook_data as $hook) + { + if(is_string($hook) || is_int($hook)) + { + echo htmlspecialchars_decode($hook); + } + } + } + {{/php}} + {{/if}} {{/if}} {{/foreach}} diff --git a/app/admin/view/default/public/module/form_table.html b/app/admin/view/default/public/module/form_table.html index 180be5eee..ce08aaad9 100644 --- a/app/admin/view/default/public/module/form_table.html +++ b/app/admin/view/default/public/module/form_table.html @@ -301,14 +301,14 @@ {{if !empty($t['unique_key']) and $t['view_type'] neq 'operate'}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
- {{$hook_name_form_list}}_grid_{{$t.unique_key}} + {{$hook_name_form_grid}}_{{$t.unique_key}}
{{/if}} {{php}} - $hook_data = MyEventTrigger($hook_name_form_list.'_grid_'.$t['unique_key'], [ - 'hook_name' => $hook_name_form_list.'_grid_'.$t['unique_key'], + $hook_data = MyEventTrigger($hook_name_form_grid.'_'.$t['unique_key'], [ + 'hook_name' => $hook_name_form_grid.'_'.$t['unique_key'], 'is_backend' => true, 'id' => isset($data_list[$i][$form_table['base']['key_field']]) ? $data_list[$i][$form_table['base']['key_field']] : 0, 'data' => $data_list[$i], diff --git a/app/index/controller/Common.php b/app/index/controller/Common.php index 21344f1f9..247140ce1 100755 --- a/app/index/controller/Common.php +++ b/app/index/controller/Common.php @@ -555,7 +555,7 @@ class Common extends BaseController } // 表格列表公共标识 - MyViewAssign('hook_name_form_list', $current.'_list'); + MyViewAssign('hook_name_form_grid', $current.'_grid'); // 内容外部顶部 MyViewAssign('hook_name_content_top', $current.'_content_top'); // 内容外部底部 diff --git a/app/index/controller/Plugins.php b/app/index/controller/Plugins.php index e8773af77..456f93323 100755 --- a/app/index/controller/Plugins.php +++ b/app/index/controller/Plugins.php @@ -100,7 +100,7 @@ class Plugins extends Common // 调用失败 MyViewAssign('msg', $ret['msg']); - return MyView(); + return MyView('public/tips_error'); } /** diff --git a/app/index/view/default/public/module/detail.html b/app/index/view/default/public/module/detail.html index 4b702ff12..3e611c546 100644 --- a/app/index/view/default/public/module/detail.html +++ b/app/index/view/default/public/module/detail.html @@ -120,6 +120,33 @@ {{/if}} {{/case}} {{/switch}} + + + {{if !empty($t['unique_key']) and $t['view_type'] neq 'operate'}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ {{$hook_name_form_grid}}_{{$t.unique_key}} +
+ {{/if}} + {{php}} + $hook_data = MyEventTrigger($hook_name_form_grid.'_'.$t['unique_key'], [ + 'hook_name' => $hook_name_form_grid.'_'.$t['unique_key'], + 'is_backend' => true, + 'id' => isset($data[$form_table['base']['key_field']]) ? $data[$form_table['base']['key_field']] : 0, + 'data' => $data, + ]); + if(!empty($hook_data) && is_array($hook_data)) + { + foreach($hook_data as $hook) + { + if(is_string($hook) || is_int($hook)) + { + echo htmlspecialchars_decode($hook); + } + } + } + {{/php}} + {{/if}} {{/if}} {{/foreach}} diff --git a/app/index/view/default/public/module/form_table.html b/app/index/view/default/public/module/form_table.html index 180be5eee..ce08aaad9 100644 --- a/app/index/view/default/public/module/form_table.html +++ b/app/index/view/default/public/module/form_table.html @@ -301,14 +301,14 @@ {{if !empty($t['unique_key']) and $t['view_type'] neq 'operate'}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
- {{$hook_name_form_list}}_grid_{{$t.unique_key}} + {{$hook_name_form_grid}}_{{$t.unique_key}}
{{/if}} {{php}} - $hook_data = MyEventTrigger($hook_name_form_list.'_grid_'.$t['unique_key'], [ - 'hook_name' => $hook_name_form_list.'_grid_'.$t['unique_key'], + $hook_data = MyEventTrigger($hook_name_form_grid.'_'.$t['unique_key'], [ + 'hook_name' => $hook_name_form_grid.'_'.$t['unique_key'], 'is_backend' => true, 'id' => isset($data_list[$i][$form_table['base']['key_field']]) ? $data_list[$i][$form_table['base']['key_field']] : 0, 'data' => $data_list[$i], -- Gitee From 9c9db254dfa84f70d6c910ea82520c66a3613be0 Mon Sep 17 00:00:00 2001 From: Devil Date: Mon, 9 Aug 2021 22:47:53 +0800 Subject: [PATCH 17/57] =?UTF-8?q?=20=E5=95=86=E5=93=81=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Goods.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/index/controller/Goods.php b/app/index/controller/Goods.php index 9143938e2..512ea9c18 100755 --- a/app/index/controller/Goods.php +++ b/app/index/controller/Goods.php @@ -336,7 +336,7 @@ class Goods extends Common } // 参数 - $params = input(); + $params = $this->data_request; if(empty($params['goods_id'])) { return DataReturn('参数有误', -1); @@ -371,7 +371,7 @@ class Goods extends Common 'number' => $number, 'total' => $total, 'page_total' => $page_total, - 'data' => MyView(null, ['data'=>$data['data']]), + 'data' => MyView('', ['data'=>$data['data']]), ]; return DataReturn('请求成功', 0, $result); } -- Gitee From 9b74beecf85b37e4c3b028d964f5a41c150e640d Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 10 Aug 2021 20:47:44 +0800 Subject: [PATCH 18/57] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E4=B8=8A=E4=BC=A0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/default/appmini/upload.html | 14 ++-- app/service/AppMiniService.php | 77 +++++++++++++++++++--- 2 files changed, 76 insertions(+), 15 deletions(-) diff --git a/app/admin/view/default/appmini/upload.html b/app/admin/view/default/appmini/upload.html index 375c2bcea..71242d58d 100644 --- a/app/admin/view/default/appmini/upload.html +++ b/app/admin/view/default/appmini/upload.html @@ -12,12 +12,14 @@
-
- - - 上传一个zip压缩格式的主题安装包 -
+
+
+ + + 上传一个zip压缩格式的主题安装包 +
+
diff --git a/app/service/AppMiniService.php b/app/service/AppMiniService.php index 7051ffa60..9fa4b5e6d 100755 --- a/app/service/AppMiniService.php +++ b/app/service/AppMiniService.php @@ -33,6 +33,9 @@ class AppMiniService // 当前默认主题 public static $default_theme; + // 排除的文件后缀 + private static $exclude_ext = ['php']; + /** * @author Devil * @blog http://gong.gg/ @@ -46,6 +49,12 @@ class AppMiniService // 当前小程序包名称 self::$application_name = isset($params['application_name']) ? $params['application_name'] : 'weixin'; + // 小程序类型校验 + if(!array_key_exists(self::$application_name, lang('common_appmini_type'))) + { + return DataReturn('小程序类型有误['.self::$application_name.']', -1); + } + // 原包地址/操作地址 self::$old_root = ROOT.'sourcecode'; self::$new_root = ROOT.'public'.DS.'download'.DS.'sourcecode'; @@ -54,6 +63,8 @@ class AppMiniService // 默认主题 self::$default_theme = self::DefaultTheme(); + + return DataReturn('success', 0); } /** @@ -84,7 +95,12 @@ class AppMiniService if(empty(self::$application_name)) { // 初始化 - self::Init($params); + $ret = self::Init($params); + if($ret['code'] != 0) + { + // 如果类型错误则使用 weixin 作为默认 + self::$application_name = 'weixin'; + } } return 'common_app_mini_'.self::$application_name.'_default_theme'; @@ -102,7 +118,11 @@ class AppMiniService public static function ThemeList($params = []) { // 初始化 - self::Init($params); + $ret = self::Init($params); + if($ret['code'] != 0) + { + return []; + } // 读取目录 $result = []; @@ -192,7 +212,11 @@ class AppMiniService public static function ThemeUploadHandle($package_file, $params = []) { // 初始化 - self::Init($params); + $ret = self::Init($params); + if($ret['code'] != 0) + { + return $ret; + } // 主题目录 $dir = self::$old_path.DS; @@ -218,6 +242,17 @@ class AppMiniService continue; } + // 排除后缀文件 + $pos = strripos($file, '.'); + if($pos !== false) + { + $info = pathinfo($file); + if(isset($info['extension']) && in_array($info['extension'], self::$exclude_ext)) + { + continue; + } + } + // 截取文件路径 $file_path = $dir.substr($file, 0, strrpos($file, '/')); @@ -268,7 +303,11 @@ class AppMiniService } // 初始化 - self::Init($params); + $ret = self::Init($params); + if($ret['code'] != 0) + { + return $ret; + } // 防止路径回溯 $id = htmlentities(str_replace(array('.', '/', '\\', ':'), '', strip_tags($params['id']))); @@ -323,7 +362,11 @@ class AppMiniService } // 初始化 - self::Init($params); + $ret = self::Init($params); + if($ret['code'] != 0) + { + return $ret; + } // 是否开启开发者模式 if(MyConfig('shopxo.is_develop') !== true) @@ -401,7 +444,11 @@ class AppMiniService public static function MiniThemeConfig($theme, $params) { // 初始化 - self::Init($params); + $ret = self::Init($params); + if($ret['code'] != 0) + { + return $ret; + } // 获取配置信息 $config_file = self::$old_path.DS.$theme.DS.'config.json'; @@ -428,7 +475,11 @@ class AppMiniService public static function DownloadDataList($params = []) { // 初始化 - self::Init($params); + $ret = self::Init($params); + if($ret['code'] != 0) + { + return $ret; + } // 获取包列表 $result = []; @@ -477,7 +528,11 @@ class AppMiniService } // 初始化 - self::Init($params); + $ret = self::Init($params); + if($ret['code'] != 0) + { + return $ret; + } // 配置内容 $title = MyC('common_app_mini_'.self::$application_name.'_title'); @@ -708,7 +763,11 @@ class AppMiniService } // 初始化 - self::Init($params); + $ret = self::Init($params); + if($ret['code'] != 0) + { + return $ret; + } // 循环操作 $sucs = 0; -- Gitee From 14836891d942e7e6d0253b5060f4e1b0ae4d7784 Mon Sep 17 00:00:00 2001 From: Devil Date: Wed, 11 Aug 2021 14:40:57 +0800 Subject: [PATCH 19/57] =?UTF-8?q?=20=E8=A1=A8=E5=8D=95=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E5=99=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/common/js/common.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index b1d4afee7..787b91aa3 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -290,10 +290,16 @@ function FromInit(form_name) // 错误 onInValid: function(validity) { - // 错误信息 - var $field = $(validity.field); - var msg = $field.data('validationMessage') || this.getValidationMessage(validity); - Prompt(msg); + setTimeout(function() + { + // 错误信息 + var $field = $(validity.field); + var msg = $field.data('validationMessage') || this.getValidationMessage(validity); + if($field.hasClass('am-field-error')) + { + Prompt(msg); + } + }, 100); }, // 提交 -- Gitee From ccf47841cde7e69a743a3c2a3233790817cdf562 Mon Sep 17 00:00:00 2001 From: Devil Date: Wed, 11 Aug 2021 17:30:06 +0800 Subject: [PATCH 20/57] =?UTF-8?q?zip=E6=93=8D=E4=BD=9C=E9=80=82=E9=85=8Dph?= =?UTF-8?q?p8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/AppMiniService.php | 77 +++++----- app/service/PaymentService.php | 84 +++++------ app/service/PluginsAdminService.php | 201 +++++++++++++++------------ app/service/SystemUpgradeService.php | 96 +++++++------ app/service/ThemeService.php | 112 ++++++++------- app/service/UserService.php | 5 +- 6 files changed, 317 insertions(+), 258 deletions(-) diff --git a/app/service/AppMiniService.php b/app/service/AppMiniService.php index 9fa4b5e6d..1b25c05b8 100755 --- a/app/service/AppMiniService.php +++ b/app/service/AppMiniService.php @@ -228,53 +228,62 @@ class AppMiniService } // 开始解压文件 - $resource = zip_open($package_file); - while(($temp_resource = zip_read($resource)) !== false) + $zip = new \ZipArchive(); + $resource = $zip->open($package_file); + if($resource != true) { - if(zip_entry_open($resource, $temp_resource)) + return DataReturn('压缩包打开失败['.$resource.']', -11); + } + for($i=0; $i<$zip->numFiles; $i++) + { + // 资源文件 + $file = $zip->getNameIndex($i); + + // 排除系统.开头的临时文件和目录 + if(strpos($file, '/.') !== false) { - // 资源文件 - $file = zip_entry_name($temp_resource); + continue; + } - // 排除系统.开头的临时文件和目录 - if(strpos($file, '/.') !== false) + // 排除后缀文件 + $pos = strripos($file, '.'); + if($pos !== false) + { + $info = pathinfo($file); + if(isset($info['extension']) && in_array($info['extension'], self::$exclude_ext)) { continue; } + } - // 排除后缀文件 - $pos = strripos($file, '.'); - if($pos !== false) - { - $info = pathinfo($file); - if(isset($info['extension']) && in_array($info['extension'], self::$exclude_ext)) - { - continue; - } - } - - // 截取文件路径 - $file_path = $dir.substr($file, 0, strrpos($file, '/')); + // 截取文件路径 + $file_path = $dir.substr($file, 0, strrpos($file, '/')); - // 路径不存在则创建 - if(!is_dir($file_path)) - { - mkdir($file_path, 0777, true); - } + // 路径不存在则创建 + if(!is_dir($file_path)) + { + mkdir($file_path, 0777, true); + } - // 如果不是目录则写入文件 - if(!is_dir($dir.$file)) + // 如果不是目录则写入文件 + if(!is_dir($dir.$file)) + { + // 读取这个文件 + $stream = $zip->getStream($file); + if($stream !== false) { - // 读取这个文件 - $file_size = zip_entry_filesize($temp_resource); - $file_content = zip_entry_read($temp_resource, $file_size); - file_put_contents($dir.$file, $file_content); + $file_content = stream_get_contents($stream); + if($file_content !== false) + { + file_put_contents($dir.$file, $file_content); + } + fclose($stream); } - - // 关闭目录项 - zip_entry_close($temp_resource); } } + // 关闭zip + $zip->close(); + return DataReturn('安装成功'); } diff --git a/app/service/PaymentService.php b/app/service/PaymentService.php index 39fe9a4fa..245ddf80e 100755 --- a/app/service/PaymentService.php +++ b/app/service/PaymentService.php @@ -496,65 +496,71 @@ class PaymentService } // 开始解压文件 - $resource = zip_open($package_file); - if(!is_resource($resource)) + $zip = new \ZipArchive(); + $resource = $zip->open($package_file); + if($resource != true) { - return DataReturn('压缩包打开失败['.$resource.']', -10); + return DataReturn('压缩包打开失败['.$resource.']', -11); } $success = 0; $error = 0; - while(($temp_resource = zip_read($resource)) !== false) + for($i=0; $i<$zip->numFiles; $i++) { - if(zip_entry_open($resource, $temp_resource)) - { - // 当前压缩包中项目名称 - $file = zip_entry_name($temp_resource); + // 资源文件 + $file = $zip->getNameIndex($i); - // 排除临时文件和临时目录 - if(strpos($file, '/.') === false && strpos($file, '__') === false) + // 排除临时文件和临时目录 + if(strpos($file, '/.') === false && strpos($file, '__') === false) + { + // 忽略非php文件 + if(substr($file, -4) != '.php') { - // 忽略非php文件 - if(substr($file, -4) != '.php') - { - $error++; - continue; - } + $error++; + continue; + } - // 文件名称 - $payment = str_replace(array('.', '/', '\\', ':'), '', substr($file, 0, -4)); + // 文件名称 + $payment = str_replace(array('.', '/', '\\', ':'), '', substr($file, 0, -4)); - // 是否已有存在插件 - if(file_exists(self::$payment_dir.$payment)) - { - $error++; - continue; - } else { - $file = self::$payment_dir.$payment.'.php'; - } + // 是否已有存在插件 + if(file_exists(self::$payment_dir.$payment)) + { + $error++; + continue; + } - // 如果不是目录则写入文件 - if(!is_dir($file)) + // 如果不是目录则写入文件 + $new_file = self::$payment_dir.$payment.'.php'; + if(!is_dir($new_file)) + { + // 读取这个文件 + $stream = $zip->getStream($file); + if($stream !== false) { - // 读取这个文件 - $file_size = zip_entry_filesize($temp_resource); - $file_content = zip_entry_read($temp_resource, $file_size); - if(@file_put_contents($file, $file_content) !== false) + $file_content = stream_get_contents($stream); + if($file_content !== false) { - // 文件校验 - $config = self::GetPaymentConfig($payment); - if($config === false) + if(@file_put_contents($new_file, $file_content) !== false) { - $error++; - @unlink($file); - } else { - $success++; + // 文件校验 + $config = self::GetPaymentConfig($payment); + if($config === false) + { + $error++; + @unlink($new_file); + } else { + $success++; + } } } + fclose($stream); } } } } + // 关闭zip + $zip->close(); if($success > 0) { diff --git a/app/service/PluginsAdminService.php b/app/service/PluginsAdminService.php index 6ce0993f1..d2a99ff1b 100755 --- a/app/service/PluginsAdminService.php +++ b/app/service/PluginsAdminService.php @@ -1062,129 +1062,148 @@ php; $plugins = ''; // 开始解压文件 - $resource = zip_open($package_file); - if(!is_resource($resource)) + $zip = new \ZipArchive(); + $resource = $zip->open($package_file); + if($resource != true) { - return DataReturn('压缩包打开失败['.$resource.']', -10); + return DataReturn('压缩包打开失败['.$resource.']', -11); } - while(($temp_resource = zip_read($resource)) !== false) + // 文件第一个目录为当前插件名称 + $entry = $zip->statIndex(0); + $file = $entry['name']; + //根据第一个文件是目录,还是包含namespace payment,判断插件类型 + if(str_ends_with($file, '/')) { - if(zip_entry_open($resource, $temp_resource)) - { - // 当前压缩包中项目名称 - $file = zip_entry_name($temp_resource); + //获取plugins + $plugins = substr($file, 0, strpos($file, '/')); - // 获取包名 - if(empty($plugins)) - { - // 应用名称 - $plugins = substr($file, 0, strpos($file, '/')); - if(empty($plugins)) + // 业务类型处理 + switch($type) + { + // 上传安装 + case 0 : + // 应用不存在则添加 + $ret = self::PluginsVerification($plugins); + if($ret['code'] != 0) { - // 应用名称为空、则校验是否为支付插件 - $file_size = zip_entry_filesize($temp_resource); - $file_content = zip_entry_read($temp_resource, $file_size); - if(stripos($file_content, 'namespace payment') !== false) - { - return DataReturn('支付插件请到[ 网站管理->支付方式 ]模块里面去上传安装', -1); - } - - // 不是支付插件则提示插件包错误 - return DataReturn('插件包有误', -30); + return $ret; } - // 业务类型处理 - switch($type) + // 应用是否存在 + if(self::PluginsExist($plugins)) { - // 上传安装 - case 0 : - // 应用不存在则添加 - $ret = self::PluginsVerification($plugins); - if($ret['code'] != 0) - { - zip_entry_close($temp_resource); - return $ret; - } - - // 应用是否存在 - if(self::PluginsExist($plugins)) - { - zip_entry_close($temp_resource); - return DataReturn('应用名称已存在['.$plugins.']', -1); - } - break; + return DataReturn('应用名称已存在['.$plugins.']', -1); + } + break; - // 更新 - case 1 : - // 应用是否存在 - if($plugins != $plugins_old) - { - zip_entry_close($temp_resource); - return DataReturn('应用标识与指定不一致['.$plugins.'<>'.$plugins_old.']', -1); - } - break; + // 更新 + case 1 : + // 应用是否存在 + if($plugins != $plugins_old) + { + return DataReturn('应用标识与指定不一致['.$plugins.'<>'.$plugins_old.']', -1); + } + break; + } + } else { + // 应用名称为空、则校验是否为支付插件 + $stream = $zip->getStream($file); + if($stream !== false) + { + $file_content = stream_get_contents($stream); + if($file_content !== false) + { + if(stripos($file_content, 'namespace payment') !== false) + { + return DataReturn('支付插件请到[ 网站管理->支付方式 ]模块里面去上传安装', -1); } } + fclose($stream); + } + + // 不是支付插件则提示插件包错误 + return DataReturn('插件包有误', -30); + } - // 排除临时文件和临时目录 - if(strpos($file, '/.') === false && strpos($file, '__') === false) + // 应用文件处理 + $success = 0; + for($i=0; $i<$zip->numFiles; $i++) + { + // 资源文件 + $file = $zip->getNameIndex($i); + + // 排除临时文件和临时目录 + if(strpos($file, '/.') === false && strpos($file, '__') === false) + { + // 文件包对应系统所在目录 + $is_has_find = false; + foreach($dir_list as $dir_key=>$dir_value) { - // 文件包对应系统所在目录 - $is_has_find = false; - foreach($dir_list as $dir_key=>$dir_value) + if(strpos($file, $dir_key) !== false) { - if(strpos($file, $dir_key) !== false) + // 仅控制器模块支持php文件 + if($dir_key != '_controller_') { - // 仅控制器模块支持php文件 - if($dir_key != '_controller_') + // 排除后缀文件 + $pos = strripos($file, '.'); + if($pos !== false) { - // 排除后缀文件 - $pos = strripos($file, '.'); - if($pos !== false) + $info = pathinfo($file); + if(isset($info['extension']) && in_array($info['extension'], self::$exclude_ext)) { - $info = pathinfo($file); - if(isset($info['extension']) && in_array($info['extension'], self::$exclude_ext)) - { - continue; - } + continue; } } - - // 匹配成功文件路径处理、跳出循环 - $file = str_replace($plugins.'/'.$dir_key.'/', '', $dir_value.$file); - $is_has_find = true; - break; } - } - // 没有匹配到则指定目录跳过 - if($is_has_find == false) - { - continue; + // 匹配成功文件路径处理、跳出循环 + $new_file = str_replace($plugins.'/'.$dir_key.'/', '', $dir_value.$file); + $is_has_find = true; + break; } + } - // 截取文件路径 - $file_path = substr($file, 0, strrpos($file, '/')); + // 没有匹配到则指定目录跳过 + if($is_has_find == false) + { + continue; + } + + // 截取文件路径 + $file_path = substr($new_file, 0, strrpos($new_file, '/')); - // 路径不存在则创建 - \base\FileUtil::CreateDir($file_path); + // 路径不存在则创建 + \base\FileUtil::CreateDir($file_path); - // 如果不是目录则写入文件 - if(!is_dir($file)) + // 如果不是目录则写入文件 + if(!is_dir($new_file)) + { + // 读取这个文件 + $stream = $zip->getStream($file); + if($stream !== false) { - // 读取这个文件 - $file_size = zip_entry_filesize($temp_resource); - $file_content = zip_entry_read($temp_resource, $file_size); - @file_put_contents($file, $file_content); + $file_content = stream_get_contents($stream); + if($file_content !== false) + { + if(file_put_contents($new_file, $file_content)) + { + $success++; + } + } + fclose($stream); } - - // 关闭目录项 - zip_entry_close($temp_resource); } } } + // 关闭zip + $zip->close(); + // 未匹配成功一个文件则认为插件包无效 + if($success <= 0) + { + return DataReturn('无效的插件包', -1); + } return DataReturn('success', 0, $plugins); } diff --git a/app/service/SystemUpgradeService.php b/app/service/SystemUpgradeService.php index 691710d0f..40ee3a656 100644 --- a/app/service/SystemUpgradeService.php +++ b/app/service/SystemUpgradeService.php @@ -134,10 +134,11 @@ class SystemUpgradeService public static function UpgradePackageHandle($package_file) { // 开始解压文件 - $resource = zip_open($package_file); - if(!is_resource($resource)) + $zip = new \ZipArchive(); + $resource = $zip->open($package_file); + if($resource != true) { - return DataReturn('压缩包打开失败['.$resource.']', -10); + return DataReturn('压缩包打开失败['.$resource.']', -11); } // 需要处理的文件 @@ -146,29 +147,29 @@ class SystemUpgradeService 'power.sql', ]; - while(($temp_resource = zip_read($resource)) !== false) + for($i=0; $i<$zip->numFiles; $i++) { - if(zip_entry_open($resource, $temp_resource)) - { - // 当前压缩包中项目名称 - $file = zip_entry_name($temp_resource); + // 资源文件 + $file = $zip->getNameIndex($i); - // 排除临时文件和临时目录 - if(strpos($file, '/.') === false && !is_dir($file) && in_array($file, $handle_file_arr)) + // 排除临时文件和临时目录 + if(strpos($file, '/.') === false && !is_dir($file) && in_array($file, $handle_file_arr)) + { + // 读取这个文件 + $stream = $zip->getStream($file); + if($stream !== false) { - // 读取这个文件 - $file_size = zip_entry_filesize($temp_resource); - $file_content = zip_entry_read($temp_resource, $file_size); + $file_content = stream_get_contents($stream); if(!empty($file_content)) { SqlConsoleService::Implement(['sql'=>$file_content]); } - - // 关闭目录项 - zip_entry_close($temp_resource); + fclose($stream); } } } + // 关闭zip + $zip->close(); return DataReturn('success', 0); } @@ -185,48 +186,51 @@ class SystemUpgradeService public static function SystemPackageHandle($package_file) { // 开始解压文件 - $resource = zip_open($package_file); - if(!is_resource($resource)) + $zip = new \ZipArchive(); + $resource = $zip->open($package_file); + if($resource != true) { - return DataReturn('压缩包打开失败['.$resource.']', -10); + return DataReturn('压缩包打开失败['.$resource.']', -11); } - - while(($temp_resource = zip_read($resource)) !== false) + for($i=0; $i<$zip->numFiles; $i++) { - if(zip_entry_open($resource, $temp_resource)) - { - // 当前压缩包中项目名称 - $file = zip_entry_name($temp_resource); + // 资源文件 + $file = $zip->getNameIndex($i); - // 排除临时文件和临时目录 - if(!empty($file) && strpos($file, '/.') === false) - { - // 文件实际位置 - $file_new = ROOT.$file; + // 排除临时文件和临时目录 + if(!empty($file) && strpos($file, '/.') === false) + { + // 文件实际位置 + $new_file = ROOT.$file; - // 截取文件路径 - $file_path = substr($file_new, 0, strrpos($file_new, '/')); + // 截取文件路径 + $file_path = substr($new_file, 0, strrpos($new_file, '/')); - // 路径不存在则创建、根目录文件不创建目录 - if(strpos($file, '/') !== false) - { - \base\FileUtil::CreateDir($file_path); - } + // 路径不存在则创建、根目录文件不创建目录 + if(strpos($file, '/') !== false) + { + \base\FileUtil::CreateDir($file_path); + } - // 如果不是目录则写入文件 - if(!is_dir($file_new)) + // 如果不是目录则写入文件 + if(!is_dir($new_file)) + { + // 读取这个文件 + $stream = $zip->getStream($file); + if($stream !== false) { - // 读取这个文件 - $file_size = zip_entry_filesize($temp_resource); - $file_content = zip_entry_read($temp_resource, $file_size); - @file_put_contents($file_new, $file_content); + $file_content = stream_get_contents($stream); + if($file_content !== false) + { + file_put_contents($new_file, $file_content); + } + fclose($stream); } - - // 关闭目录项 - zip_entry_close($temp_resource); } } } + // 关闭zip + $zip->close(); return DataReturn('success', 0); } diff --git a/app/service/ThemeService.php b/app/service/ThemeService.php index 7ceb4789a..323b02fd1 100755 --- a/app/service/ThemeService.php +++ b/app/service/ThemeService.php @@ -156,70 +156,88 @@ class ThemeService ]; // 开始解压文件 - $resource = zip_open($package_file); - while(($temp_resource = zip_read($resource)) !== false) + $zip = new \ZipArchive(); + $resource = $zip->open($package_file); + if($resource != true) { - if(zip_entry_open($resource, $temp_resource)) - { - // 当前压缩包中项目名称 - $file = zip_entry_name($temp_resource); + return DataReturn('压缩包打开失败['.$resource.']', -11); + } + $success = 0; + for($i=0; $i<$zip->numFiles; $i++) + { + // 资源文件 + $file = $zip->getNameIndex($i); - // 排除临时文件和临时目录 - if(strpos($file, '/.') === false && strpos($file, '__') === false) + // 排除临时文件和临时目录 + if(strpos($file, '/.') === false && strpos($file, '__') === false) + { + // 文件包对应系统所在目录 + $is_has_find = false; + foreach($dir_list as $dir_key=>$dir_value) { - // 文件包对应系统所在目录 - $is_has_find = false; - foreach($dir_list as $dir_key=>$dir_value) + if(strpos($file, $dir_key) !== false) { - if(strpos($file, $dir_key) !== false) - { - // 匹配成功文件路径处理、跳出循环 - $file = str_replace($dir_key.'/', '', $dir_value.$file); - $is_has_find = true; - break; - } + // 匹配成功文件路径处理、跳出循环 + $new_file = str_replace($dir_key.'/', '', $dir_value.$file); + $is_has_find = true; + break; } + } - // 没有匹配到则指定目录跳过 - if($is_has_find == false) - { - continue; - } + // 没有匹配到则指定目录跳过 + if($is_has_find == false) + { + continue; + } - // 排除后缀文件 - $pos = strripos($file, '.'); - if($pos !== false) + // 排除后缀文件 + $pos = strripos($file, '.'); + if($pos !== false) + { + $info = pathinfo($file); + if(isset($info['extension']) && in_array($info['extension'], self::$exclude_ext)) { - $info = pathinfo($file); - if(isset($info['extension']) && in_array($info['extension'], self::$exclude_ext)) - { - continue; - } + continue; } + } - // 截取文件路径 - $file_path = substr($file, 0, strrpos($file, '/')); + // 截取文件路径 + $file_path = substr($new_file, 0, strrpos($new_file, '/')); - // 路径不存在则创建 - if(!is_dir($file_path)) - { - mkdir($file_path, 0777, true); - } + // 路径不存在则创建 + if(!is_dir($file_path)) + { + mkdir($file_path, 0777, true); + } - // 如果不是目录则写入文件 - if(!is_dir($file)) + // 如果不是目录则写入文件 + if(!is_dir($new_file)) + { + // 读取这个文件 + $stream = $zip->getStream($file); + if($stream !== false) { - // 读取这个文件 - $file_size = zip_entry_filesize($temp_resource); - $file_content = zip_entry_read($temp_resource, $file_size); - file_put_contents($file, $file_content); + $file_content = stream_get_contents($stream); + if($file_content !== false) + { + if(file_put_contents($new_file, $file_content)) + { + $success++; + } + } + fclose($stream); } - - // 关闭目录项 - zip_entry_close($temp_resource); } } } + // 关闭zip + $zip->close(); + + // 未匹配成功一个文件则认为插件包无效 + if($success <= 0) + { + return DataReturn('无效的主题包', -1); + } return DataReturn('安装成功', 0); } diff --git a/app/service/UserService.php b/app/service/UserService.php index 064b140af..0b074956f 100755 --- a/app/service/UserService.php +++ b/app/service/UserService.php @@ -2431,7 +2431,10 @@ class UserService $user = (!empty($data) && array_key_exists($user_ids, $data)) ? $data[$user_ids] : []; } } else { - $user = self::UserHandle($user); + if(!empty($user)) + { + $user = self::UserHandle($user); + } } return $user; -- Gitee From 958a2a263c061da26b69892dd58b723c86ffe7bd Mon Sep 17 00:00:00 2001 From: Devil Date: Fri, 13 Aug 2021 20:04:56 +0800 Subject: [PATCH 21/57] =?UTF-8?q?=E8=B4=A7=E5=88=B0=E4=BB=98=E6=AC=BE?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Order.php | 17 +- .../view/default/order/module/goods.html | 11 +- .../view/default/order/module/operate.html | 70 ++-- .../view/default/order/module/pay_status.html | 4 +- app/api/controller/Order.php | 2 + app/index/controller/Order.php | 68 ++-- app/index/view/default/order/detail.html | 36 +- .../view/default/order/module/operate.html | 61 ++-- .../view/default/order/module/pay_status.html | 4 +- app/service/BuyService.php | 59 ++-- app/service/OrderAftersaleService.php | 6 +- app/service/OrderService.php | 333 ++++++++++++++---- 12 files changed, 444 insertions(+), 227 deletions(-) diff --git a/app/admin/controller/Order.php b/app/admin/controller/Order.php index 946d817df..2698afc30 100755 --- a/app/admin/controller/Order.php +++ b/app/admin/controller/Order.php @@ -68,12 +68,13 @@ class Order extends Common // 获取列表 $data_params = [ - 'm' => $page->GetPageStarNumber(), - 'n' => $this->page_size, - 'where' => $this->form_where, - 'order_by' => $this->form_order_by['data'], - 'is_public' => 0, - 'user_type' => 'admin', + 'm' => $page->GetPageStarNumber(), + 'n' => $this->page_size, + 'where' => $this->form_where, + 'order_by' => $this->form_order_by['data'], + 'is_public' => 0, + 'is_operate' => 1, + 'user_type' => 'admin', ]; $ret = OrderService::OrderList($data_params); @@ -178,6 +179,7 @@ class Order extends Common $params['user_id'] = $params['value']; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; + $params['user_type'] = 'admin'; return OrderService::OrderCancel($params); } @@ -201,6 +203,7 @@ class Order extends Common $params = $this->data_request; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; + $params['user_type'] = 'admin'; return OrderService::OrderDelivery($params); } @@ -225,6 +228,7 @@ class Order extends Common $params['user_id'] = $params['value']; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; + $params['user_type'] = 'admin'; return OrderService::OrderCollect($params); } @@ -249,6 +253,7 @@ class Order extends Common $params['user_id'] = $params['value']; $params['creator'] = $this->admin['id']; $params['creator_name'] = $this->admin['username']; + $params['user_type'] = 'admin'; return OrderService::OrderConfirm($params); } diff --git a/app/admin/view/default/order/module/goods.html b/app/admin/view/default/order/module/goods.html index 313dba4f9..d554e2264 100644 --- a/app/admin/view/default/order/module/goods.html +++ b/app/admin/view/default/order/module/goods.html @@ -23,10 +23,17 @@ - {{if $module_data['pay_status'] eq 1 and $module_data['pay_price'] lt $module_data['total_price']}} + {{if $module_data['pay_status'] eq 1 and $module_data['pay_price'] lt $module_data['total_price'] and in_array($module_data['status'], [2,3,4])}}

- 请注意、该订单支付金额小于总价金额 + 请注意、该订单支付金额小于总价金额 +

+
+ {{/if}} + {{if $module_data['pay_status'] eq 0 and in_array($module_data['status'], [2,3,4])}} +

+ + 请注意、该订单还未支付


{{/if}} diff --git a/app/admin/view/default/order/module/operate.html b/app/admin/view/default/order/module/operate.html index 85f7f05b9..9420ed612 100644 --- a/app/admin/view/default/order/module/operate.html +++ b/app/admin/view/default/order/module/operate.html @@ -3,46 +3,48 @@ 详情 -{{if in_array($module_data['status'], [0])}} - -{{/if}} -{{if in_array($module_data['status'], [0,1])}} - - {{if in_array($module_data['status'], [1])}} +{{if !empty($module_data['operate_data'])}} + {{if $module_data['operate_data']['is_confirm'] eq 1}} + + {{/if}} + {{if $module_data['operate_data']['is_pay'] eq 1}} {{/if}} -{{/if}} -{{if $module_data['status'] eq 2}} - {{if $module_data['order_model'] eq 2}} - + {{else /}} + + {{/if}} + {{/if}} + {{if $module_data['operate_data']['is_collect'] eq 1}} + + {{/if}} + {{if $module_data['operate_data']['is_cancel'] eq 1}} + - {{else /}} - {{/if}} -{{/if}} -{{if $module_data['status'] eq 3}} - -{{/if}} -{{if in_array($module_data['status'], [5,6])}} - {{/if}} \ No newline at end of file diff --git a/app/admin/view/default/order/module/pay_status.html b/app/admin/view/default/order/module/pay_status.html index 2d2481c2b..18b27911b 100644 --- a/app/admin/view/default/order/module/pay_status.html +++ b/app/admin/view/default/order/module/pay_status.html @@ -3,9 +3,9 @@ {{if $module_data['pay_status'] eq 1}}

{{$module_data.pay_status_name}}

{{elseif $module_data['pay_status'] gt 1 /}} -

{{$module_data.pay_status_name}}

+

{{$module_data.pay_status_name}}

{{else /}} -

{{$module_data.pay_status_name}}

+

{{$module_data.pay_status_name}}

{{/if}} {{if !empty($module_data['is_under_line_text'])}}

{{$module_data.is_under_line_text}}

diff --git a/app/api/controller/Order.php b/app/api/controller/Order.php index b14e8f6da..83f840552 100755 --- a/app/api/controller/Order.php +++ b/app/api/controller/Order.php @@ -75,6 +75,7 @@ class Order extends Common 'n' => $number, 'where' => $where, 'is_orderaftersale' => 1, + 'is_operate' => 1, ); $data = OrderService::OrderList($data_params); @@ -115,6 +116,7 @@ class Order extends Common 'n' => 1, 'where' => $where, 'is_orderaftersale' => 1, + 'is_operate' => 1, ); $data = OrderService::OrderList($data_params); if(!empty($data['data'][0])) diff --git a/app/index/controller/Order.php b/app/index/controller/Order.php index 0b748891f..528283c62 100755 --- a/app/index/controller/Order.php +++ b/app/index/controller/Order.php @@ -70,8 +70,9 @@ class Order extends Common 'm' => $page->GetPageStarNumber(), 'n' => $this->page_size, 'where' => $this->form_where, - 'order_by' => $this->form_order_by['data'], + 'order_by' => $this->form_order_by['data'], 'is_orderaftersale' => 1, + 'is_operate' => 1, 'user_type' => 'user', ]; $ret = OrderService::OrderList($data_params); @@ -106,31 +107,35 @@ class Order extends Common */ public function Detail() { + // 获取订单信息 $data = $this->OrderFirst(); - if(!empty($data)) + if(empty($data)) { - // 发起支付 - 支付方式 - MyViewAssign('buy_payment_list', PaymentService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1])); + MyViewAssign('msg', '没有相关数据'); + return MyView('public/tips_error'); + } + + // 发起支付 - 支付方式 + MyViewAssign('buy_payment_list', PaymentService::BuyPaymentList(['is_enable'=>1, 'is_open_user'=>1])); - // 虚拟销售配置 - $site_fictitious = ConfigService::SiteFictitiousConfig(); - MyViewAssign('site_fictitious', $site_fictitious['data']); + // 虚拟销售配置 + $site_fictitious = ConfigService::SiteFictitiousConfig(); + MyViewAssign('site_fictitious', $site_fictitious['data']); - // 支付参数 - $pay_params = OrderService::PayParamsHandle($this->data_request); + // 支付参数 + $pay_params = OrderService::PayParamsHandle($this->data_request); - // 加载百度地图api - MyViewAssign('is_load_baidu_map_api', 1); + // 加载百度地图api + MyViewAssign('is_load_baidu_map_api', 1); - // 浏览器名称 - MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('订单详情', 1)); + // 浏览器名称 + MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('订单详情', 1)); - // 数据赋值 - MyViewAssign('data', $data); - MyViewAssign('pay_params', $pay_params); - MyViewAssign('params', $this->data_request); - return MyView(); - } + // 数据赋值 + MyViewAssign('data', $data); + MyViewAssign('pay_params', $pay_params); + MyViewAssign('params', $this->data_request); + return MyView(); } /** @@ -143,22 +148,24 @@ class Order extends Common */ public function Comments() { + // 获取订单信息 $data = $this->OrderFirst(); - if(!empty($data)) + if(empty($data)) { - MyViewAssign('referer_url', empty($_SERVER['HTTP_REFERER']) ? MyUrl('index/order/index') : $_SERVER['HTTP_REFERER']); - MyViewAssign('data', $data); - - // 浏览器名称 - MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('订单评论', 1)); - - // 编辑器文件存放地址 - MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('order_comments-'.$this->user['id'].'-'.$data['id'])); - return MyView(); - } else { MyViewAssign('msg', '没有相关数据'); return MyView('public/tips_error'); } + + // 上一个页面 url 地址 + MyViewAssign('referer_url', empty($_SERVER['HTTP_REFERER']) ? MyUrl('index/order/index') : $_SERVER['HTTP_REFERER']); + MyViewAssign('data', $data); + + // 浏览器名称 + MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('订单评论', 1)); + + // 编辑器文件存放地址 + MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('order_comments-'.$this->user['id'].'-'.$data['id'])); + return MyView(); } /** @@ -188,6 +195,7 @@ class Order extends Common 'n' => 1, 'where' => $where, 'is_orderaftersale' => 1, + 'is_operate' => 1, 'user_type' => 'user', ]; $ret = OrderService::OrderList($data_params); diff --git a/app/index/view/default/order/detail.html b/app/index/view/default/order/detail.html index e07893ac6..c7506137a 100755 --- a/app/index/view/default/order/detail.html +++ b/app/index/view/default/order/detail.html @@ -277,23 +277,25 @@
- {{if $data['status'] neq 2}} - 您可以 - {{/if}} - {{if in_array($data['status'], [0,1])}} - - {{/if}} - {{if in_array($data['status'], [1])}} - - {{/if}} - {{if in_array($data['status'], [3])}} - - {{/if}} - {{if in_array($data['status'], [4]) and $data['user_is_comments'] eq 0}} - 评价 - {{/if}} - {{if in_array($data['status'], [4,5,6])}} - + {{if !empty($data['operate_data'])}} + {{if $data['status'] neq 2}} + 您可以 + {{/if}} + {{if $data['operate_data']['is_cancel'] eq 1}} + + {{/if}} + {{if $data['operate_data']['is_pay'] eq 1}} + + {{/if}} + {{if $data['operate_data']['is_collect'] eq 1}} + + {{/if}} + {{if $data['operate_data']['is_comments'] eq 1}} + 评价 + {{/if}} + {{if $data['operate_data']['is_delete'] eq 1}} + + {{/if}} {{/if}} diff --git a/app/index/view/default/order/module/operate.html b/app/index/view/default/order/module/operate.html index 70cf2ce20..143e12998 100644 --- a/app/index/view/default/order/module/operate.html +++ b/app/index/view/default/order/module/operate.html @@ -4,34 +4,35 @@ 详情 -{{if in_array($module_data['status'], [0,1])}} - -{{/if}} -{{if in_array($module_data['status'], [1])}} - -{{/if}} -{{if in_array($module_data['status'], [3])}} - -{{/if}} -{{if in_array($module_data['status'], [4]) and $module_data['user_is_comments'] eq 0}} - - - 评论 - -{{/if}} - -{{if in_array($module_data['status'], [4,5,6])}} - +{{if !empty($module_data['operate_data'])}} + {{if $module_data['operate_data']['is_pay'] eq 1}} + + {{/if}} + {{if $module_data['operate_data']['is_collect'] eq 1}} + + {{/if}} + {{if $module_data['operate_data']['is_cancel'] eq 1}} + + {{/if}} + {{if $module_data['operate_data']['is_comments'] eq 1}} + + + 评论 + + {{/if}} + {{if $module_data['operate_data']['is_delete'] eq 1}} + + {{/if}} {{/if}} \ No newline at end of file diff --git a/app/index/view/default/order/module/pay_status.html b/app/index/view/default/order/module/pay_status.html index 2d2481c2b..18b27911b 100644 --- a/app/index/view/default/order/module/pay_status.html +++ b/app/index/view/default/order/module/pay_status.html @@ -3,9 +3,9 @@ {{if $module_data['pay_status'] eq 1}}

{{$module_data.pay_status_name}}

{{elseif $module_data['pay_status'] gt 1 /}} -

{{$module_data.pay_status_name}}

+

{{$module_data.pay_status_name}}

{{else /}} -

{{$module_data.pay_status_name}}

+

{{$module_data.pay_status_name}}

{{/if}} {{if !empty($module_data['is_under_line_text'])}}

{{$module_data.is_under_line_text}}

diff --git a/app/service/BuyService.php b/app/service/BuyService.php index 6e3cecb1f..c460043b5 100755 --- a/app/service/BuyService.php +++ b/app/service/BuyService.php @@ -1002,20 +1002,6 @@ class BuyService return $ret; } - // 支付方式 - $payment_id = 0; - $is_under_line = 0; - if(!empty($params['payment_id'])) - { - $payment = PaymentService::PaymentList(['where'=>['id'=>intval($params['payment_id'])]]); - if(empty($payment[0])) - { - return DataReturn('支付方式有误', -1); - } - $payment_id = $payment[0]['id']; - $is_under_line = in_array($payment[0]['payment'], MyConfig('shopxo.under_line_list')) ? 1 : 0; - } - // 清单商品 $params['is_order_submit'] = 1; $buy = self::BuyTypeGoodsList($params); @@ -1033,6 +1019,26 @@ class BuyService // 订单来源 $client_type = ApplicationClientType(); + // 支付方式 + $payment_id = 0; + $is_under_line = 0; + if(!empty($params['payment_id'])) + { + $payment = PaymentService::PaymentList(['where'=>['id'=>intval($params['payment_id'])]]); + if(empty($payment[0])) + { + return DataReturn('支付方式有误', -1); + } + $payment_id = $payment[0]['id']; + $is_under_line = in_array($payment[0]['payment'], MyConfig('shopxo.under_line_list')) ? 1 : 0; + + // 线下支付订单是否直接成功 + if($is_under_line == 1) + { + $order_status = 2; + } + } + // 开始事务 Db::startTrans(); @@ -1175,9 +1181,9 @@ class BuyService } // 库存扣除 - if($order['status'] == 1) + if(in_array($order['status'], [1,2])) { - $ret = self::OrderInventoryDeduct(['order_id'=>$order_id, 'order_data'=>$order]); + $ret = self::OrderInventoryDeduct(['order_id'=>$order_id, 'opt_type'=>'confirm']); if($ret['code'] != 0) { // 事务回滚 @@ -1731,15 +1737,11 @@ class BuyService 'error_msg' => '订单id有误', ], [ - 'checked_type' => 'empty', - 'key_name' => 'order_data', - 'error_msg' => '订单更新数据不能为空', + 'checked_type' => 'in', + 'key_name' => 'opt_type', + 'checked_data' => ['confirm', 'pay', 'delivery'], + 'error_msg' => '订单操作类型有误', ], - [ - 'checked_type' => 'is_array', - 'key_name' => 'order_data', - 'error_msg' => '订单更新数据有误', - ] ]; $ret = ParamsChecked($params, $p); if($ret !== true) @@ -1760,7 +1762,7 @@ class BuyService { // 订单确认成功 case 0 : - if($params['order_data']['status'] != 1) + if($params['opt_type'] != 'confirm') { return DataReturn('当前订单状态未操作确认-不扣除库存['.$params['order_id'].']', 0); } @@ -1768,7 +1770,7 @@ class BuyService // 订单支付成功 case 1 : - if($params['order_data']['status'] != 2) + if($params['opt_type'] != 'pay') { return DataReturn('当前订单状态未操作支付-不扣除库存['.$params['order_id'].']', 0); } @@ -1776,7 +1778,7 @@ class BuyService // 订单发货 case 2 : - if($params['order_data']['status'] != 3) + if($params['opt_type'] != 'delivery') { return DataReturn('当前订单状态未操作发货-不扣除库存['.$params['order_id'].']', 0); } @@ -1840,7 +1842,7 @@ class BuyService 'order_id' => $params['order_id'], 'order_detail_id' => $v['id'], 'goods_id' => $v['goods_id'], - 'order_status' => $params['order_data']['status'], + 'order_status' => Db::name('Order')->where(['id'=>$params['order_id']])->value('status'), 'original_inventory' => $goods['inventory'], 'new_inventory' => Db::name('Goods')->where(['id'=>$v['goods_id']])->value('inventory'), 'add_time' => time(), @@ -1895,6 +1897,7 @@ class BuyService // 订单状态 if(isset($params['order_data']['status'])) { + // 仅订单取消、关闭操作库存回滚 if(!in_array($params['order_data']['status'], [5,6])) { return DataReturn('当前订单状态不允许回滚库存['.$params['order_id'].'-'.$params['order_data']['status'].']', 0); diff --git a/app/service/OrderAftersaleService.php b/app/service/OrderAftersaleService.php index e6db39185..cfb31fb6d 100644 --- a/app/service/OrderAftersaleService.php +++ b/app/service/OrderAftersaleService.php @@ -987,9 +987,9 @@ class OrderAftersaleService } // 已完成订单、商品销量释放 - // 规则 订单支付、订单收货(默认) - $order_status = (MyC('common_goods_sales_count_inc_rules', 1) == 1) ? 4 : 2; - if($order['data']['status'] == $order_status && $aftersale['number'] > 0) + // 规则 0 订单支付、1 订单收货(默认) + $status = (MyC('common_goods_sales_count_inc_rules', 1) == 1) ? ($order['data']['status'] == 4) : ($order['data']['pay_status'] != 0); + if($status && $aftersale['number'] > 0) { if(!Db::name('Goods')->where(['id'=>intval($aftersale['goods_id'])])->dec('sales_count', $aftersale['number'])->update()) { diff --git a/app/service/OrderService.php b/app/service/OrderService.php index b131446d6..1811d0925 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -106,7 +106,8 @@ class OrderService { return DataReturn('订单不存在或已被删除', -1); } - if($order['status'] != 1) + $operate = self::OrderOperateData($order, 'user'); + if($operate['is_pay'] != 1) { $status_text = lang('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.'-'.$order['order_no'].']', -1); @@ -338,6 +339,13 @@ class OrderService if(in_array($payment['payment'], MyConfig('shopxo.under_line_list'))) { $ret['data']['is_payment_type'] = 1; + + // 线下支付处理 + $pay_ret = self::UserOrderPayUnderLine($pay_log['data']['log_no']); + if($pay_ret['code'] != 0) + { + return $pay_ret; + } } else { // 是否钱包支付 if($payment['payment'] == 'WalletPay') @@ -413,10 +421,11 @@ class OrderService { return DataReturn('资源不存在或已被删除', -1); } - if($order['status'] != 1) + $operate = self::OrderOperateData($order, 'admin'); + if($operate['is_pay'] != 1) { $status_text = lang('common_order_admin_status')[$order['status']]['name']; - return DataReturn('状态不可操作['.$status_text.']', -1); + return DataReturn('状态不可操作['.$status_text.'-'.$order['order_no'].']', -1); } // 订单支付前校验 @@ -582,24 +591,89 @@ class OrderService // 支付数据校验 $pay_name = 'payment\\'.$payment_name; - $ret = (new $pay_name($payment['config']))->Respond(array_merge(input('get.'), input('post.'))); - if(isset($ret['code']) && $ret['code'] == 0) + $pay_ret = (new $pay_name($payment['config']))->Respond(array_merge(input('get.'), input('post.'))); + if(isset($pay_ret['code']) && $pay_ret['code'] == 0) { - if(empty($ret['data']['out_trade_no'])) + if(empty($pay_ret['data']['out_trade_no'])) { return DataReturn('单号有误', -1); } // 获取订单信息 - $where = ['order_no'=>$ret['data']['out_trade_no'], 'is_delete_time'=>0, 'user_is_delete_time'=>0]; + $where = ['order_no'=>$pay_ret['data']['out_trade_no'], 'is_delete_time'=>0, 'user_is_delete_time'=>0]; $order = Db::name('Order')->where($where)->find(); - // 线下支付方式处理 + // 线下支付方式 if(in_array($payment_name, MyConfig('shopxo.under_line_list'))) { - return DataReturn('提交成功、待管理员确认', 0); + // 线下支付处理 + return self::UserOrderPayUnderLine($pay_ret['data']['out_trade_no']); + } + } + return $pay_ret; + } + + /** + * 用户线下支付订单 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-13 + * @desc description + * @param [string] $pay_log_no [订单支付日志单号] + */ + public static function UserOrderPayUnderLine($pay_log_no) + { + // 支付订单数据 + $pay_data = self::OrderPayLogValueList($pay_log_no); + if($pay_data['code'] != 0) + { + return $pay_data; + } + + // 订单支付日志已支付则直接返回 + if($pay_data['data']['pay_log_data']['status'] == 1) + { + return DataReturn('操作成功', 0); + } + + // 启动事务 + Db::startTrans(); + + // 捕获异常 + try { + // 更新订单状态 + $order_ids = array_column($pay_data['data']['order_list'], 'id'); + $upd_data = [ + 'status' => 2, + 'upd_time' => time(), + ]; + if(!Db::name('Order')->where(['id'=>$order_ids])->update($upd_data)) + { + throw new \Exception('订单更新失败'); + } + + // 循环处理订单 + foreach($pay_data['data']['order_list'] as $order) + { + if(!self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '用户线下支付', 0, '系统')) + { + throw new \Exception('订单日志添加失败['.$order['id'].']'); + } + } + + // 更改日志订单状态 + if(!Db::name('PayLog')->where(['log_no'=>$pay_log_no])->update(['status'=>1])) + { + throw new \Exception('日志订单更新失败'); } + + // 完成 + Db::commit(); + return DataReturn('操作成功', 0); + } catch(\Exception $e) { + Db::rollback(); + return DataReturn($e->getMessage(), -1); } - return $ret; } /** @@ -638,45 +712,33 @@ class OrderService return $pay_ret; } - // 获取支付日志订单 - $pay_log_data = Db::name('PayLog')->where(['log_no'=>$pay_ret['data']['out_trade_no']])->find(); - if(empty($pay_log_data)) - { - return DataReturn('日志订单有误', -1); - } - if($pay_log_data['status'] == 1) - { - return DataReturn('日志订单已支付、无需重复处理', 0); - } - - // 获取关联信息 - $pay_log_value = Db::name('PayLogValue')->where(['pay_log_id'=>$pay_log_data['id']])->column('business_id'); - if(empty($pay_log_value)) - { - return DataReturn('日志订单关联信息有误', -1); - } - - // 获取订单 - $order_list = Db::name('Order')->where(['id'=>$pay_log_value, 'status'=>1])->select()->toArray(); - if(empty($order_list)) + // 支付订单数据 + $pay_data = self::OrderPayLogValueList($pay_ret['data']['out_trade_no']); + if($pay_data['code'] == 0) { - return DataReturn('订单信息有误', -1); + // 订单支付日志已支付则直接返回 + if($pay_data['data']['pay_log_data']['status'] == 1) + { + return DataReturn('日志订单已支付、无需重复处理', 0); + } + } else { + return $pay_data; } // 支付金额是否小于订单金额 if(MyC('common_is_pay_price_must_max_equal', 0) == 1) { - if($pay_ret['data']['pay_price'] < $pay_log_data['total_price']) + if($pay_ret['data']['pay_price'] < $pay_data['data']['pay_log_data']['total_price']) { - return DataReturn('支付金额小于日志订单金额['.$pay_ret['data']['pay_price'].'<'.$pay_log_data['total_price'].']', -1); + return DataReturn('支付金额小于日志订单金额['.$pay_ret['data']['pay_price'].'<'.$pay_data['data']['pay_log_data']['total_price'].']', -1); } } // 支付处理 $pay_params = [ - 'order' => $order_list, + 'order' => $pay_data['data']['order_list'], 'payment' => $payment, - 'pay_log_data' => $pay_log_data, + 'pay_log_data' => $pay_data['data']['pay_log_data'], 'pay' => [ 'trade_no' => $pay_ret['data']['trade_no'], 'subject' => $pay_ret['data']['subject'], @@ -703,6 +765,45 @@ class OrderService return self::OrderPayHandle($pay_params); } + /** + * 订单支付日志订单列表 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-13 + * @desc description + * @param [string] $pay_log_no [支付日志订单号] + */ + public static function OrderPayLogValueList($pay_log_no) + { + // 获取支付日志订单 + $pay_log_data = Db::name('PayLog')->where(['log_no'=>$pay_log_no])->find(); + if(empty($pay_log_data)) + { + return DataReturn('日志订单有误', -1); + } + + // 获取关联信息 + $pay_log_value = Db::name('PayLogValue')->where(['pay_log_id'=>$pay_log_data['id']])->column('business_id'); + if(empty($pay_log_value)) + { + return DataReturn('日志订单关联信息有误', -1); + } + + // 获取订单 + $order_list = Db::name('Order')->where(['id'=>$pay_log_value, 'status'=>1])->select()->toArray(); + // 订单数据不存在、并且日志订单非支付状态则报错 + if(empty($order_list) && $pay_log_data['status'] != 1) + { + return DataReturn('订单信息有误', -1); + } + + return DataReturn('订单信息有误', 0, [ + 'pay_log_data' => $pay_log_data, + 'order_list' => $order_list, + ]); + } + /** * 订单支付处理 * @author Devil @@ -738,12 +839,10 @@ class OrderService // 循环处理 foreach($params['order'] as $order) { - if($order['status'] > 1) + // 订单已支付则不处理 + if($order['pay_status'] != 0) { - // 事务回滚 - Db::rollback(); - $status_text = lang('common_order_user_status')[$order['status']]['name']; - return DataReturn('状态不可操作['.$status_text.']', 0); + continue; } // 订单支付成功处理前钩子 @@ -767,7 +866,6 @@ class OrderService // 订单更新数据 $upd_data = [ - 'status' => 2, 'pay_status' => 1, 'pay_price' => $order['total_price'], 'payment_id' => $params['payment']['id'], @@ -775,10 +873,16 @@ class OrderService 'upd_time' => time(), ]; + // 避免先走订单、后走支付的逻辑 + if($order['status'] <= 1) + { + $upd_data['status'] = 2; + } + // 是否线下支付 $upd_data['is_under_line'] = in_array($params['payment']['payment'], MyConfig('shopxo.under_line_list')) ? 1 : 0; - // 更新订单状态 + // 更新订单 if(!Db::name('Order')->where(['id'=>$order['id']])->update($upd_data)) { // 事务回滚 @@ -787,15 +891,18 @@ class OrderService } // 添加状态日志 - if(!self::OrderHistoryAdd($order['id'], 2, $order['status'], '支付', 0, '系统')) + if(array_key_exists('status', $upd_data)) { - // 事务回滚 - Db::rollback(); - return DataReturn('订单日志添加失败['.$order['id'].']', -10); + if(!self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '支付', 0, '系统')) + { + // 事务回滚 + Db::rollback(); + return DataReturn('订单日志添加失败['.$order['id'].']', -10); + } } // 库存扣除 - $ret = BuyService::OrderInventoryDeduct(['order_id'=>$order['id'], 'order_data'=>$upd_data]); + $ret = BuyService::OrderInventoryDeduct(['order_id'=>$order['id'], 'opt_type'=>'pay']); if($ret['code'] != 0) { // 事务回滚 @@ -804,7 +911,7 @@ class OrderService } // 订单商品销量增加 - $ret = self::GoodsSalesCountInc(['order_id'=>$order['id'], 'order_status'=>2]); + $ret = self::GoodsSalesCountInc(['order_id'=>$order['id'], ' opt_type'=>'pay']); if($ret['code'] != 0) { // 事务回滚 @@ -1067,6 +1174,7 @@ class OrderService $keys = ArrayKeys($data); // 其它额外处理 + $is_operate = isset($params['is_operate']) ? intval($params['is_operate']) : 0; $is_items = isset($params['is_items']) ? intval($params['is_items']) : 1; $is_orderaftersale = isset($params['is_orderaftersale']) ? intval($params['is_orderaftersale']) : 0; $user_type = isset($params['user_type']) ? $params['user_type'] : 'user'; @@ -1254,6 +1362,12 @@ class OrderService $v['aftersale_first'] = self::OrderAftersaleFirst($v['id']); } + // 操作状态 + if($is_operate == 1 && isset($v['status']) && isset($v['pay_status'])) + { + $v['operate_data'] = self::OrderOperateData($v, $user_type); + } + // 订单处理后钩子 $hook_name = 'plugins_service_order_handle_end'; $ret = EventReturnHandle(MyEventTrigger($hook_name, [ @@ -1273,6 +1387,58 @@ class OrderService return DataReturn('success', 0, $data); } + /** + * 订单操作状态处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-13 + * @desc description + * @param [array] $data [订单数据] + * @param [string] $user_type [用户类型(user 用户、admin 管理员)] + */ + public static function OrderOperateData($data, $user_type = 'user') + { + $result = [ + // 确认 + 'is_confirm' => 0, + // 支付 + 'is_pay' => 0, + // 发货、取货 + 'is_delivery' => 0, + // 收货 + 'is_collect' => 0, + // 取消 + 'is_cancel' => 0, + // 删除 + 'is_delete' => 0, + // 评论 + 'is_comments' => 0, + ]; + if(isset($data['status']) && isset($data['pay_status'])) + { + // 管理员 + if($user_type == 'admin') + { + $result['is_confirm'] = ($data['status'] == 0) ? 1 : 0; + $result['is_pay'] = ($data['pay_status'] == 0 && !in_array($data['status'], [5,6])) ? 1 : 0; + $result['is_delivery'] = ($data['status'] == 2) ? 1 : 0; + $result['is_collect'] = ($data['status'] == 3) ? 1 : 0; + $result['is_cancel'] = (in_array($data['status'], [0,1]) || (in_array($data['status'], [2,3,4]) && $data['pay_status'] == 0)) ? 1 : 0; + $result['is_delete'] = (in_array($data['status'], [5,6]) && isset($data['is_delete_time']) && $data['is_delete_time'] == 0) ? 1 : 0; + + // 用户 + } else { + $result['is_pay'] = ($data['status'] == 1) ? 1 : 0; + $result['is_collect'] = ($data['status'] == 3) ? 1 : 0; + $result['is_cancel'] = (in_array($data['status'], [0,1]) || $data['status'] == 2 && $data['pay_status'] == 0) ? 1 : 0; + $result['is_comments'] = ($data['status'] == 4 && isset($data['user_is_comments']) && $data['user_is_comments'] == 0) ? 1 : 0; + $result['is_delete'] = (in_array($data['status'], [4,5,6]) && isset($data['user_is_delete_time']) && $data['user_is_delete_time'] == 0) ? 1 : 0; + } + } + return $result; + } + /** * 订单最新一条售后 * @author Devil @@ -1549,14 +1715,19 @@ class OrderService return DataReturn($ret, -1); } + // 用户类型 + $user_type = empty($params['user_type']) ? 'user' : $params['user_type']; + // 获取订单信息 $where = ['id'=>intval($params['id']), 'user_id'=>$params['user_id'], 'is_delete_time'=>0, 'user_is_delete_time'=>0]; - $order = Db::name('Order')->where($where)->field('id,status,user_id')->find(); + $order = Db::name('Order')->where($where)->field('id,status,pay_status,user_id')->find(); if(empty($order)) { return DataReturn('资源不存在或已被删除', -1); } - if(!in_array($order['status'], [0,1])) + // 有效订单情况下、如果未支付可以正常进行取消操作 + $operate = self::OrderOperateData($order, $user_type); + if($operate['is_cancel'] != 1) { $status_text = lang('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); @@ -1628,14 +1799,18 @@ class OrderService return DataReturn($ret, -1); } + // 用户类型 + $user_type = empty($params['user_type']) ? 'user' : $params['user_type']; + // 获取订单信息 $where = ['id'=>intval($params['id']), 'user_id'=>$params['user_id'], 'is_delete_time'=>0, 'user_is_delete_time'=>0]; - $order = Db::name('Order')->where($where)->field('id,status,user_id,order_model')->find(); + $order = Db::name('Order')->where($where)->field('id,status,pay_status,user_id,order_model')->find(); if(empty($order)) { return DataReturn('资源不存在或已被删除', -1); } - if(!in_array($order['status'], [2])) + $operate = self::OrderOperateData($order, $user_type); + if($operate['is_delivery'] != 1) { $status_text = lang('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); @@ -1705,7 +1880,7 @@ class OrderService if(Db::name('Order')->where($where)->update($upd_data)) { // 库存扣除 - $ret = BuyService::OrderInventoryDeduct(['order_id'=>$order['id'], 'order_data'=>$upd_data]); + $ret = BuyService::OrderInventoryDeduct(['order_id'=>$order['id'], 'opt_type'=>'delivery']); if($ret['code'] != 0) { // 事务回滚 @@ -1761,14 +1936,18 @@ class OrderService return DataReturn($ret, -1); } + // 用户类型 + $user_type = empty($params['user_type']) ? 'user' : $params['user_type']; + // 获取订单信息 $where = ['id'=>intval($params['id']), 'user_id'=>$params['user_id'], 'is_delete_time'=>0, 'user_is_delete_time'=>0]; - $order = Db::name('Order')->where($where)->field('id,status,user_id')->find(); + $order = Db::name('Order')->where($where)->field('id,status,pay_status,user_id')->find(); if(empty($order)) { return DataReturn('资源不存在或已被删除', -1); } - if(!in_array($order['status'], [3])) + $operate = self::OrderOperateData($order, $user_type); + if($operate['is_collect'] != 1) { $status_text = lang('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); @@ -1795,7 +1974,7 @@ class OrderService } // 订单商品销量增加 - $ret = self::GoodsSalesCountInc(['order_id'=>$order['id'], 'order_status'=>4]); + $ret = self::GoodsSalesCountInc(['order_id'=>$order['id'], 'opt_type'=>'collect']); if($ret['code'] != 0) { // 事务回滚 @@ -1851,16 +2030,20 @@ class OrderService return DataReturn($ret, -1); } + // 用户类型 + $user_type = empty($params['user_type']) ? 'user' : $params['user_type']; + // 获取订单信息 $where = ['id'=>intval($params['id']), 'user_id'=>$params['user_id'], 'is_delete_time'=>0, 'user_is_delete_time'=>0]; - $order = Db::name('Order')->where($where)->field('id,status,user_id')->find(); + $order = Db::name('Order')->where($where)->field('id,status,pay_status,user_id')->find(); if(empty($order)) { return DataReturn('资源不存在或已被删除', -1); } - if(!in_array($order['status'], [0])) + $operate = self::OrderOperateData($order, $user_type); + if($operate['is_confirm'] != 1) { - $status_text = lang('common_order_admin_status')[$order['status']]['name']; + $status_text = lang('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -1876,7 +2059,7 @@ class OrderService if(Db::name('Order')->where($where)->update($upd_data)) { // 库存扣除 - $ret = BuyService::OrderInventoryDeduct(['order_id'=>$params['id'], 'order_data'=>$upd_data]); + $ret = BuyService::OrderInventoryDeduct(['order_id'=>$params['id'], 'opt_type'=>'confirm']); if($ret['code'] != 0) { // 事务回滚 @@ -1938,7 +2121,8 @@ class OrderService } // 用户类型 - switch($params['user_type']) + $user_type = empty($params['user_type']) ? 'user' : $params['user_type']; + switch($user_type) { case 'admin' : $delete_field = 'is_delete_time'; @@ -1950,22 +2134,24 @@ class OrderService } if(empty($delete_field)) { - return DataReturn('用户类型有误['.$params['user_type'].']', -2); + return DataReturn('用户类型有误['.$user_type.']', -2); } // 获取订单信息 $where = ['id'=>intval($params['id']), 'user_id'=>$params['user_id'], $delete_field=>0]; - $order = Db::name('Order')->where($where)->field('id,status,user_id')->find(); + $order = Db::name('Order')->where($where)->field('id,status,pay_status,user_id,is_delete_time,user_is_delete_time')->find(); if(empty($order)) { return DataReturn('资源不存在或已被删除', -1); } - if(!in_array($order['status'], [4,5,6])) + $operate = self::OrderOperateData($order, $user_type); + if($operate['is_delete'] != 1) { $status_text = lang('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } + // 删除操作 $data = [ $delete_field => time(), 'upd_time' => time(), @@ -2110,10 +2296,11 @@ class OrderService 'error_msg' => '订单id有误', ], [ - 'checked_type' => 'isset', - 'key_name' => 'order_status', - 'error_msg' => '订单状态有误', - ] + 'checked_type' => 'in', + 'key_name' => 'opt_type', + 'checked_data' => ['pay', 'collect'], + 'error_msg' => '订单操作类型有误', + ], ]; $ret = ParamsChecked($params, $p); if($ret !== true) @@ -2125,14 +2312,14 @@ class OrderService $status = false; if(MyC('common_goods_sales_count_inc_rules', 1) == 1) { - // 订单收货责确认订单状态是收货状态 - if($params['order_status'] == 4) + // 订单收货 + if($params['opt_type'] == 'collect') { $status = true; } } else { - // 订单支付状态 - if($params['order_status'] == 2) + // 订单支付 + if($params['opt_type'] == 'pay') { $status = true; } -- Gitee From db6df611b3deee577876c31b9b8fdc3d0b436628 Mon Sep 17 00:00:00 2001 From: Devil Date: Fri, 13 Aug 2021 23:01:48 +0800 Subject: [PATCH 22/57] =?UTF-8?q?=E9=94=80=E9=87=8F=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/OrderService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/service/OrderService.php b/app/service/OrderService.php index 1811d0925..f847488be 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -911,7 +911,7 @@ class OrderService } // 订单商品销量增加 - $ret = self::GoodsSalesCountInc(['order_id'=>$order['id'], ' opt_type'=>'pay']); + $ret = self::GoodsSalesCountInc(['order_id'=>$order['id'], 'opt_type'=>'pay']); if($ret['code'] != 0) { // 事务回滚 -- Gitee From a0a71f1e58aca3e92b8c19744bdb29fe98626259 Mon Sep 17 00:00:00 2001 From: Devil Date: Sat, 14 Aug 2021 11:48:51 +0800 Subject: [PATCH 23/57] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/form/Goods.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/admin/form/Goods.php b/app/admin/form/Goods.php index bd1017e60..330f7dcb0 100644 --- a/app/admin/form/Goods.php +++ b/app/admin/form/Goods.php @@ -52,6 +52,7 @@ class Goods 'delete_url' => MyUrl('admin/goods/delete'), 'delete_key' => 'ids', 'detail_title' => '基础信息', + 'is_middle' => 0, ], // 表单配置 'form' => [ -- Gitee From f47bdb60c3d604041afaca12afd13ad8aceaa50a Mon Sep 17 00:00:00 2001 From: Devil Date: Sat, 14 Aug 2021 17:17:45 +0800 Subject: [PATCH 24/57] =?UTF-8?q?=E9=9D=99=E6=80=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Admin.php | 4 +- app/admin/controller/Answer.php | 4 +- app/admin/controller/Appcenternav.php | 4 +- app/admin/controller/Appconfig.php | 2 +- app/admin/controller/Apphomenav.php | 4 +- app/admin/controller/Appmini.php | 4 +- app/admin/controller/Articlecategory.php | 2 +- app/admin/controller/Brand.php | 2 +- app/admin/controller/Brandcategory.php | 2 +- app/admin/controller/Common.php | 2 +- app/admin/controller/Config.php | 8 +- app/admin/controller/Design.php | 4 +- app/admin/controller/Email.php | 2 +- app/admin/controller/Express.php | 2 +- app/admin/controller/Goods.php | 6 +- app/admin/controller/Goodscategory.php | 2 +- app/admin/controller/Goodscomments.php | 10 +- app/admin/controller/Goodsparamstemplate.php | 4 +- app/admin/controller/Orderaftersale.php | 2 +- app/admin/controller/Payment.php | 4 +- app/admin/controller/Power.php | 2 +- app/admin/controller/Quicknav.php | 4 +- app/admin/controller/Region.php | 2 +- app/admin/controller/Screeningprice.php | 2 +- app/admin/controller/Seo.php | 6 +- app/admin/controller/Site.php | 28 +- app/admin/controller/Slide.php | 6 +- app/admin/controller/User.php | 4 +- app/admin/form/Admin.php | 8 +- app/admin/form/Answer.php | 4 +- app/admin/form/Appcenternav.php | 12 +- app/admin/form/Apphomenav.php | 12 +- app/admin/form/Article.php | 4 +- app/admin/form/Brand.php | 2 +- app/admin/form/Customview.php | 8 +- app/admin/form/Design.php | 6 +- app/admin/form/Goods.php | 8 +- app/admin/form/Goodscomments.php | 12 +- app/admin/form/Goodsparamstemplate.php | 2 +- app/admin/form/Integrallog.php | 4 +- app/admin/form/Link.php | 4 +- app/admin/form/Message.php | 10 +- app/admin/form/Navigation.php | 8 +- app/admin/form/Order.php | 14 +- app/admin/form/Orderaftersale.php | 12 +- app/admin/form/Paylog.php | 4 +- app/admin/form/Quicknav.php | 10 +- app/admin/form/Refundlog.php | 2 +- app/admin/form/Role.php | 2 +- app/admin/form/Slide.php | 10 +- app/admin/form/User.php | 8 +- app/admin/form/Useraddress.php | 2 +- app/admin/form/Warehouse.php | 2 +- app/admin/form/Warehousegoods.php | 2 +- app/admin/view/default/admin/login_info.html | 6 +- app/admin/view/default/admin/save_info.html | 8 +- app/admin/view/default/config/index.html | 2 +- app/admin/view/default/lib/enable.html | 2 +- app/admin/view/default/lib/gender.html | 2 +- app/admin/view/default/lib/is_footer.html | 2 +- .../view/default/lib/is_full_screen.html | 2 +- app/admin/view/default/lib/is_header.html | 2 +- .../view/default/lib/is_new_window_open.html | 2 +- app/admin/view/default/lib/is_show.html | 2 +- app/admin/view/default/lib/user_status.html | 2 +- .../view/default/pluginsadmin/save_info.html | 6 +- app/admin/view/default/power/index.html | 4 +- app/admin/view/default/seo/index.html | 2 +- app/admin/view/default/user/save_info.html | 6 +- app/api/controller/Orderaftersale.php | 2 +- app/common.php | 39 +- app/index/controller/Common.php | 2 +- app/index/controller/Index.php | 4 +- app/index/controller/Orderaftersale.php | 2 +- app/index/controller/Personal.php | 2 +- app/index/form/Message.php | 8 +- app/index/form/Order.php | 16 +- app/index/form/Orderaftersale.php | 12 +- app/index/form/Userintegral.php | 4 +- app/index/view/default/config.json | 2 +- app/index/view/default/lib/enable.html | 2 +- app/index/view/default/lib/gender.html | 2 +- .../view/default/lib/is_new_window_open.html | 2 +- app/index/view/default/lib/is_show.html | 2 +- .../view/default/safety/login_pwd_info.html | 6 +- .../view/default/safety/new_mobile_info.html | 2 +- .../view/default/user/forget_pwd_info.html | 2 +- .../view/default/user/login_content.html | 4 +- app/index/view/default/user/reg_info.html | 10 +- app/layout/service/BaseLayout.php | 4 +- .../modal/modal_module_pages_select.html | 2 +- app/service/AdminService.php | 10 +- app/service/AppCenterNavService.php | 8 +- app/service/AppHomeNavService.php | 8 +- app/service/AppMiniService.php | 4 +- app/service/ConstService.php | 529 ++++++++++++++++++ app/service/CustomViewService.php | 2 +- app/service/GoodsCommentsService.php | 12 +- app/service/GoodsService.php | 6 +- app/service/IntegralService.php | 4 +- app/service/MessageService.php | 4 +- app/service/NavigationService.php | 2 +- app/service/OrderAftersaleService.php | 22 +- app/service/OrderService.php | 30 +- app/service/PaymentService.php | 4 +- app/service/QuickNavService.php | 8 +- app/service/RefundLogService.php | 2 +- app/service/SlideService.php | 10 +- app/service/StatisticalService.php | 4 +- app/service/UserService.php | 24 +- extend/base/Excel.php | 2 +- extend/base/Images.php | 5 +- public/core.php | 2 +- .../default/pages/common/copyright.axml | 2 +- .../baidu/default/pages/common/copyright.swan | 2 +- .../qq/default/pages/common/copyright.qml | 2 +- .../default/pages/common/copyright.ttml | 2 +- .../default/pages/common/copyright.wxml | 2 +- 118 files changed, 870 insertions(+), 323 deletions(-) create mode 100644 app/service/ConstService.php diff --git a/app/admin/controller/Admin.php b/app/admin/controller/Admin.php index ca1aaccc7..02dba223c 100755 --- a/app/admin/controller/Admin.php +++ b/app/admin/controller/Admin.php @@ -160,8 +160,8 @@ class Admin extends Common MyViewAssign('role_list', $role['data']); MyViewAssign('id', isset($params['id']) ? $params['id'] : 0); - MyViewAssign('common_gender_list', lang('common_gender_list')); - MyViewAssign('common_admin_status_list', lang('common_admin_status_list')); + MyViewAssign('common_gender_list', MyConst('common_gender_list')); + MyViewAssign('common_admin_status_list', MyConst('common_admin_status_list')); // 管理员编辑页面钩子 $hook_name = 'plugins_view_admin_admin_save'; diff --git a/app/admin/controller/Answer.php b/app/admin/controller/Answer.php index 76781c636..09be19a46 100755 --- a/app/admin/controller/Answer.php +++ b/app/admin/controller/Answer.php @@ -153,8 +153,8 @@ class Answer extends Common MyViewAssign('data', $data); // 静态数据 - MyViewAssign('common_is_show_list', lang('common_is_show_list')); - MyViewAssign('common_is_text_list', lang('common_is_text_list')); + MyViewAssign('common_is_show_list', MyConst('common_is_show_list')); + MyViewAssign('common_is_text_list', MyConst('common_is_text_list')); // 参数 unset($params['id']); diff --git a/app/admin/controller/Appcenternav.php b/app/admin/controller/Appcenternav.php index bef6218b9..cdd17f8e0 100755 --- a/app/admin/controller/Appcenternav.php +++ b/app/admin/controller/Appcenternav.php @@ -136,8 +136,8 @@ class AppCenterNav extends Common } // 静态数据 - MyViewAssign('common_platform_type', lang('common_platform_type')); - MyViewAssign('common_app_event_type', lang('common_app_event_type')); + MyViewAssign('common_platform_type', MyConst('common_platform_type')); + MyViewAssign('common_app_event_type', MyConst('common_app_event_type')); // 编辑器文件存放地址 MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('app_center_nav')); diff --git a/app/admin/controller/Appconfig.php b/app/admin/controller/Appconfig.php index ee15ff935..7e9108a46 100755 --- a/app/admin/controller/Appconfig.php +++ b/app/admin/controller/Appconfig.php @@ -53,7 +53,7 @@ class AppConfig extends Common MyViewAssign('data', ConfigService::ConfigList()); // 是否 - MyViewAssign('common_is_text_list', lang('common_is_text_list')); + MyViewAssign('common_is_text_list', MyConst('common_is_text_list')); // 导航/视图 $nav_type = input('nav_type', 'base'); diff --git a/app/admin/controller/Apphomenav.php b/app/admin/controller/Apphomenav.php index f4cbc7e89..2d9865a08 100755 --- a/app/admin/controller/Apphomenav.php +++ b/app/admin/controller/Apphomenav.php @@ -136,8 +136,8 @@ class AppHomeNav extends Common } // 静态数据 - MyViewAssign('common_platform_type', lang('common_platform_type')); - MyViewAssign('common_app_event_type', lang('common_app_event_type')); + MyViewAssign('common_platform_type', MyConst('common_platform_type')); + MyViewAssign('common_app_event_type', MyConst('common_app_event_type')); // 编辑器文件存放地址 MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('app_nav')); diff --git a/app/admin/controller/Appmini.php b/app/admin/controller/Appmini.php index 1e2c00153..22f202e51 100755 --- a/app/admin/controller/Appmini.php +++ b/app/admin/controller/Appmini.php @@ -159,10 +159,10 @@ class Appmini extends Common MyViewAssign('store_theme_url', StoreService::StoreThemeUrl()); // 小程序平台 - MyViewAssign('common_appmini_type', lang('common_appmini_type')); + MyViewAssign('common_appmini_type', MyConst('common_appmini_type')); // 是否 - MyViewAssign('common_is_text_list', lang('common_is_text_list')); + MyViewAssign('common_is_text_list', MyConst('common_is_text_list')); // 基础导航 $base_nav = [ diff --git a/app/admin/controller/Articlecategory.php b/app/admin/controller/Articlecategory.php index 27f39b9d9..9971d9b7b 100755 --- a/app/admin/controller/Articlecategory.php +++ b/app/admin/controller/Articlecategory.php @@ -50,7 +50,7 @@ class ArticleCategory extends Common public function Index() { // 是否启用 - MyViewAssign('common_is_enable_list', lang('common_is_enable_list')); + MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list')); return MyView(); } diff --git a/app/admin/controller/Brand.php b/app/admin/controller/Brand.php index 2a91b4a1d..a59af4c5d 100755 --- a/app/admin/controller/Brand.php +++ b/app/admin/controller/Brand.php @@ -137,7 +137,7 @@ class Brand extends Common } // 是否启用 - MyViewAssign('common_is_enable_list', lang('common_is_enable_list')); + MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list')); // 品牌分类 $brand_category = BrandCategoryService::BrandCategoryList(['field'=>'id,name']); diff --git a/app/admin/controller/Brandcategory.php b/app/admin/controller/Brandcategory.php index 854ac28a3..e09b99d44 100755 --- a/app/admin/controller/Brandcategory.php +++ b/app/admin/controller/Brandcategory.php @@ -50,7 +50,7 @@ class BrandCategory extends Common public function Index() { // 是否启用 - MyViewAssign('common_is_enable_list', lang('common_is_enable_list')); + MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list')); return MyView(); } diff --git a/app/admin/controller/Common.php b/app/admin/controller/Common.php index 23658af51..6642db5eb 100755 --- a/app/admin/controller/Common.php +++ b/app/admin/controller/Common.php @@ -178,7 +178,7 @@ class Common extends BaseController MyViewAssign('module_js', file_exists(ROOT_PATH.'static'.DS.$module_js) ? $module_js : ''); // 价格正则 - MyViewAssign('default_price_regex', lang('common_regex_price')); + MyViewAssign('default_price_regex', MyConst('common_regex_price')); // 附件host地址 MyViewAssign('attachment_host', SystemBaseService::AttachmentHost()); diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php index 9260e4d52..729457012 100755 --- a/app/admin/controller/Config.php +++ b/app/admin/controller/Config.php @@ -50,10 +50,10 @@ class Config extends Common public function Index() { // 静态数据 - MyViewAssign('common_excel_charset_list', lang('common_excel_charset_list')); - MyViewAssign('common_is_enable_list', lang('common_is_enable_list')); - MyViewAssign('common_login_type_list', lang('common_login_type_list')); - MyViewAssign('common_close_open_list', lang('common_close_open_list')); + MyViewAssign('common_excel_charset_list', MyConst('common_excel_charset_list')); + MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list')); + MyViewAssign('common_login_type_list', MyConst('common_login_type_list')); + MyViewAssign('common_close_open_list', MyConst('common_close_open_list')); // 配置信息 MyViewAssign('data', ConfigService::ConfigList()); diff --git a/app/admin/controller/Design.php b/app/admin/controller/Design.php index f46bc1127..8ce5f70af 100644 --- a/app/admin/controller/Design.php +++ b/app/admin/controller/Design.php @@ -151,8 +151,8 @@ class Design extends Common MyViewAssign('many_images_view_list_show_style', BaseLayout::$many_images_view_list_show_style); // 首页商品排序规则 - MyViewAssign('goods_order_by_type_list', lang('goods_order_by_type_list')); - MyViewAssign('goods_order_by_rule_list', lang('goods_order_by_rule_list')); + MyViewAssign('goods_order_by_type_list', MyConst('goods_order_by_type_list')); + MyViewAssign('goods_order_by_rule_list', MyConst('goods_order_by_rule_list')); // 加载布局样式+管理 MyViewAssign('is_load_layout', 1); diff --git a/app/admin/controller/Email.php b/app/admin/controller/Email.php index bdf950ce5..d176fea79 100755 --- a/app/admin/controller/Email.php +++ b/app/admin/controller/Email.php @@ -54,7 +54,7 @@ class Email extends Common $type = input('type', 'email'); // 静态数据 - MyViewAssign('common_is_text_list', lang('common_is_text_list')); + MyViewAssign('common_is_text_list', MyConst('common_is_text_list')); // 导航 MyViewAssign('nav_type', $type); diff --git a/app/admin/controller/Express.php b/app/admin/controller/Express.php index 197ba20ac..6b8135053 100755 --- a/app/admin/controller/Express.php +++ b/app/admin/controller/Express.php @@ -51,7 +51,7 @@ class Express extends Common public function Index() { // 是否启用 - MyViewAssign('common_is_enable_list', lang('common_is_enable_list')); + MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list')); // 编辑器文件存放地址 MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('express')); diff --git a/app/admin/controller/Goods.php b/app/admin/controller/Goods.php index 561e404cf..7d74643a5 100755 --- a/app/admin/controller/Goods.php +++ b/app/admin/controller/Goods.php @@ -124,7 +124,7 @@ class Goods extends Common $parameters = GoodsService::GoodsEditParameters($data['id']); // 商品参数类型 - MyViewAssign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list')); + MyViewAssign('common_goods_parameters_type_list', MyConst('common_goods_parameters_type_list')); MyViewAssign('parameters', $parameters); } @@ -195,12 +195,12 @@ class Goods extends Common MyViewAssign('goods_specifications_extends', $goods_spec_extends['data']); // 站点类型 - MyViewAssign('common_site_type_list', lang('common_site_type_list')); + MyViewAssign('common_site_type_list', MyConst('common_site_type_list')); // 当前系统设置的站点类型 MyViewAssign('common_site_type', SystemBaseService::SiteTypeValue()); // 商品参数类型 - MyViewAssign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list')); + MyViewAssign('common_goods_parameters_type_list', MyConst('common_goods_parameters_type_list')); // 商品参数模板 $data_params = array( diff --git a/app/admin/controller/Goodscategory.php b/app/admin/controller/Goodscategory.php index 2955bc340..1e14e44e4 100755 --- a/app/admin/controller/Goodscategory.php +++ b/app/admin/controller/Goodscategory.php @@ -51,7 +51,7 @@ class GoodsCategory extends Common public function Index() { // 静态数据 - MyViewAssign('common_is_text_list', lang('common_is_text_list')); + MyViewAssign('common_is_text_list', MyConst('common_is_text_list')); // 商品分类 MyViewAssign('goods_category_list', GoodsService::GoodsCategoryAll()); diff --git a/app/admin/controller/Goodscomments.php b/app/admin/controller/Goodscomments.php index 2611c4dac..6c0f426b3 100644 --- a/app/admin/controller/Goodscomments.php +++ b/app/admin/controller/Goodscomments.php @@ -105,7 +105,7 @@ class Goodscomments extends Common $data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0]; MyViewAssign('data', $data); - MyViewAssign('common_goods_comments_rating_list', lang('common_goods_comments_rating_list')); + MyViewAssign('common_goods_comments_rating_list', MyConst('common_goods_comments_rating_list')); } return MyView(); } @@ -139,10 +139,10 @@ class Goodscomments extends Common MyViewAssign('data', $data); // 静态数据 - MyViewAssign('common_is_show_list', lang('common_is_show_list')); - MyViewAssign('common_is_text_list', lang('common_is_text_list')); - MyViewAssign('common_goods_comments_rating_list', lang('common_goods_comments_rating_list')); - MyViewAssign('common_goods_comments_business_type_list', lang('common_goods_comments_business_type_list')); + MyViewAssign('common_is_show_list', MyConst('common_is_show_list')); + MyViewAssign('common_is_text_list', MyConst('common_is_text_list')); + MyViewAssign('common_goods_comments_rating_list', MyConst('common_goods_comments_rating_list')); + MyViewAssign('common_goods_comments_business_type_list', MyConst('common_goods_comments_business_type_list')); // 参数 unset($params['id']); diff --git a/app/admin/controller/Goodsparamstemplate.php b/app/admin/controller/Goodsparamstemplate.php index cb31850f8..6e13dd0ae 100755 --- a/app/admin/controller/Goodsparamstemplate.php +++ b/app/admin/controller/Goodsparamstemplate.php @@ -109,7 +109,7 @@ class GoodsParamsTemplate extends Common MyViewAssign('data', $data); // 商品参数类型 - MyViewAssign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list')); + MyViewAssign('common_goods_parameters_type_list', MyConst('common_goods_parameters_type_list')); // 参数配置 MyViewAssign('parameters', empty($data['config_data']) ? [] : $data['config_data']); @@ -146,7 +146,7 @@ class GoodsParamsTemplate extends Common } // 商品参数类型 - MyViewAssign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list')); + MyViewAssign('common_goods_parameters_type_list', MyConst('common_goods_parameters_type_list')); // 参数配置 MyViewAssign('parameters', empty($data['config_data']) ? [] : $data['config_data']); diff --git a/app/admin/controller/Orderaftersale.php b/app/admin/controller/Orderaftersale.php index 6dd6902fe..49efd3f2a 100644 --- a/app/admin/controller/Orderaftersale.php +++ b/app/admin/controller/Orderaftersale.php @@ -76,7 +76,7 @@ class Orderaftersale extends Common $ret = OrderAftersaleService::OrderAftersaleList($data_params); // 静态数据 - MyViewAssign('common_order_aftersale_refundment_list', lang('common_order_aftersale_refundment_list')); + MyViewAssign('common_order_aftersale_refundment_list', MyConst('common_order_aftersale_refundment_list')); // 基础参数赋值 MyViewAssign('params', $this->data_request); diff --git a/app/admin/controller/Payment.php b/app/admin/controller/Payment.php index 7507ea7b3..8509e03a1 100755 --- a/app/admin/controller/Payment.php +++ b/app/admin/controller/Payment.php @@ -59,7 +59,7 @@ class Payment extends Common MyViewAssign('cannot_deleted_list', PaymentService::$cannot_deleted_list); // 适用平台 - MyViewAssign('common_platform_type', lang('common_platform_type')); + MyViewAssign('common_platform_type', MyConst('common_platform_type')); // 应用商店 MyViewAssign('store_payment_url', StoreService::StorePaymentUrl()); @@ -102,7 +102,7 @@ class Payment extends Common } // 适用平台 - MyViewAssign('common_platform_type', lang('common_platform_type')); + MyViewAssign('common_platform_type', MyConst('common_platform_type')); // 参数 MyViewAssign('params', $params); diff --git a/app/admin/controller/Power.php b/app/admin/controller/Power.php index 1813a3db8..7d667aa6f 100755 --- a/app/admin/controller/Power.php +++ b/app/admin/controller/Power.php @@ -57,7 +57,7 @@ class Power extends Common $data = AdminPowerService::PowerList($data_params); MyViewAssign('data', $data); - MyViewAssign('common_is_show_list', lang('common_is_show_list')); + MyViewAssign('common_is_show_list', MyConst('common_is_show_list')); return MyView(); } diff --git a/app/admin/controller/Quicknav.php b/app/admin/controller/Quicknav.php index 14c14f5c2..37f73979e 100755 --- a/app/admin/controller/Quicknav.php +++ b/app/admin/controller/Quicknav.php @@ -137,8 +137,8 @@ class QuickNav extends Common MyViewAssign('data', $data); // 静态数据 - MyViewAssign('common_platform_type', lang('common_platform_type')); - MyViewAssign('common_app_event_type', lang('common_app_event_type')); + MyViewAssign('common_platform_type', MyConst('common_platform_type')); + MyViewAssign('common_app_event_type', MyConst('common_app_event_type')); // 参数 MyViewAssign('params', $params); diff --git a/app/admin/controller/Region.php b/app/admin/controller/Region.php index 4b2f4c9a5..d93bcf59c 100755 --- a/app/admin/controller/Region.php +++ b/app/admin/controller/Region.php @@ -50,7 +50,7 @@ class Region extends Common $this->IsPower(); // 是否启用 - MyViewAssign('common_is_enable_list', lang('common_is_enable_list')); + MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list')); return MyView(); } diff --git a/app/admin/controller/Screeningprice.php b/app/admin/controller/Screeningprice.php index ad8f17570..de41a3fc9 100755 --- a/app/admin/controller/Screeningprice.php +++ b/app/admin/controller/Screeningprice.php @@ -50,7 +50,7 @@ class ScreeningPrice extends Common public function Index() { // 是否启用 - MyViewAssign('common_is_enable_list', lang('common_is_enable_list')); + MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list')); return MyView(); } diff --git a/app/admin/controller/Seo.php b/app/admin/controller/Seo.php index 7b51073ef..ecc61bab2 100755 --- a/app/admin/controller/Seo.php +++ b/app/admin/controller/Seo.php @@ -50,13 +50,13 @@ class Seo extends Common public function Index() { // url模式 - MyViewAssign('seo_url_model_list', lang('seo_url_model_list')); + MyViewAssign('seo_url_model_list', MyConst('seo_url_model_list')); // 文章标题seo方案 - MyViewAssign('seo_article_browser_list', lang('seo_article_browser_list')); + MyViewAssign('seo_article_browser_list', MyConst('seo_article_browser_list')); // 频道标题seo方案 - MyViewAssign('seo_channel_browser_list', lang('seo_channel_browser_list')); + MyViewAssign('seo_channel_browser_list', MyConst('seo_channel_browser_list')); // 配置信息 MyViewAssign('data', ConfigService::ConfigList()); diff --git a/app/admin/controller/Site.php b/app/admin/controller/Site.php index 3a05842d6..34ddbba5a 100755 --- a/app/admin/controller/Site.php +++ b/app/admin/controller/Site.php @@ -154,44 +154,44 @@ class Site extends Common MyViewAssign('view_type', $this->view_type); // 时区 - MyViewAssign('site_timezone_list', lang('site_timezone_list')); + MyViewAssign('site_timezone_list', MyConst('site_timezone_list')); // 关闭开启 - MyViewAssign('common_close_open_list', lang('common_close_open_list')); + MyViewAssign('common_close_open_list', MyConst('common_close_open_list')); // 登录方式 - MyViewAssign('common_login_type_list', lang('common_login_type_list')); + MyViewAssign('common_login_type_list', MyConst('common_login_type_list')); // 用户注册类型列表 - MyViewAssign('common_user_reg_type_list', lang('common_user_reg_type_list')); + MyViewAssign('common_user_reg_type_list', MyConst('common_user_reg_type_list')); // 图片验证码规则 - MyViewAssign('site_images_verify_rules_list', lang('site_images_verify_rules_list')); + MyViewAssign('site_images_verify_rules_list', MyConst('site_images_verify_rules_list')); // 热门搜索关键字 - MyViewAssign('common_search_keywords_type_list', lang('common_search_keywords_type_list')); + MyViewAssign('common_search_keywords_type_list', MyConst('common_search_keywords_type_list')); // 是否 - MyViewAssign('common_is_text_list', lang('common_is_text_list')); + MyViewAssign('common_is_text_list', MyConst('common_is_text_list')); // 站点类型 - MyViewAssign('common_site_type_list', lang('common_site_type_list')); + MyViewAssign('common_site_type_list', MyConst('common_site_type_list')); // 扣除库存规则 - MyViewAssign('common_deduction_inventory_rules_list', lang('common_deduction_inventory_rules_list')); + MyViewAssign('common_deduction_inventory_rules_list', MyConst('common_deduction_inventory_rules_list')); // 增加销量规则 - MyViewAssign('common_sales_count_inc_rules_list', lang('common_sales_count_inc_rules_list')); + MyViewAssign('common_sales_count_inc_rules_list', MyConst('common_sales_count_inc_rules_list')); // 首页商品排序规则 - MyViewAssign('goods_order_by_type_list', lang('goods_order_by_type_list')); - MyViewAssign('goods_order_by_rule_list', lang('goods_order_by_rule_list')); + MyViewAssign('goods_order_by_type_list', MyConst('goods_order_by_type_list')); + MyViewAssign('goods_order_by_rule_list', MyConst('goods_order_by_rule_list')); // 首页楼层数据类型 - MyViewAssign('common_site_floor_data_type_list', lang('common_site_floor_data_type_list')); + MyViewAssign('common_site_floor_data_type_list', MyConst('common_site_floor_data_type_list')); // 搜索参数类型 - MyViewAssign('common_goods_parameters_type_list', lang('common_goods_parameters_type_list')); + MyViewAssign('common_goods_parameters_type_list', MyConst('common_goods_parameters_type_list')); // 主导航 MyViewAssign('second_nav_list', [ diff --git a/app/admin/controller/Slide.php b/app/admin/controller/Slide.php index 3a5cd2304..4497a55ab 100755 --- a/app/admin/controller/Slide.php +++ b/app/admin/controller/Slide.php @@ -136,9 +136,9 @@ class Slide extends Common } // 静态资源 - MyViewAssign('common_is_enable_list', lang('common_is_enable_list')); - MyViewAssign('common_platform_type', lang('common_platform_type')); - MyViewAssign('common_app_event_type', lang('common_app_event_type')); + MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list')); + MyViewAssign('common_platform_type', MyConst('common_platform_type')); + MyViewAssign('common_app_event_type', MyConst('common_app_event_type')); // 编辑器文件存放地址 MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue('slide')); diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index e39942110..04272812f 100755 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -129,7 +129,7 @@ class User extends Common $data = UserService::UserList($data_params); // Excel驱动导出数据 - $excel = new \base\Excel(array('filename'=>'user', 'title'=>lang('excel_user_title_list'), 'data'=>$data['data'], 'msg'=>'没有相关数据')); + $excel = new \base\Excel(array('filename'=>'user', 'title'=>MyConst('excel_user_title_list'), 'data'=>$data['data'], 'msg'=>'没有相关数据')); return $excel->Export(); } @@ -178,7 +178,7 @@ class User extends Common ])); // 性别 - MyViewAssign('common_gender_list', lang('common_gender_list')); + MyViewAssign('common_gender_list', MyConst('common_gender_list')); // 数据 unset($params['id']); diff --git a/app/admin/form/Admin.php b/app/admin/form/Admin.php index 876f4b9a6..7d1d957e5 100644 --- a/app/admin/form/Admin.php +++ b/app/admin/form/Admin.php @@ -73,12 +73,12 @@ class Admin 'view_type' => 'field', 'view_key' => 'status', 'view_data_key' => 'name', - 'view_data' => lang('common_admin_status_list'), + 'view_data' => MyConst('common_admin_status_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_admin_status_list'), + 'data' => MyConst('common_admin_status_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -89,12 +89,12 @@ class Admin 'view_type' => 'field', 'view_key' => 'gender', 'view_data_key' => 'name', - 'view_data' => lang('common_gender_list'), + 'view_data' => MyConst('common_gender_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_gender_list'), + 'data' => MyConst('common_gender_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Answer.php b/app/admin/form/Answer.php index 471897a07..ccfa37d1f 100644 --- a/app/admin/form/Answer.php +++ b/app/admin/form/Answer.php @@ -124,7 +124,7 @@ class Answer 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_show_list'), + 'data' => MyConst('common_is_show_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -140,7 +140,7 @@ class Answer 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Appcenternav.php b/app/admin/form/Appcenternav.php index d044ac77f..9db6039df 100644 --- a/app/admin/form/Appcenternav.php +++ b/app/admin/form/Appcenternav.php @@ -70,12 +70,12 @@ class AppCenterNav 'view_type' => 'field', 'view_key' => 'platform', 'view_data_key' => 'name', - 'view_data' => lang('common_platform_type'), + 'view_data' => MyConst('common_platform_type'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_platform_type'), + 'data' => MyConst('common_platform_type'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -92,13 +92,13 @@ class AppCenterNav 'view_type' => 'field', 'view_key' => 'event_type', 'view_data_key' => 'name', - 'view_data' => lang('common_app_event_type'), + 'view_data' => MyConst('common_app_event_type'), 'grid_size' => 'sm', 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_app_event_type'), + 'data' => MyConst('common_app_event_type'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -126,7 +126,7 @@ class AppCenterNav 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -142,7 +142,7 @@ class AppCenterNav 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Apphomenav.php b/app/admin/form/Apphomenav.php index 2003d2d06..443bf444d 100644 --- a/app/admin/form/Apphomenav.php +++ b/app/admin/form/Apphomenav.php @@ -70,12 +70,12 @@ class AppHomeNav 'view_type' => 'field', 'view_key' => 'platform', 'view_data_key' => 'name', - 'view_data' => lang('common_platform_type'), + 'view_data' => MyConst('common_platform_type'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_platform_type'), + 'data' => MyConst('common_platform_type'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -92,13 +92,13 @@ class AppHomeNav 'view_type' => 'field', 'view_key' => 'event_type', 'view_data_key' => 'name', - 'view_data' => lang('common_app_event_type'), + 'view_data' => MyConst('common_app_event_type'), 'grid_size' => 'sm', 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_app_event_type'), + 'data' => MyConst('common_app_event_type'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -126,7 +126,7 @@ class AppHomeNav 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -142,7 +142,7 @@ class AppHomeNav 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Article.php b/app/admin/form/Article.php index 6269b698e..64c39bb3a 100644 --- a/app/admin/form/Article.php +++ b/app/admin/form/Article.php @@ -106,7 +106,7 @@ class Article 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -122,7 +122,7 @@ class Article 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Brand.php b/app/admin/form/Brand.php index 1ee989493..8beb8a0f8 100644 --- a/app/admin/form/Brand.php +++ b/app/admin/form/Brand.php @@ -123,7 +123,7 @@ class Brand 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Customview.php b/app/admin/form/Customview.php index 41c51f980..dc5ce0d9b 100644 --- a/app/admin/form/Customview.php +++ b/app/admin/form/Customview.php @@ -79,7 +79,7 @@ class CustomView 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -95,7 +95,7 @@ class CustomView 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -111,7 +111,7 @@ class CustomView 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -127,7 +127,7 @@ class CustomView 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Design.php b/app/admin/form/Design.php index 3d30f93fc..79be7c28f 100644 --- a/app/admin/form/Design.php +++ b/app/admin/form/Design.php @@ -88,7 +88,7 @@ class Design 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -104,7 +104,7 @@ class Design 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -120,7 +120,7 @@ class Design 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Goods.php b/app/admin/form/Goods.php index 330f7dcb0..cf756fa7d 100644 --- a/app/admin/form/Goods.php +++ b/app/admin/form/Goods.php @@ -161,7 +161,7 @@ class Goods 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_shelves_list'), + 'data' => MyConst('common_is_shelves_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -177,7 +177,7 @@ class Goods 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -188,12 +188,12 @@ class Goods 'view_type' => 'field', 'view_key' => 'site_type', 'view_data_key' => 'name', - 'view_data' => lang('common_site_type_list'), + 'view_data' => MyConst('common_site_type_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_site_type_list'), + 'data' => MyConst('common_site_type_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Goodscomments.php b/app/admin/form/Goodscomments.php index 50a102cf5..41c073f49 100644 --- a/app/admin/form/Goodscomments.php +++ b/app/admin/form/Goodscomments.php @@ -91,13 +91,13 @@ class GoodsComments 'view_type' => 'field', 'view_key' => 'business_type', 'view_data_key' => 'name', - 'view_data' => lang('common_goods_comments_business_type_list'), + 'view_data' => MyConst('common_goods_comments_business_type_list'), 'width' => 120, 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_goods_comments_business_type_list'), + 'data' => MyConst('common_goods_comments_business_type_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -130,7 +130,7 @@ class GoodsComments 'form_type' => 'select', 'form_name' => 'rating', 'where_type' => 'in', - 'data' => lang('common_goods_comments_rating_list'), + 'data' => MyConst('common_goods_comments_rating_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -158,7 +158,7 @@ class GoodsComments 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_shelves_list'), + 'data' => MyConst('common_is_shelves_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -174,7 +174,7 @@ class GoodsComments 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -190,7 +190,7 @@ class GoodsComments 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Goodsparamstemplate.php b/app/admin/form/Goodsparamstemplate.php index e677fe06d..0297489cf 100644 --- a/app/admin/form/Goodsparamstemplate.php +++ b/app/admin/form/Goodsparamstemplate.php @@ -77,7 +77,7 @@ class GoodsParamsTemplate 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Integrallog.php b/app/admin/form/Integrallog.php index 21467d912..a72c67439 100644 --- a/app/admin/form/Integrallog.php +++ b/app/admin/form/Integrallog.php @@ -64,12 +64,12 @@ class IntegralLog 'view_type' => 'field', 'view_key' => 'type', 'view_data_key' => 'name', - 'view_data' => lang('common_integral_log_type_list'), + 'view_data' => MyConst('common_integral_log_type_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_integral_log_type_list'), + 'data' => MyConst('common_integral_log_type_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Link.php b/app/admin/form/Link.php index 7e7930216..c18625b7c 100644 --- a/app/admin/form/Link.php +++ b/app/admin/form/Link.php @@ -101,7 +101,7 @@ class Link 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -117,7 +117,7 @@ class Link 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Message.php b/app/admin/form/Message.php index e08e61b24..45a0ae500 100644 --- a/app/admin/form/Message.php +++ b/app/admin/form/Message.php @@ -77,12 +77,12 @@ class Message 'view_type' => 'field', 'view_key' => 'type', 'view_data_key' => 'name', - 'view_data' => lang('common_message_type_list'), + 'view_data' => MyConst('common_message_type_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_message_type_list'), + 'data' => MyConst('common_message_type_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -128,12 +128,12 @@ class Message 'view_type' => 'field', 'view_key' => 'is_read', 'view_data_key' => 'name', - 'view_data' => lang('common_is_read_list'), + 'view_data' => MyConst('common_is_read_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_read_list'), + 'data' => MyConst('common_is_read_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -148,7 +148,7 @@ class Message 'form_type' => 'select', 'where_type' => 'in', 'form_name' => 'user_is_delete_time', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'where_type_custom' => 'WhereTypeUserIsDelete', diff --git a/app/admin/form/Navigation.php b/app/admin/form/Navigation.php index 8329e56a3..ee2dc286c 100644 --- a/app/admin/form/Navigation.php +++ b/app/admin/form/Navigation.php @@ -76,12 +76,12 @@ class Navigation 'view_type' => 'field', 'view_key' => 'data_type', 'view_data_key' => 'name', - 'view_data' => lang('common_nav_type_list'), + 'view_data' => MyConst('common_nav_type_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_nav_type_list'), + 'data' => MyConst('common_nav_type_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -98,7 +98,7 @@ class Navigation 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_show_list'), + 'data' => MyConst('common_is_show_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -114,7 +114,7 @@ class Navigation 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Order.php b/app/admin/form/Order.php index c09cd425c..8f20b01b9 100644 --- a/app/admin/form/Order.php +++ b/app/admin/form/Order.php @@ -88,7 +88,7 @@ class Order 'form_type' => 'select', 'form_name' => 'status', 'where_type' => 'in', - 'data' => lang('common_order_admin_status'), + 'data' => MyConst('common_order_admin_status'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -103,7 +103,7 @@ class Order 'form_type' => 'select', 'form_name' => 'pay_status', 'where_type' => 'in', - 'data' => lang('common_order_pay_status'), + 'data' => MyConst('common_order_pay_status'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -159,12 +159,12 @@ class Order 'view_type' => 'field', 'view_key' => 'order_model', 'view_data_key' => 'name', - 'view_data' => lang('common_site_type_list'), + 'view_data' => MyConst('common_site_type_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_site_type_list'), + 'data' => MyConst('common_site_type_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -175,12 +175,12 @@ class Order 'view_type' => 'field', 'view_key' => 'client_type', 'view_data_key' => 'name', - 'view_data' => lang('common_platform_type'), + 'view_data' => MyConst('common_platform_type'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_platform_type'), + 'data' => MyConst('common_platform_type'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -336,7 +336,7 @@ class Order 'form_type' => 'select', 'where_type' => 'in', 'form_name' => 'user_is_comments', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'where_type_custom' => 'WhereTypyUserIsComments', diff --git a/app/admin/form/Orderaftersale.php b/app/admin/form/Orderaftersale.php index 4a6ccf89e..c5dbdbb53 100644 --- a/app/admin/form/Orderaftersale.php +++ b/app/admin/form/Orderaftersale.php @@ -80,13 +80,13 @@ class OrderAftersale 'view_type' => 'field', 'view_key' => 'status', 'view_data_key' => 'name', - 'view_data' => lang('common_order_aftersale_status_list'), + 'view_data' => MyConst('common_order_aftersale_status_list'), 'width' => 120, 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_order_aftersale_status_list'), + 'data' => MyConst('common_order_aftersale_status_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -97,13 +97,13 @@ class OrderAftersale 'view_type' => 'field', 'view_key' => 'type', 'view_data_key' => 'name', - 'view_data' => lang('common_order_aftersale_type_list'), + 'view_data' => MyConst('common_order_aftersale_type_list'), 'width' => 120, 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_order_aftersale_type_list'), + 'data' => MyConst('common_order_aftersale_type_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -154,13 +154,13 @@ class OrderAftersale 'view_type' => 'field', 'view_key' => 'refundment', 'view_data_key' => 'name', - 'view_data' => lang('common_order_aftersale_refundment_list'), + 'view_data' => MyConst('common_order_aftersale_refundment_list'), 'width' => 120, 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_order_aftersale_refundment_list'), + 'data' => MyConst('common_order_aftersale_refundment_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Paylog.php b/app/admin/form/Paylog.php index 9992255e9..da1388ff4 100644 --- a/app/admin/form/Paylog.php +++ b/app/admin/form/Paylog.php @@ -93,12 +93,12 @@ class PayLog 'view_type' => 'field', 'view_key' => 'status', 'view_data_key' => 'name', - 'view_data' => lang('common_pay_log_status_list'), + 'view_data' => MyConst('common_pay_log_status_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_pay_log_status_list'), + 'data' => MyConst('common_pay_log_status_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Quicknav.php b/app/admin/form/Quicknav.php index f483ffb95..026b5ac00 100644 --- a/app/admin/form/Quicknav.php +++ b/app/admin/form/Quicknav.php @@ -70,12 +70,12 @@ class QuickNav 'view_type' => 'field', 'view_key' => 'platform', 'view_data_key' => 'name', - 'view_data' => lang('common_platform_type'), + 'view_data' => MyConst('common_platform_type'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_platform_type'), + 'data' => MyConst('common_platform_type'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -92,13 +92,13 @@ class QuickNav 'view_type' => 'field', 'view_key' => 'event_type', 'view_data_key' => 'name', - 'view_data' => lang('common_app_event_type'), + 'view_data' => MyConst('common_app_event_type'), 'grid_size' => 'sm', 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_app_event_type'), + 'data' => MyConst('common_app_event_type'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -126,7 +126,7 @@ class QuickNav 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Refundlog.php b/app/admin/form/Refundlog.php index 772c11597..cb6fda39f 100644 --- a/app/admin/form/Refundlog.php +++ b/app/admin/form/Refundlog.php @@ -131,7 +131,7 @@ class RefundLog 'form_type' => 'select', 'form_name' => 'refundment', 'where_type' => 'in', - 'data' => lang('common_order_aftersale_refundment_list'), + 'data' => MyConst('common_order_aftersale_refundment_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Role.php b/app/admin/form/Role.php index d73d9f97e..8ca75f6f8 100644 --- a/app/admin/form/Role.php +++ b/app/admin/form/Role.php @@ -79,7 +79,7 @@ class Role 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Slide.php b/app/admin/form/Slide.php index d1bf502e0..381ab4be7 100644 --- a/app/admin/form/Slide.php +++ b/app/admin/form/Slide.php @@ -70,12 +70,12 @@ class Slide 'view_type' => 'field', 'view_key' => 'platform', 'view_data_key' => 'name', - 'view_data' => lang('common_platform_type'), + 'view_data' => MyConst('common_platform_type'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_platform_type'), + 'data' => MyConst('common_platform_type'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -92,12 +92,12 @@ class Slide 'view_type' => 'field', 'view_key' => 'event_type', 'view_data_key' => 'name', - 'view_data' => lang('common_app_event_type'), + 'view_data' => MyConst('common_app_event_type'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_app_event_type'), + 'data' => MyConst('common_app_event_type'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -125,7 +125,7 @@ class Slide 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/User.php b/app/admin/form/User.php index 8c3dd8a68..1f9fcad31 100644 --- a/app/admin/form/User.php +++ b/app/admin/form/User.php @@ -116,12 +116,12 @@ class User 'view_type' => 'field', 'view_key' => 'gender', 'view_data_key' => 'name', - 'view_data' => lang('common_gender_list'), + 'view_data' => MyConst('common_gender_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_gender_list'), + 'data' => MyConst('common_gender_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -132,12 +132,12 @@ class User 'view_type' => 'field', 'view_key' => 'status', 'view_data_key' => 'name', - 'view_data' => lang('common_user_status_list'), + 'view_data' => MyConst('common_user_status_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_user_status_list'), + 'data' => MyConst('common_user_status_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Useraddress.php b/app/admin/form/Useraddress.php index 2dc008463..63457eee9 100644 --- a/app/admin/form/Useraddress.php +++ b/app/admin/form/Useraddress.php @@ -169,7 +169,7 @@ class UserAddress 'form_type' => 'select', 'form_name' => 'is_default', 'where_type' => 'in', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Warehouse.php b/app/admin/form/Warehouse.php index 8bb29a3e2..ff7abc8f8 100644 --- a/app/admin/form/Warehouse.php +++ b/app/admin/form/Warehouse.php @@ -94,7 +94,7 @@ class Warehouse 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/form/Warehousegoods.php b/app/admin/form/Warehousegoods.php index 0649a8dec..290a41b7b 100644 --- a/app/admin/form/Warehousegoods.php +++ b/app/admin/form/Warehousegoods.php @@ -101,7 +101,7 @@ class WarehouseGoods 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), + 'data' => MyConst('common_is_enable_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/view/default/admin/login_info.html b/app/admin/view/default/admin/login_info.html index 94e0b3c48..bb11d7659 100755 --- a/app/admin/view/default/admin/login_info.html +++ b/app/admin/view/default/admin/login_info.html @@ -29,13 +29,13 @@
- +
- + @@ -96,7 +96,7 @@
- +
diff --git a/app/admin/view/default/admin/save_info.html b/app/admin/view/default/admin/save_info.html index 933f1c71f..982e42d33 100755 --- a/app/admin/view/default/admin/save_info.html +++ b/app/admin/view/default/admin/save_info.html @@ -11,15 +11,15 @@
- +
- +
- +
@@ -42,7 +42,7 @@
diff --git a/app/admin/view/default/config/index.html b/app/admin/view/default/config/index.html index dfcd28a19..f6ba37504 100755 --- a/app/admin/view/default/config/index.html +++ b/app/admin/view/default/config/index.html @@ -21,7 +21,7 @@
- +
diff --git a/app/admin/view/default/lib/enable.html b/app/admin/view/default/lib/enable.html index b9b2a74b1..076cdd2a9 100755 --- a/app/admin/view/default/lib/enable.html +++ b/app/admin/view/default/lib/enable.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_is_enable_list') as $v}} + {{foreach :MyConst('common_is_enable_list') as $v}} diff --git a/app/admin/view/default/lib/gender.html b/app/admin/view/default/lib/gender.html index 4ec3c0fa9..4df22e19b 100755 --- a/app/admin/view/default/lib/gender.html +++ b/app/admin/view/default/lib/gender.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_gender_list') as $v}} + {{foreach :MyConst('common_gender_list') as $v}} diff --git a/app/admin/view/default/lib/is_footer.html b/app/admin/view/default/lib/is_footer.html index 0eed5b089..db7246401 100755 --- a/app/admin/view/default/lib/is_footer.html +++ b/app/admin/view/default/lib/is_footer.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_is_text_list') as $v}} + {{foreach :MyConst('common_is_text_list') as $v}} diff --git a/app/admin/view/default/lib/is_full_screen.html b/app/admin/view/default/lib/is_full_screen.html index eb760022e..8f8bd1d09 100755 --- a/app/admin/view/default/lib/is_full_screen.html +++ b/app/admin/view/default/lib/is_full_screen.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_is_text_list') as $v}} + {{foreach :MyConst('common_is_text_list') as $v}} diff --git a/app/admin/view/default/lib/is_header.html b/app/admin/view/default/lib/is_header.html index be7f2885d..411178877 100755 --- a/app/admin/view/default/lib/is_header.html +++ b/app/admin/view/default/lib/is_header.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_is_text_list') as $v}} + {{foreach :MyConst('common_is_text_list') as $v}} diff --git a/app/admin/view/default/lib/is_new_window_open.html b/app/admin/view/default/lib/is_new_window_open.html index 6f4047f4d..47fc0fe47 100755 --- a/app/admin/view/default/lib/is_new_window_open.html +++ b/app/admin/view/default/lib/is_new_window_open.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_is_text_list') as $v}} + {{foreach :MyConst('common_is_text_list') as $v}} diff --git a/app/admin/view/default/lib/is_show.html b/app/admin/view/default/lib/is_show.html index fa172a3cd..8b6ca0484 100755 --- a/app/admin/view/default/lib/is_show.html +++ b/app/admin/view/default/lib/is_show.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_is_show_list') as $v}} + {{foreach :MyConst('common_is_show_list') as $v}} diff --git a/app/admin/view/default/lib/user_status.html b/app/admin/view/default/lib/user_status.html index e691383c3..0a70029ac 100755 --- a/app/admin/view/default/lib/user_status.html +++ b/app/admin/view/default/lib/user_status.html @@ -2,7 +2,7 @@
diff --git a/app/admin/view/default/pluginsadmin/save_info.html b/app/admin/view/default/pluginsadmin/save_info.html index a7cf10a5a..ca7546ee8 100755 --- a/app/admin/view/default/pluginsadmin/save_info.html +++ b/app/admin/view/default/pluginsadmin/save_info.html @@ -43,7 +43,7 @@
- +
@@ -54,7 +54,7 @@
@@ -63,7 +63,7 @@
diff --git a/app/admin/view/default/power/index.html b/app/admin/view/default/power/index.html index da49f0d79..b6a6656a6 100755 --- a/app/admin/view/default/power/index.html +++ b/app/admin/view/default/power/index.html @@ -49,11 +49,11 @@
- +
- +
diff --git a/app/admin/view/default/seo/index.html b/app/admin/view/default/seo/index.html index ef1becc7c..2962a895b 100755 --- a/app/admin/view/default/seo/index.html +++ b/app/admin/view/default/seo/index.html @@ -24,7 +24,7 @@
- +
diff --git a/app/admin/view/default/user/save_info.html b/app/admin/view/default/user/save_info.html index b12001548..289a5e3d7 100755 --- a/app/admin/view/default/user/save_info.html +++ b/app/admin/view/default/user/save_info.html @@ -20,7 +20,7 @@
- +
@@ -62,7 +62,7 @@
- +
@@ -83,7 +83,7 @@
- +
diff --git a/app/api/controller/Orderaftersale.php b/app/api/controller/Orderaftersale.php index 64b735e2e..c48ae0de8 100644 --- a/app/api/controller/Orderaftersale.php +++ b/app/api/controller/Orderaftersale.php @@ -141,7 +141,7 @@ class Orderaftersale extends Common 'returned_data' => $returned['data'], 'return_only_money_reason' => empty($return_only_money_reason) ? [] : explode("\n", $return_only_money_reason), 'return_money_goods_reason' => empty($return_money_goods_reason) ? [] : explode("\n", $return_money_goods_reason), - 'aftersale_type_list' => lang('common_order_aftersale_type_list'), + 'aftersale_type_list' => MyConst('common_order_aftersale_type_list'), 'return_goods_address' => $return_goods_address, 'editor_path_type' => ResourcesService::EditorPathTypeValue(OrderAftersaleService::EditorAttachmentPathType($this->user['id'], $order_id, $order_detail_id)), ]; diff --git a/app/common.php b/app/common.php index a8016ad3b..9eed13db1 100755 --- a/app/common.php +++ b/app/common.php @@ -11,6 +11,21 @@ // 应用公共文件 +/** + * 获取常量数据 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-14 + * @desc description + * @param [string] $key [数据key] + * @param [mixed] $default [默认值] + */ +function MyConst($key = '', $default = null) +{ + return \app\service\ConstService::Run($key, $default); +} + /** * session管理 * @author Devil @@ -1710,7 +1725,7 @@ function FileUploadError($name, $index = false) } // 错误码对应的错误信息 - $file_error_list = lang('common_file_upload_error_list'); + $file_error_list = MyConst('common_file_upload_error_list'); if(isset($file_error_list[$error])) { return $file_error_list[$error]; @@ -2149,7 +2164,7 @@ function XmlArray($xmlstring) { */ function CheckMobile($mobile) { - return (preg_match('/'.lang('common_regex_mobile').'/', $mobile) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_mobile').'/', $mobile) == 1) ? true : false; } /** @@ -2163,7 +2178,7 @@ function CheckMobile($mobile) */ function CheckTel($tel) { - return (preg_match('/'.lang('common_regex_tel').'/', $tel) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_tel').'/', $tel) == 1) ? true : false; } /** @@ -2177,7 +2192,7 @@ function CheckTel($tel) */ function CheckEmail($email) { - return (preg_match('/'.lang('common_regex_email').'/', $email) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_email').'/', $email) == 1) ? true : false; } /** @@ -2191,7 +2206,7 @@ function CheckEmail($email) */ function CheckIdCard($number) { - return (preg_match('/'.lang('common_regex_id_card').'/', $number) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_id_card').'/', $number) == 1) ? true : false; } /** @@ -2205,7 +2220,7 @@ function CheckIdCard($number) */ function CheckPrice($price) { - return (preg_match('/'.lang('common_regex_price').'/', $price) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_price').'/', $price) == 1) ? true : false; } @@ -2219,7 +2234,7 @@ function CheckPrice($price) */ function CheckIp($ip) { - return (preg_match('/'.lang('common_regex_ip').'/', $ip) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_ip').'/', $ip) == 1) ? true : false; } /** @@ -2232,7 +2247,7 @@ function CheckIp($ip) */ function CheckUrl($url) { - return (preg_match('/'.lang('common_regex_url').'/', $url) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_url').'/', $url) == 1) ? true : false; } /** @@ -2245,7 +2260,7 @@ function CheckUrl($url) */ function CheckVersion($ver) { - return (preg_match('/'.lang('common_regex_version').'/', $ver) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_version').'/', $ver) == 1) ? true : false; } /** @@ -2259,7 +2274,7 @@ function CheckVersion($ver) */ function CheckUserName($string) { - return (preg_match('/'.lang('common_regex_username').'/', $string) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_username').'/', $string) == 1) ? true : false; } /** @@ -2287,7 +2302,7 @@ function CheckSort($value) */ function CheckColor($value) { - return (preg_match('/'.lang('common_regex_color').'/', $value) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_color').'/', $value) == 1) ? true : false; } /** @@ -2301,7 +2316,7 @@ function CheckColor($value) */ function CheckLoginPwd($string) { - return (preg_match('/'.lang('common_regex_pwd').'/', $string) == 1) ? true : false; + return (preg_match('/'.MyConst('common_regex_pwd').'/', $string) == 1) ? true : false; } /** diff --git a/app/index/controller/Common.php b/app/index/controller/Common.php index 247140ce1..ac0ada38d 100755 --- a/app/index/controller/Common.php +++ b/app/index/controller/Common.php @@ -249,7 +249,7 @@ class Common extends BaseController MyViewAssign('common_goods_category_hidden', $common_goods_category_hidden); // 价格正则 - MyViewAssign('default_price_regex', lang('common_regex_price')); + MyViewAssign('default_price_regex', MyConst('common_regex_price')); // 附件host地址 MyViewAssign('attachment_host', SystemBaseService::AttachmentHost()); diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 4b87cc7a1..a302e18e1 100755 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -94,8 +94,8 @@ class Index extends Common MyViewAssign('many_images_view_list_show_style', BaseLayout::$many_images_view_list_show_style); // 首页商品排序规则 - MyViewAssign('goods_order_by_type_list', lang('goods_order_by_type_list')); - MyViewAssign('goods_order_by_rule_list', lang('goods_order_by_rule_list')); + MyViewAssign('goods_order_by_type_list', MyConst('goods_order_by_type_list')); + MyViewAssign('goods_order_by_rule_list', MyConst('goods_order_by_rule_list')); // 浏览器名称 MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle('首页设计', 1)); diff --git a/app/index/controller/Orderaftersale.php b/app/index/controller/Orderaftersale.php index b0d091d30..993887885 100644 --- a/app/index/controller/Orderaftersale.php +++ b/app/index/controller/Orderaftersale.php @@ -140,7 +140,7 @@ class Orderaftersale extends Common MyViewAssign('return_goods_address', $return_goods_address); // 静态数据 - MyViewAssign('common_order_aftersale_type_list', lang('common_order_aftersale_type_list')); + MyViewAssign('common_order_aftersale_type_list', MyConst('common_order_aftersale_type_list')); // 编辑器文件存放地址 MyViewAssign('editor_path_type', ResourcesService::EditorPathTypeValue(OrderAftersaleService::EditorAttachmentPathType($this->user['id'], $order_id, $order_detail_id))); diff --git a/app/index/controller/Personal.php b/app/index/controller/Personal.php index 357d923d1..d4b569e42 100755 --- a/app/index/controller/Personal.php +++ b/app/index/controller/Personal.php @@ -67,7 +67,7 @@ class Personal extends Common public function SaveInfo() { // 性别 - MyViewAssign('common_gender_list', lang('common_gender_list')); + MyViewAssign('common_gender_list', MyConst('common_gender_list')); // 数据 MyViewAssign('data', $this->user); diff --git a/app/index/form/Message.php b/app/index/form/Message.php index e7158147a..5222b4209 100644 --- a/app/index/form/Message.php +++ b/app/index/form/Message.php @@ -69,12 +69,12 @@ class Message 'view_type' => 'field', 'view_key' => 'type', 'view_data_key' => 'name', - 'view_data' => lang('common_message_type_list'), + 'view_data' => MyConst('common_message_type_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_message_type_list'), + 'data' => MyConst('common_message_type_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -120,12 +120,12 @@ class Message 'view_type' => 'field', 'view_key' => 'is_read', 'view_data_key' => 'name', - 'view_data' => lang('common_is_read_list'), + 'view_data' => MyConst('common_is_read_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_is_read_list'), + 'data' => MyConst('common_is_read_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/index/form/Order.php b/app/index/form/Order.php index a4bcf44a6..b921783b3 100644 --- a/app/index/form/Order.php +++ b/app/index/form/Order.php @@ -88,12 +88,12 @@ class Order 'view_type' => 'field', 'view_key' => 'status', 'view_data_key' => 'name', - 'view_data' => lang('common_order_user_status'), + 'view_data' => MyConst('common_order_user_status'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_order_user_status'), + 'data' => MyConst('common_order_user_status'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -108,7 +108,7 @@ class Order 'form_type' => 'select', 'form_name' => 'pay_status', 'where_type' => 'in', - 'data' => lang('common_order_pay_status'), + 'data' => MyConst('common_order_pay_status'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, @@ -149,12 +149,12 @@ class Order 'view_type' => 'field', 'view_key' => 'order_model', 'view_data_key' => 'name', - 'view_data' => lang('common_site_type_list'), + 'view_data' => MyConst('common_site_type_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_site_type_list'), + 'data' => MyConst('common_site_type_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -165,12 +165,12 @@ class Order 'view_type' => 'field', 'view_key' => 'client_type', 'view_data_key' => 'name', - 'view_data' => lang('common_platform_type'), + 'view_data' => MyConst('common_platform_type'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_platform_type'), + 'data' => MyConst('common_platform_type'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -320,7 +320,7 @@ class Order 'form_type' => 'select', 'where_type' => 'in', 'form_name' => 'user_is_comments', - 'data' => lang('common_is_text_list'), + 'data' => MyConst('common_is_text_list'), 'data_key' => 'id', 'data_name' => 'name', 'where_type_custom' => 'WhereTypyUserIsComments', diff --git a/app/index/form/Orderaftersale.php b/app/index/form/Orderaftersale.php index bac013ac0..225a7eef4 100644 --- a/app/index/form/Orderaftersale.php +++ b/app/index/form/Orderaftersale.php @@ -83,13 +83,13 @@ class OrderAftersale 'view_type' => 'field', 'view_key' => 'status', 'view_data_key' => 'name', - 'view_data' => lang('common_order_aftersale_status_list'), + 'view_data' => MyConst('common_order_aftersale_status_list'), 'width' => 120, 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_order_aftersale_status_list'), + 'data' => MyConst('common_order_aftersale_status_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -100,13 +100,13 @@ class OrderAftersale 'view_type' => 'field', 'view_key' => 'type', 'view_data_key' => 'name', - 'view_data' => lang('common_order_aftersale_type_list'), + 'view_data' => MyConst('common_order_aftersale_type_list'), 'width' => 120, 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_order_aftersale_type_list'), + 'data' => MyConst('common_order_aftersale_type_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, @@ -157,13 +157,13 @@ class OrderAftersale 'view_type' => 'field', 'view_key' => 'refundment', 'view_data_key' => 'name', - 'view_data' => lang('common_order_aftersale_refundment_list'), + 'view_data' => MyConst('common_order_aftersale_refundment_list'), 'width' => 120, 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_order_aftersale_refundment_list'), + 'data' => MyConst('common_order_aftersale_refundment_list'), 'data_key' => 'value', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/index/form/Userintegral.php b/app/index/form/Userintegral.php index 8af6eb937..a1b35d3f8 100644 --- a/app/index/form/Userintegral.php +++ b/app/index/form/Userintegral.php @@ -67,12 +67,12 @@ class UserIntegral 'view_type' => 'field', 'view_key' => 'type', 'view_data_key' => 'name', - 'view_data' => lang('common_integral_log_type_list'), + 'view_data' => MyConst('common_integral_log_type_list'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => lang('common_integral_log_type_list'), + 'data' => MyConst('common_integral_log_type_list'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/index/view/default/config.json b/app/index/view/default/config.json index 2ef4ef1b6..803ca5cd3 100755 --- a/app/index/view/default/config.json +++ b/app/index/view/default/config.json @@ -1,6 +1,6 @@ { "name":"默认主题", - "ver":"2.2.0", + "ver":"2.2.1", "author":"Devil", "home":"https://shopxo.net/" } \ No newline at end of file diff --git a/app/index/view/default/lib/enable.html b/app/index/view/default/lib/enable.html index b9b2a74b1..076cdd2a9 100755 --- a/app/index/view/default/lib/enable.html +++ b/app/index/view/default/lib/enable.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_is_enable_list') as $v}} + {{foreach :MyConst('common_is_enable_list') as $v}} diff --git a/app/index/view/default/lib/gender.html b/app/index/view/default/lib/gender.html index d3c1ac4b7..c3b0865b6 100755 --- a/app/index/view/default/lib/gender.html +++ b/app/index/view/default/lib/gender.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_gender_list') as $v}} + {{foreach :MyConst('common_gender_list') as $v}} diff --git a/app/index/view/default/lib/is_new_window_open.html b/app/index/view/default/lib/is_new_window_open.html index 0794abfeb..345558a6f 100755 --- a/app/index/view/default/lib/is_new_window_open.html +++ b/app/index/view/default/lib/is_new_window_open.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_is_text_list') as $v}} + {{foreach :MyConst('common_is_text_list') as $v}} diff --git a/app/index/view/default/lib/is_show.html b/app/index/view/default/lib/is_show.html index 797a74487..9859a2be9 100755 --- a/app/index/view/default/lib/is_show.html +++ b/app/index/view/default/lib/is_show.html @@ -2,7 +2,7 @@
- {{foreach :lang('common_is_show_list') as $v}} + {{foreach :MyConst('common_is_show_list') as $v}} diff --git a/app/index/view/default/safety/login_pwd_info.html b/app/index/view/default/safety/login_pwd_info.html index 0c81eafef..3ae664286 100755 --- a/app/index/view/default/safety/login_pwd_info.html +++ b/app/index/view/default/safety/login_pwd_info.html @@ -30,15 +30,15 @@
- +
- +
- +
diff --git a/app/index/view/default/safety/new_mobile_info.html b/app/index/view/default/safety/new_mobile_info.html index 89a23d7e4..1142dc7c3 100755 --- a/app/index/view/default/safety/new_mobile_info.html +++ b/app/index/view/default/safety/new_mobile_info.html @@ -30,7 +30,7 @@
- +
diff --git a/app/index/view/default/user/forget_pwd_info.html b/app/index/view/default/user/forget_pwd_info.html index da499eb93..dcbd6e112 100755 --- a/app/index/view/default/user/forget_pwd_info.html +++ b/app/index/view/default/user/forget_pwd_info.html @@ -49,7 +49,7 @@
- + diff --git a/app/index/view/default/user/login_content.html b/app/index/view/default/user/login_content.html index 8fba24fa8..81ac95a5f 100644 --- a/app/index/view/default/user/login_content.html +++ b/app/index/view/default/user/login_content.html @@ -25,7 +25,7 @@
- + @@ -86,7 +86,7 @@
- +
diff --git a/app/index/view/default/user/reg_info.html b/app/index/view/default/user/reg_info.html index dba55a1c5..51cde9fe1 100755 --- a/app/index/view/default/user/reg_info.html +++ b/app/index/view/default/user/reg_info.html @@ -72,13 +72,13 @@
- +
- + @@ -125,7 +125,7 @@
- +
@@ -141,7 +141,7 @@
- + @@ -189,7 +189,7 @@
- + diff --git a/app/layout/service/BaseLayout.php b/app/layout/service/BaseLayout.php index c44b805a4..ed8d54c63 100644 --- a/app/layout/service/BaseLayout.php +++ b/app/layout/service/BaseLayout.php @@ -795,8 +795,8 @@ class BaseLayout } // 排序处理 - $order_by_type_list = lang('goods_order_by_type_list'); - $order_by_rule_list = lang('goods_order_by_rule_list'); + $order_by_type_list = MyConst('goods_order_by_type_list'); + $order_by_rule_list = MyConst('goods_order_by_rule_list'); // 排序类型 $order_by_type = empty($params['order_by_type']) ? $order_by_type_list[0]['value'] : (array_key_exists($params['order_by_type'], $order_by_type_list) ? $order_by_type_list[$params['order_by_type']]['value'] : $order_by_type_list[0]['value']); diff --git a/app/layout/view/public/modal/modal_module_pages_select.html b/app/layout/view/public/modal/modal_module_pages_select.html index 6db2e02a6..76f4a5c7d 100644 --- a/app/layout/view/public/modal/modal_module_pages_select.html +++ b/app/layout/view/public/modal/modal_module_pages_select.html @@ -71,7 +71,7 @@
- {{foreach :lang('common_platform_type') as $v}} + {{foreach :MyConst('common_platform_type') as $v}}
diff --git a/app/service/AdminService.php b/app/service/AdminService.php index 10ab3ab39..401f054d2 100755 --- a/app/service/AdminService.php +++ b/app/service/AdminService.php @@ -49,8 +49,8 @@ class AdminService $roles = Db::name('Role')->where('id', 'in', array_column($data, 'role_id'))->column('name', 'id'); // 数据处理 - $common_gender_list = lang('common_gender_list'); - $common_admin_status_list = lang('common_admin_status_list'); + $common_gender_list = MyConst('common_gender_list'); + $common_admin_status_list = MyConst('common_admin_status_list'); foreach($data as &$v) { // 所在角色组 @@ -140,7 +140,7 @@ class AdminService [ 'checked_type' => 'in', 'key_name' => 'status', - 'checked_data' => array_column(lang('common_admin_status_list'), 'value'), + 'checked_data' => array_column(MyConst('common_admin_status_list'), 'value'), 'error_msg' => '状态值范围不正确', ], [ @@ -368,7 +368,7 @@ class AdminService [ 'checked_type' => 'in', 'key_name' => 'type', - 'checked_data' => array_column(lang('common_login_type_list'), 'value'), + 'checked_data' => array_column(MyConst('common_login_type_list'), 'value'), 'error_msg' => '登录类型有误', ], [ @@ -583,7 +583,7 @@ class AdminService [ 'checked_type' => 'in', 'key_name' => 'type', - 'checked_data' => array_column(lang('common_login_type_list'), 'value'), + 'checked_data' => array_column(MyConst('common_login_type_list'), 'value'), 'error_msg' => '登录类型有误', ], ]; diff --git a/app/service/AppCenterNavService.php b/app/service/AppCenterNavService.php index c6e58c32d..887b4e3cc 100755 --- a/app/service/AppCenterNavService.php +++ b/app/service/AppCenterNavService.php @@ -42,8 +42,8 @@ class AppCenterNavService $data = Db::name('AppCenterNav')->where($where)->order($order_by)->limit($m, $n)->select()->toArray(); if(!empty($data)) { - $common_platform_type = lang('common_platform_type'); - $common_app_event_type = lang('common_app_event_type'); + $common_platform_type = MyConst('common_platform_type'); + $common_app_event_type = MyConst('common_app_event_type'); foreach($data as &$v) { // 平台类型 @@ -114,13 +114,13 @@ class AppCenterNavService [ 'checked_type' => 'in', 'key_name' => 'platform', - 'checked_data' => array_column(lang('common_platform_type'), 'value'), + 'checked_data' => array_column(MyConst('common_platform_type'), 'value'), 'error_msg' => '平台类型有误', ], [ 'checked_type' => 'in', 'key_name' => 'event_type', - 'checked_data' => array_column(lang('common_app_event_type'), 'value'), + 'checked_data' => array_column(MyConst('common_app_event_type'), 'value'), 'is_checked' => 2, 'error_msg' => '事件值类型有误', ], diff --git a/app/service/AppHomeNavService.php b/app/service/AppHomeNavService.php index e852b4b4f..62ac05e11 100755 --- a/app/service/AppHomeNavService.php +++ b/app/service/AppHomeNavService.php @@ -42,8 +42,8 @@ class AppHomeNavService $data = Db::name('AppHomeNav')->where($where)->order($order_by)->limit($m, $n)->select()->toArray(); if(!empty($data)) { - $common_platform_type = lang('common_platform_type'); - $common_app_event_type = lang('common_app_event_type'); + $common_platform_type = MyConst('common_platform_type'); + $common_app_event_type = MyConst('common_app_event_type'); foreach($data as &$v) { // 平台类型 @@ -114,13 +114,13 @@ class AppHomeNavService [ 'checked_type' => 'in', 'key_name' => 'platform', - 'checked_data' => array_column(lang('common_platform_type'), 'value'), + 'checked_data' => array_column(MyConst('common_platform_type'), 'value'), 'error_msg' => '平台类型有误', ], [ 'checked_type' => 'in', 'key_name' => 'event_type', - 'checked_data' => array_column(lang('common_app_event_type'), 'value'), + 'checked_data' => array_column(MyConst('common_app_event_type'), 'value'), 'is_checked' => 2, 'error_msg' => '事件值类型有误', ], diff --git a/app/service/AppMiniService.php b/app/service/AppMiniService.php index 1b25c05b8..414ff7a4c 100755 --- a/app/service/AppMiniService.php +++ b/app/service/AppMiniService.php @@ -50,7 +50,7 @@ class AppMiniService self::$application_name = isset($params['application_name']) ? $params['application_name'] : 'weixin'; // 小程序类型校验 - if(!array_key_exists(self::$application_name, lang('common_appmini_type'))) + if(!array_key_exists(self::$application_name, MyConst('common_appmini_type'))) { return DataReturn('小程序类型有误['.self::$application_name.']', -1); } @@ -430,7 +430,7 @@ class AppMiniService \base\FileUtil::UnlinkDir($new_dir); // 开始下载 - $appmini_type = lang('common_appmini_type'); + $appmini_type = MyConst('common_appmini_type'); $application_name = array_key_exists(self::$application_name, $appmini_type) ? $appmini_type[self::$application_name]['name'].'-' : ''; if(\base\FileUtil::DownloadFile($new_dir.'.zip', $application_name.$config['name'].'_v'.$config['ver'].'.zip')) { diff --git a/app/service/ConstService.php b/app/service/ConstService.php new file mode 100644 index 000000000..d6b264e9d --- /dev/null +++ b/app/service/ConstService.php @@ -0,0 +1,529 @@ + [ + '1.1.0' => ['value' => '1.1.0', 'name' => 'v1.1.0'], + '1.2.0' => ['value' => '1.2.0', 'name' => 'v1.2.0'], + '1.3.0' => ['value' => '1.3.0', 'name' => 'v1.3.0'], + '1.4.0' => ['value' => '1.4.0', 'name' => 'v1.4.0'], + '1.5.0' => ['value' => '1.5.0', 'name' => 'v1.5.0'], + '1.6.0' => ['value' => '1.6.0', 'name' => 'v1.6.0'], + '1.7.0' => ['value' => '1.7.0', 'name' => 'v1.7.0'], + '1.8.0' => ['value' => '1.8.0', 'name' => 'v1.8.0'], + '1.8.1' => ['value' => '1.8.1', 'name' => 'v1.8.1'], + '1.9.0' => ['value' => '1.9.0', 'name' => 'v1.9.0'], + '1.9.1' => ['value' => '1.9.1', 'name' => 'v1.9.1'], + '1.9.2' => ['value' => '1.9.2', 'name' => 'v1.9.2'], + '1.9.3' => ['value' => '1.9.3', 'name' => 'v1.9.3'], + '2.0.0' => ['value' => '2.0.0', 'name' => 'v2.0.0'], + '2.0.1' => ['value' => '2.0.1', 'name' => 'v2.0.1'], + '2.0.2' => ['value' => '2.0.2', 'name' => 'v2.0.2'], + '2.0.3' => ['value' => '2.0.3', 'name' => 'v2.0.3'], + '2.1.0' => ['value' => '2.1.0', 'name' => 'v2.1.0'], + '2.2.0' => ['value' => '2.2.0', 'name' => 'v2.2.0'], + '2.2.1' => ['value' => '2.2.0', 'name' => 'v2.2.1'], + ], + + // 用户注册类型列表 + 'common_user_reg_type_list' => [ + 0 => ['value' => 'sms', 'name' => '短信'], + 1 => ['value' => 'email', 'name' => '邮箱'], + 2 => ['value' => 'username', 'name' => '用户名'], + ], + + // 登录方式 + 'common_login_type_list' => [ + 0 => ['value' => 'username', 'name' => '帐号密码', 'checked' => true], + 1 => ['value' => 'email', 'name' => '邮箱验证码'], + 2 => ['value' => 'sms', 'name' => '手机验证码'], + ], + + // 性别 + 'common_gender_list' => [ + 0 => ['id' => 0, 'name' => '保密', 'checked' => true], + 1 => ['id' => 1, 'name' => '女'], + 2 => ['id' => 2, 'name' => '男'], + ], + + // 关闭开启状态 + 'common_close_open_list' => [ + 0 => ['value' => 0, 'name' => '关闭'], + 1 => ['value' => 1, 'name' => '开启'], + ], + + // 是否启用 + 'common_is_enable_tips' => [ + 0 => ['id' => 0, 'name' => '未启用'], + 1 => ['id' => 1, 'name' => '已启用'], + ], + 'common_is_enable_list' => [ + 0 => ['id' => 0, 'name' => '不启用'], + 1 => ['id' => 1, 'name' => '启用', 'checked' => true], + ], + + // 是否显示 + 'common_is_show_list' => [ + 0 => ['id' => 0, 'name' => '不显示'], + 1 => ['id' => 1, 'name' => '显示', 'checked' => true], + ], + + // 状态 + 'common_state_list' => [ + 0 => ['id' => 0, 'name' => '不可用'], + 1 => ['id' => 1, 'name' => '可用', 'checked' => true], + ], + + // excel编码列表 + 'common_excel_charset_list' => [ + 0 => ['id' => 0, 'value' => 'utf-8', 'name' => 'utf-8', 'checked' => true], + 1 => ['id' => 1, 'value' => 'gbk', 'name' => 'gbk'], + ], + + // 支付状态 + 'common_order_pay_status' => [ + 0 => ['id' => 0, 'name' => '待支付', 'checked' => true], + 1 => ['id' => 1, 'name' => '已支付'], + 2 => ['id' => 2, 'name' => '已退款'], + 3 => ['id' => 3, 'name' => '部分退款'], + ], + + // 用户端 - 订单管理 + 'common_order_user_status' => [ + 0 => ['id' => 0, 'name' => '待确认', 'checked' => true], + 1 => ['id' => 1, 'name' => '待付款'], + 2 => ['id' => 2, 'name' => '待发货'], + 3 => ['id' => 3, 'name' => '待收货'], + 4 => ['id' => 4, 'name' => '已完成'], + 5 => ['id' => 5, 'name' => '已取消'], + 6 => ['id' => 6, 'name' => '已关闭'], + ], + + // 后台管理 - 订单管理 + 'common_order_admin_status' => [ + 0 => ['id' => 0, 'name' => '待确认', 'checked' => true], + 1 => ['id' => 1, 'name' => '已确认/待支付'], + 2 => ['id' => 2, 'name' => '待发货/待取货'], + 3 => ['id' => 3, 'name' => '已发货/待收货'], + 4 => ['id' => 4, 'name' => '已完成'], + 5 => ['id' => 5, 'name' => '已取消'], + 6 => ['id' => 6, 'name' => '已关闭'], + ], + + // 所属平台 + 'common_platform_type' => [ + 'pc' => ['value' => 'pc', 'name' => 'PC网站'], + 'h5' => ['value' => 'h5', 'name' => 'H5手机网站'], + 'ios' => ['value' => 'ios', 'name' => '苹果APP'], + 'android' => ['value' => 'android', 'name' => '安卓APP'], + 'weixin' => ['value' => 'weixin', 'name' => '微信小程序'], + 'alipay' => ['value' => 'alipay', 'name' => '支付宝小程序'], + 'baidu' => ['value' => 'baidu', 'name' => '百度小程序'], + 'toutiao' => ['value' => 'toutiao', 'name' => '头条小程序'], + 'qq' => ['value' => 'qq', 'name' => 'QQ小程序'], + ], + + // app平台 + 'common_app_type' => [ + 'ios' => ['value' => 'ios', 'name' => '苹果APP'], + 'android' => ['value' => 'android', 'name' => '安卓APP'], + ], + + // 小程序平台 + 'common_appmini_type' => [ + 'weixin' => ['value' => 'weixin', 'name' => '微信小程序'], + 'alipay' => ['value' => 'alipay', 'name' => '支付宝小程序'], + 'baidu' => ['value' => 'baidu', 'name' => '百度小程序'], + 'toutiao' => ['value' => 'toutiao', 'name' => '头条小程序'], + 'qq' => ['value' => 'qq', 'name' => 'QQ小程序'], + ], + + // 扣除库存规则 + 'common_deduction_inventory_rules_list' => [ + 0 => ['id' => 0, 'name' => '订单确认成功'], + 1 => ['id' => 1, 'name' => '订单支付成功'], + 2 => ['id' => 2, 'name' => '订单发货'], + ], + + // 商品增加销量规则 + 'common_sales_count_inc_rules_list' => [ + 0 => ['id' => 0, 'name' => '订单支付'], + 1 => ['id' => 1, 'name' => '订单收货'], + ], + + // 是否已读 + 'common_is_read_list' => [ + 0 => ['id' => 0, 'name' => '未读', 'checked' => true], + 1 => ['id' => 1, 'name' => '已读'], + ], + + // 消息类型 + 'common_message_type_list' => [ + 0 => ['id' => 0, 'name' => '默认', 'checked' => true], + ], + + // 用户积分 - 操作类型 + 'common_integral_log_type_list' => [ + 0 => ['id' => 0, 'name' => '减少', 'checked' => true], + 1 => ['id' => 1, 'name' => '增加'], + ], + + // 是否上架/下架 + 'common_is_shelves_list' => [ + 0 => ['id' => 0, 'name' => '下架'], + 1 => ['id' => 1, 'name' => '上架', 'checked' => true], + ], + + // 是否 + 'common_is_text_list' => [ + 0 => ['id' => 0, 'name' => '否', 'checked' => true], + 1 => ['id' => 1, 'name' => '是'], + ], + + // 用户状态 + 'common_user_status_list' => [ + 0 => ['id' => 0, 'name' => '正常', 'checked' => true], + 1 => ['id' => 1, 'name' => '禁止发言', 'tips' => '用户被禁止发言'], + 2 => ['id' => 2, 'name' => '禁止登录', 'tips' => '用户被禁止登录'], + 3 => ['id' => 3, 'name' => '待审核', 'tips' => '用户等待审核中'], + ], + + // 导航数据类型 + 'common_nav_type_list' => [ + 'custom' => ['value'=>'custom', 'name'=>'自定义'], + 'article' => ['value'=>'article', 'name'=>'文章'], + 'customview' => ['value'=>'customview', 'name'=>'自定义页面'], + 'goods_category' => ['value'=>'goods_category', 'name'=>'商品分类'], + ], + + // 搜索框下热门关键字类型 + 'common_search_keywords_type_list' => [ + 0 => ['value' => 0, 'name' => '关闭'], + 1 => ['value' => 1, 'name' => '自动'], + 2 => ['value' => 2, 'name' => '自定义'], + ], + + // app事件类型 + 'common_app_event_type' => [ + 0 => ['value' => 0, 'name' => 'WEB页面'], + 1 => ['value' => 1, 'name' => '内部页面(小程序/APP内部地址)'], + 2 => ['value' => 2, 'name' => '外部小程序(同一个主体下的小程序appid)'], + 3 => ['value' => 3, 'name' => '跳转原生地图查看指定位置'], + 4 => ['value' => 4, 'name' => '拨打电话'], + ], + + // 订单售后类型 + 'common_order_aftersale_type_list' => [ + 0 => ['value' => 0, 'name' => '仅退款', 'desc' => '未收到货(未签收),协商同意前提下', 'icon' => 'am-icon-random', 'class' => 'am-fl'], + 1 => ['value' => 1, 'name' => '退款退货', 'desc' => '已收到货,需要退换已收到的货物', 'icon' => 'am-icon-retweet', 'class' => 'am-fr'], + ], + + // 订单售后状态 + 'common_order_aftersale_status_list' => [ + 0 => ['value' => 0, 'name' => '待确认'], + 1 => ['value' => 1, 'name' => '待退货'], + 2 => ['value' => 2, 'name' => '待审核'], + 3 => ['value' => 3, 'name' => '已完成'], + 4 => ['value' => 4, 'name' => '已拒绝'], + 5 => ['value' => 5, 'name' => '已取消'], + ], + + // 订单售后退款方式 + 'common_order_aftersale_refundment_list' => [ + 0 => ['value' => 0, 'name' => '原路退回'], + 1 => ['value' => 1, 'name' => '退至钱包'], + 2 => ['value' => 2, 'name' => '手动处理'], + ], + + // 商品评分 + 'common_goods_comments_rating_list' => [ + 0 => ['value'=>0, 'name'=>'未评分', 'badge'=>''], + 1 => ['value'=>1, 'name'=>'1分', 'badge'=>'danger'], + 2 => ['value'=>2, 'name'=>'2分', 'badge'=>'warning'], + 3 => ['value'=>3, 'name'=>'3分', 'badge'=>'secondary'], + 4 => ['value'=>4, 'name'=>'4分', 'badge'=>'primary'], + 5 => ['value'=>5, 'name'=>'5分', 'badge'=>'success'], + ], + + // 商品评论业务类型 + 'common_goods_comments_business_type_list' => [ + 'order' => ['value' => 'order', 'name' => '订单'], + ], + + // 站点类型 + 'common_site_type_list' => [ + 0 => ['value' => 0, 'name' => '销售'], + 1 => ['value' => 1, 'name' => '展示'], + 2 => ['value' => 2, 'name' => '自提'], + 3 => ['value' => 3, 'name' => '虚拟销售'], + 4 => ['value' => 4, 'name' => '销售+自提', 'is_ext' => 1], + ], + + // 管理员状态 + 'common_admin_status_list' => [ + 0 => ['value' => 0, 'name' => '正常', 'checked' => true], + 1 => ['value' => 1, 'name' => '暂停'], + 2 => ['value' => 2, 'name' => '已离职'], + ], + + // 支付日志状态 + 'common_pay_log_status_list' => [ + 0 => ['value' => 0, 'name' => '待支付', 'checked' => true], + 1 => ['value' => 1, 'name' => '已支付'], + 2 => ['value' => 2, 'name' => '已关闭'], + ], + + // 商品参数组件类型 + 'common_goods_parameters_type_list' => [ + 0 => ['value' => 0, 'name' => '全部'], + 1 => ['value' => 1, 'name' => '详情', 'checked' => true], + 2 => ['value' => 2, 'name' => '基础'], + ], + + // 商品关联排序类型 + 'goods_order_by_type_list' => [ + 0 => ['value' => 'g.access_count,g.sales_count,g.id', 'name' => '综合', 'checked' => true], + 1 => ['value' => 'g.sales_count', 'name' => '销量'], + 2 => ['value' => 'g.access_count', 'name' => '热度'], + 3 => ['value' => 'g.min_price', 'name' => '价格'], + 4 => ['value' => 'g.id', 'name' => '最新'], + ], + + // 商品关联排序规则 + 'goods_order_by_rule_list' => [ + 0 => ['value' => 'desc', 'name' => '降序(desc)', 'checked' => true], + 1 => ['value' => 'asc', 'name' => '升序(asc)'], + ], + + // 首页数据类型 + 'common_site_floor_data_type_list' => [ + 0 => ['value' => 0, 'name' => '自动模式', 'checked' => true], + 1 => ['value' => 1, 'name' => '手动模式'], + 2 => ['value' => 2, 'name' => '拖拽模式'], + ], + + // 文件上传错误码 + 'common_file_upload_error_list' => [ + 1 => '文件大小超过服务器允许上传的最大值', + 2 => '文件大小超出浏览器限制,查看是否超过[站点设置->附件最大限制]', + 3 => '文件仅部分被上传', + 4 => '没有找到要上传的文件', + 5 => '没有找到服务器临时文件夹', + 6 => '没有找到服务器临时文件夹', + 7 => '文件写入失败', + 8 => '文件上传扩展没有打开', + ], + + + // -------------------- 正则 -------------------- + // 用户名 + 'common_regex_username' => '^[A-Za-z0-9_]{2,18}$', + + // 用户名 + 'common_regex_pwd' => '^.{6,18}$', + + // 手机号码 + 'common_regex_mobile' => '^1((3|4|5|6|7|8|9){1}\d{1})\d{8}$', + + // 座机号码 + 'common_regex_tel' => '^\d{3,4}-?\d{8}$', + + // 电子邮箱 + 'common_regex_email' => '^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$', + + // 身份证号码 + 'common_regex_id_card' => '^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$', + + // 价格格式 + 'common_regex_price' => '^([0-9]{1}\d{0,7})(\.\d{1,2})?$', + + // ip + 'common_regex_ip' => '^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$', + + // url + 'common_regex_url' => '^http[s]?:\/\/[A-Za-z0-9-]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$', + + // 控制器名称 + 'common_regex_control' => '^[A-Za-z]{1}[A-Za-z0-9_]{0,29}$', + + // 方法名称 + 'common_regex_action' => '^[A-Za-z]{1}[A-Za-z0-9_]{0,29}$', + + // 顺序 + 'common_regex_sort' => '^[0-9]{1,3}$', + + // 日期 + 'common_regex_date' => '^\d{4}-\d{2}-\d{2}$', + + // 分数 + 'common_regex_score' => '^[0-9]{1,3}$', + + // 分页 + 'common_regex_page_number' => '^[1-9]{1}[0-9]{0,2}$', + + // 时段格式 10:00-10:45 + 'common_regex_interval' => '^\d{2}\:\d{2}\-\d{2}\:\d{2}$', + + // 颜色 + 'common_regex_color' => '^(#([a-fA-F0-9]{6}|[a-fA-F0-9]{3}))?$', + + // id逗号隔开 + 'common_regex_id_comma_split' => '^\d(\d|,?)*\d$', + + // url伪静态后缀 + 'common_regex_url_html_suffix' => '^[a-z]{0,8}$', + + // 图片比例值 + 'common_regex_image_proportion' => '^([1-9]{1}[0-9]?|[1-9]{1}[0-9]?\.{1}[0-9]{1,2}|100|0)?$', + + // 版本号 + 'common_regex_version' => '^[0-9]{1,6}\.[0-9]{1,6}\.[0-9]{1,6}$', + + + // -------------------- 后端相关 -------------------- + // 图片验证码 + 'site_images_verify_rules_list' => [ + 0 => ['value' => 'bgcolor', 'name' => '彩色背景'], + 1 => ['value' => 'textcolor', 'name' => '彩色文本'], + 2 => ['value' => 'point', 'name' => '干扰点'], + 3 => ['value' => 'line', 'name' => '干扰线'], + ], + + // 时区 + 'site_timezone_list' => [ + 'Pacific/Pago_Pago' => '(标准时-11:00) 中途岛、萨摩亚群岛', + 'Pacific/Rarotonga' => '(标准时-10:00) 夏威夷', + 'Pacific/Gambier' => '(标准时-9:00) 阿拉斯加', + 'America/Dawson' => '(标准时-8:00) 太平洋时间(美国和加拿大)', + 'America/Creston' => '(标准时-7:00) 山地时间(美国和加拿大)', + 'America/Belize' => '(标准时-6:00) 中部时间(美国和加拿大)、墨西哥城', + 'America/Eirunepe' => '(标准时-5:00) 东部时间(美国和加拿大)、波哥大', + 'America/Antigua' => '(标准时-4:00) 大西洋时间(加拿大)、加拉加斯', + 'America/Argentina/Buenos_Aires' => '(标准时-3:00) 巴西、布宜诺斯艾利斯、乔治敦', + 'America/Noronha' => '(标准时-2:00) 中大西洋', + 'Atlantic/Cape_Verde' => '(标准时-1:00) 亚速尔群岛、佛得角群岛', + 'Africa/Ouagadougou' => '(格林尼治标准时) 西欧时间、伦敦、卡萨布兰卡', + 'Europe/Andorra' => '(标准时+1:00) 中欧时间、安哥拉、利比亚', + 'Europe/Mariehamn' => '(标准时+2:00) 东欧时间、开罗,雅典', + 'Asia/Bahrain' => '(标准时+3:00) 巴格达、科威特、莫斯科', + 'Asia/Dubai' => '(标准时+4:00) 阿布扎比、马斯喀特、巴库', + 'Asia/Kolkata' => '(标准时+5:00) 叶卡捷琳堡、伊斯兰堡、卡拉奇', + 'Asia/Dhaka' => '(标准时+6:00) 阿拉木图、 达卡、新亚伯利亚', + 'Indian/Christmas' => '(标准时+7:00) 曼谷、河内、雅加达', + 'Asia/Shanghai' => '(标准时+8:00)北京、重庆、香港、新加坡', + 'Australia/Darwin' => '(标准时+9:00) 东京、汉城、大阪、雅库茨克', + 'Australia/Adelaide' => '(标准时+10:00) 悉尼、关岛', + 'Australia/Currie' => '(标准时+11:00) 马加丹、索罗门群岛', + 'Pacific/Fiji' => '(标准时+12:00) 奥克兰、惠灵顿、堪察加半岛' + ], + + // seo + // url模式列表 + 'seo_url_model_list' => [ + 0 => ['value' => 0, 'name' => '兼容模式', 'checked' => true], + 1 => ['value' => 1, 'name' => 'PATHINFO模式'], + 2 => ['value' => 2, 'name' => 'PATHINFO模式+短地址'], + ], + + // 用户excel导出标题列表 + 'excel_user_title_list' => [ + 'username' => [ + 'name' => '用户名', + 'type' => 'string', + ], + 'nickname' => [ + 'name' => '昵称', + 'type' => 'int', + ], + 'gender_text' => [ + 'name' => '性别', + 'type' => 'string', + ], + 'birthday_text'=> [ + 'name' => '生日', + 'type' => 'string', + ], + 'status_text'=> [ + 'name' => '状态', + 'type' => 'string', + ], + 'mobile' => [ + 'name' => '手机号码', + 'type' => 'int', + ], + 'email' => [ + 'name' => '电子邮箱', + 'type' => 'string', + ], + 'province' => [ + 'name' => '所在省', + 'type' => 'string', + ], + 'city' => [ + 'name' => '所在市', + 'type' => 'string', + ], + 'address' => [ + 'name' => '详细地址', + 'type' => 'string', + ], + 'add_time' => [ + 'name' => '注册时间', + 'type' => 'string', + ], + ], + ]; + + // 匹配数据 + // 空 key 则返回全部 + // 未匹配到数据则返回null + $data = empty($key) ? $container : (array_key_exists($key, $container) ? $container[$key] : $default); + + // 常量数据读取钩子 + $hook_name = 'plugins_service_const_data'; + MyEventTrigger($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'key' => $key, + 'default' => $default, + 'data' => &$data, + ]); + + return $data; + } +} +?> \ No newline at end of file diff --git a/app/service/CustomViewService.php b/app/service/CustomViewService.php index f6f24398e..4fc502e24 100755 --- a/app/service/CustomViewService.php +++ b/app/service/CustomViewService.php @@ -42,7 +42,7 @@ class CustomViewService $data = Db::name('CustomView')->field($field)->where($where)->order($order_by)->limit($m, $n)->select()->toArray(); if(!empty($data)) { - $common_is_enable_list = lang('common_is_enable_list'); + $common_is_enable_list = MyConst('common_is_enable_list'); foreach($data as &$v) { // 是否启用 diff --git a/app/service/GoodsCommentsService.php b/app/service/GoodsCommentsService.php index 3de9daac7..c17bdeaeb 100644 --- a/app/service/GoodsCommentsService.php +++ b/app/service/GoodsCommentsService.php @@ -140,7 +140,7 @@ class GoodsCommentsService } if($order['status'] != 4) { - $status_text = lang('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } if($order['user_is_comments'] != 0) @@ -222,9 +222,9 @@ class GoodsCommentsService } // 静态数据 - $common_is_text_list = lang('common_is_text_list'); - $comments_rating_list = lang('common_goods_comments_rating_list'); - $comments_business_type_list = lang('common_goods_comments_business_type_list'); + $common_is_text_list = MyConst('common_is_text_list'); + $comments_rating_list = MyConst('common_goods_comments_rating_list'); + $comments_business_type_list = MyConst('common_goods_comments_business_type_list'); // 数据处理 foreach($data as &$v) @@ -364,7 +364,7 @@ class GoodsCommentsService [ 'checked_type' => 'in', 'key_name' => 'business_type', - 'checked_data' => array_keys(lang('common_order_aftersale_refundment_list')), + 'checked_data' => array_keys(MyConst('common_order_aftersale_refundment_list')), 'error_msg' => '请选择业务类型', ], [ @@ -382,7 +382,7 @@ class GoodsCommentsService [ 'checked_type' => 'in', 'key_name' => 'rating', - 'checked_data' => array_keys(lang('common_goods_comments_rating_list')), + 'checked_data' => array_keys(MyConst('common_goods_comments_rating_list')), 'error_msg' => '请选择评分', ], ]; diff --git a/app/service/GoodsService.php b/app/service/GoodsService.php index 1ba96de17..4cddc48f0 100755 --- a/app/service/GoodsService.php +++ b/app/service/GoodsService.php @@ -253,8 +253,8 @@ class GoodsService // 商品数量 $goods_count = MyC('home_index_floor_goods_max_count', 8, true); // 排序配置 - $floor_order_by_type_list = lang('goods_order_by_type_list'); - $floor_order_by_rule_list = lang('goods_order_by_rule_list'); + $floor_order_by_type_list = MyConst('goods_order_by_type_list'); + $floor_order_by_rule_list = MyConst('goods_order_by_rule_list'); $floor_order_by_type = MyC('home_index_floor_goods_order_by_type', 0, true); $floor_order_by_rule = MyC('home_index_floor_goods_order_by_rule', 0, true); // 排序字段名称 @@ -1065,7 +1065,7 @@ class GoodsService [ 'checked_type' => 'in', 'key_name' => 'site_type', - 'checked_data' => array_merge([-1], array_column(lang('common_site_type_list'), 'value')), + 'checked_data' => array_merge([-1], array_column(MyConst('common_site_type_list'), 'value')), 'is_checked' => 2, 'error_msg' => '商品类型数据值范围有误', ], diff --git a/app/service/IntegralService.php b/app/service/IntegralService.php index 1a04cc1c9..85d19aa7b 100755 --- a/app/service/IntegralService.php +++ b/app/service/IntegralService.php @@ -52,7 +52,7 @@ class IntegralService $log_id = Db::name('UserIntegralLog')->insertGetId($data); if($log_id > 0) { - $type_msg = lang('common_integral_log_type_list')[$type]['name']; + $type_msg = MyConst('common_integral_log_type_list')[$type]['name']; $detail = $msg.'积分'.$type_msg.$operation_integral; MessageService::MessageAdd($user_id, '积分变动', $detail, '积分', $log_id); return true; @@ -81,7 +81,7 @@ class IntegralService $data = Db::name('UserIntegralLog')->where($where)->field($field)->limit($m, $n)->order($order_by)->select()->toArray(); if(!empty($data)) { - $integral_log_type_list = lang('common_integral_log_type_list'); + $integral_log_type_list = MyConst('common_integral_log_type_list'); foreach($data as &$v) { // 用户信息 diff --git a/app/service/MessageService.php b/app/service/MessageService.php index f33103afb..3b2651936 100755 --- a/app/service/MessageService.php +++ b/app/service/MessageService.php @@ -202,8 +202,8 @@ class MessageService $user_list = UserService::GetUserViewInfo(array_column($data, 'user_id')); } - $common_is_read_list = lang('common_is_read_list'); - $common_message_type_list = lang('common_message_type_list'); + $common_is_read_list = MyConst('common_is_read_list'); + $common_message_type_list = MyConst('common_message_type_list'); foreach($data as &$v) { // 用户信息 diff --git a/app/service/NavigationService.php b/app/service/NavigationService.php index 1adfd1d04..e30d7f61d 100755 --- a/app/service/NavigationService.php +++ b/app/service/NavigationService.php @@ -271,7 +271,7 @@ class NavigationService { if(!empty($data) && is_array($data)) { - $nav_type_list = lang('common_nav_type_list'); + $nav_type_list = MyConst('common_nav_type_list'); foreach($data as &$v) { // 数据类型 diff --git a/app/service/OrderAftersaleService.php b/app/service/OrderAftersaleService.php index cfb31fb6d..89a123d70 100644 --- a/app/service/OrderAftersaleService.php +++ b/app/service/OrderAftersaleService.php @@ -325,7 +325,7 @@ class OrderAftersaleService } if($aftersale['status'] != 1) { - $common_order_aftersale_status_list = lang('common_order_aftersale_status_list'); + $common_order_aftersale_status_list = MyConst('common_order_aftersale_status_list'); return DataReturn('该售后订单状态不可操作['.$common_order_aftersale_status_list[$aftersale['status']]['name'].']', -10); } @@ -397,9 +397,9 @@ class OrderAftersaleService $data = Db::name('OrderAftersale')->field($field)->where($where)->limit($m, $n)->order($order_by)->select()->toArray(); if(!empty($data)) { - $type_list = lang('common_order_aftersale_type_list'); - $status_list = lang('common_order_aftersale_status_list'); - $refundment_list = lang('common_order_aftersale_refundment_list'); + $type_list = MyConst('common_order_aftersale_type_list'); + $status_list = MyConst('common_order_aftersale_status_list'); + $refundment_list = MyConst('common_order_aftersale_refundment_list'); foreach($data as &$v) { // 订单商品 @@ -619,7 +619,7 @@ class OrderAftersaleService // 状态校验 if(in_array($aftersale['status'], [3,5])) { - $status_list = lang('common_order_aftersale_status_list'); + $status_list = MyConst('common_order_aftersale_status_list'); return DataReturn('状态不可操作['.$status_list[$aftersale['status']]['name'].']', -1); } @@ -708,14 +708,14 @@ class OrderAftersaleService // 状态校验 if($aftersale['status'] != 0) { - $status_list = lang('common_order_aftersale_status_list'); + $status_list = MyConst('common_order_aftersale_status_list'); return DataReturn('状态不可操作['.$status_list[$aftersale['status']]['name'].']', -1); } // 类型 if($aftersale['type'] != 1) { - $aftersale_type_list = lang('common_order_aftersale_type_list'); + $aftersale_type_list = MyConst('common_order_aftersale_type_list'); return DataReturn('类型不可操作['.$aftersale_type_list[$aftersale['type']]['name'].']', -1); } @@ -785,7 +785,7 @@ class OrderAftersaleService [ 'checked_type' => 'in', 'key_name' => 'refundment', - 'checked_data' => array_column(lang('common_order_aftersale_refundment_list'), 'value'), + 'checked_data' => array_column(MyConst('common_order_aftersale_refundment_list'), 'value'), 'error_msg' => '退款方式有误', ], ]; @@ -805,7 +805,7 @@ class OrderAftersaleService // 状态校验 if($aftersale['status'] != 2) { - $status_list = lang('common_order_aftersale_status_list'); + $status_list = MyConst('common_order_aftersale_status_list'); return DataReturn('状态不可操作['.$status_list[$aftersale['status']]['name'].']', -1); } @@ -1247,7 +1247,7 @@ class OrderAftersaleService // 状态校验 if(!in_array($aftersale['status'], [0,2])) { - $status_list = lang('common_order_aftersale_status_list'); + $status_list = MyConst('common_order_aftersale_status_list'); return DataReturn('状态不可操作['.$status_list[$aftersale['status']]['name'].']', -1); } @@ -1332,7 +1332,7 @@ class OrderAftersaleService // 状态校验 if(!in_array($aftersale['status'], [4,5])) { - $status_list = lang('common_order_aftersale_status_list'); + $status_list = MyConst('common_order_aftersale_status_list'); return DataReturn('状态不可操作['.$status_list[$aftersale['status']]['name'].']', -1); } diff --git a/app/service/OrderService.php b/app/service/OrderService.php index f847488be..acfeba254 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -109,7 +109,7 @@ class OrderService $operate = self::OrderOperateData($order, 'user'); if($operate['is_pay'] != 1) { - $status_text = lang('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.'-'.$order['order_no'].']', -1); } @@ -424,7 +424,7 @@ class OrderService $operate = self::OrderOperateData($order, 'admin'); if($operate['is_pay'] != 1) { - $status_text = lang('common_order_admin_status')[$order['status']]['name']; + $status_text = MyConst('common_order_admin_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.'-'.$order['order_no'].']', -1); } @@ -1180,10 +1180,10 @@ class OrderService $user_type = isset($params['user_type']) ? $params['user_type'] : 'user'; // 静态数据 - $order_status_list = lang('common_order_user_status'); - $order_pay_status = lang('common_order_pay_status'); - $common_platform_type = lang('common_platform_type'); - $common_site_type_list = lang('common_site_type_list'); + $order_status_list = MyConst('common_order_user_status'); + $order_pay_status = MyConst('common_order_pay_status'); + $common_platform_type = MyConst('common_platform_type'); + $common_site_type_list = MyConst('common_site_type_list'); // 仓库信息 if(in_array('warehouse_id', $keys)) @@ -1453,8 +1453,8 @@ class OrderService $data = Db::name('OrderAftersale')->where(['order_id'=>$order_id])->field('status,type,number,price,reason,msg')->order('id desc')->find(); if(!empty($data)) { - $type_list = lang('common_order_aftersale_type_list'); - $status_list = lang('common_order_aftersale_status_list'); + $type_list = MyConst('common_order_aftersale_type_list'); + $status_list = MyConst('common_order_aftersale_status_list'); // 类型 $data['type_text'] = array_key_exists($data['type'], $type_list) ? $type_list[$data['type']]['name'] : ''; @@ -1652,7 +1652,7 @@ class OrderService public static function OrderHistoryAdd($order_id, $new_status, $original_status, $msg = '', $creator = 0, $creator_name = '') { // 状态描述 - $order_status_list = lang('common_order_user_status'); + $order_status_list = MyConst('common_order_user_status'); $original_status_name = $order_status_list[$original_status]['name']; $new_status_name = $order_status_list[$new_status]['name']; $msg .= '['.$original_status_name.'-'.$new_status_name.']'; @@ -1729,7 +1729,7 @@ class OrderService $operate = self::OrderOperateData($order, $user_type); if($operate['is_cancel'] != 1) { - $status_text = lang('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -1812,7 +1812,7 @@ class OrderService $operate = self::OrderOperateData($order, $user_type); if($operate['is_delivery'] != 1) { - $status_text = lang('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -1949,7 +1949,7 @@ class OrderService $operate = self::OrderOperateData($order, $user_type); if($operate['is_collect'] != 1) { - $status_text = lang('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -2043,7 +2043,7 @@ class OrderService $operate = self::OrderOperateData($order, $user_type); if($operate['is_confirm'] != 1) { - $status_text = lang('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -2147,7 +2147,7 @@ class OrderService $operate = self::OrderOperateData($order, $user_type); if($operate['is_delete'] != 1) { - $status_text = lang('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_user_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -2179,7 +2179,7 @@ class OrderService { // 状态数据封装 $result = []; - $order_status_list = lang('common_order_user_status'); + $order_status_list = MyConst('common_order_user_status'); foreach($order_status_list as $v) { $result[] = [ diff --git a/app/service/PaymentService.php b/app/service/PaymentService.php index 245ddf80e..46540d6bb 100755 --- a/app/service/PaymentService.php +++ b/app/service/PaymentService.php @@ -78,7 +78,7 @@ class PaymentService { if($dh = opendir(self::$payment_dir)) { - $common_platform_type = lang('common_platform_type'); + $common_platform_type = MyConst('common_platform_type'); while(($temp_file = readdir($dh)) !== false) { if(substr($temp_file, 0, 1) != '.') @@ -176,7 +176,7 @@ class PaymentService 'is_enable' => 0, 'is_open_user' => 0, 'is_install' => 0, - 'apply_terminal' => empty($data['base']['apply_terminal']) ? array_column(lang('common_platform_type'), 'value') : $data['base']['apply_terminal'], + 'apply_terminal' => empty($data['base']['apply_terminal']) ? array_column(MyConst('common_platform_type'), 'value') : $data['base']['apply_terminal'], 'config' => '', ]; } diff --git a/app/service/QuickNavService.php b/app/service/QuickNavService.php index d01fd7bf8..a32aaecf3 100755 --- a/app/service/QuickNavService.php +++ b/app/service/QuickNavService.php @@ -42,8 +42,8 @@ class QuickNavService $data = Db::name('QuickNav')->where($where)->order($order_by)->limit($m, $n)->select()->toArray(); if(!empty($data)) { - $common_platform_type = lang('common_platform_type'); - $common_app_event_type = lang('common_app_event_type'); + $common_platform_type = MyConst('common_platform_type'); + $common_app_event_type = MyConst('common_app_event_type'); foreach($data as &$v) { // 平台类型 @@ -114,13 +114,13 @@ class QuickNavService [ 'checked_type' => 'in', 'key_name' => 'platform', - 'checked_data' => array_column(lang('common_platform_type'), 'value'), + 'checked_data' => array_column(MyConst('common_platform_type'), 'value'), 'error_msg' => '平台类型有误', ], [ 'checked_type' => 'in', 'key_name' => 'event_type', - 'checked_data' => array_column(lang('common_app_event_type'), 'value'), + 'checked_data' => array_column(MyConst('common_app_event_type'), 'value'), 'is_checked' => 2, 'error_msg' => '事件值类型有误', ], diff --git a/app/service/RefundLogService.php b/app/service/RefundLogService.php index 42600a45b..56da85b7e 100644 --- a/app/service/RefundLogService.php +++ b/app/service/RefundLogService.php @@ -98,7 +98,7 @@ class RefundLogService $data = Db::name('RefundLog')->where($where)->field($field)->limit($m, $n)->order($order_by)->select()->toArray(); if(!empty($data)) { - $refundment_list = lang('common_order_aftersale_refundment_list'); + $refundment_list = MyConst('common_order_aftersale_refundment_list'); foreach($data as &$v) { // 用户信息 diff --git a/app/service/SlideService.php b/app/service/SlideService.php index 39f4307be..8b5d4d50b 100755 --- a/app/service/SlideService.php +++ b/app/service/SlideService.php @@ -42,9 +42,9 @@ class SlideService $data = Db::name('Slide')->field($field)->where($where)->order($order_by)->limit($m, $n)->select()->toArray(); if(!empty($data)) { - $common_platform_type = lang('common_platform_type'); - $common_is_enable_tips = lang('common_is_enable_tips'); - $common_app_event_type = lang('common_app_event_type'); + $common_platform_type = MyConst('common_platform_type'); + $common_is_enable_tips = MyConst('common_is_enable_tips'); + $common_app_event_type = MyConst('common_app_event_type'); foreach($data as &$v) { // 图片地址 @@ -104,13 +104,13 @@ class SlideService [ 'checked_type' => 'in', 'key_name' => 'platform', - 'checked_data' => array_column(lang('common_platform_type'), 'value'), + 'checked_data' => array_column(MyConst('common_platform_type'), 'value'), 'error_msg' => '平台类型有误', ], [ 'checked_type' => 'in', 'key_name' => 'event_type', - 'checked_data' => array_column(lang('common_app_event_type'), 'value'), + 'checked_data' => array_column(MyConst('common_app_event_type'), 'value'), 'is_checked' => 2, 'error_msg' => '事件值类型有误', ], diff --git a/app/service/StatisticalService.php b/app/service/StatisticalService.php index 508865ff6..ebd9dbe72 100755 --- a/app/service/StatisticalService.php +++ b/app/service/StatisticalService.php @@ -390,7 +390,7 @@ class StatisticalService self::Init($params); // 订单状态列表 - $order_status_list = lang('common_order_user_status'); + $order_status_list = MyConst('common_order_user_status'); $status_arr = array_column($order_status_list, 'id'); // 循环获取统计数据 @@ -452,7 +452,7 @@ class StatisticalService self::Init($params); // 订单状态列表 - $order_status_list = lang('common_order_user_status'); + $order_status_list = MyConst('common_order_user_status'); $status_arr = array_column($order_status_list, 'id'); // 循环获取统计数据 diff --git a/app/service/UserService.php b/app/service/UserService.php index 0b074956f..30583fbc7 100755 --- a/app/service/UserService.php +++ b/app/service/UserService.php @@ -111,7 +111,7 @@ class UserService } if(!in_array($user['status'], [0,1])) { - $common_user_status_list = lang('common_user_status_list'); + $common_user_status_list = MyConst('common_user_status_list'); if(isset($common_user_status_list[$user['status']])) { return DataReturn($common_user_status_list[$user['status']]['tips'], -110); @@ -152,8 +152,8 @@ class UserService ]); // 开始处理数据 - $common_gender_list = lang('common_gender_list'); - $common_user_status_list = lang('common_user_status_list'); + $common_gender_list = MyConst('common_gender_list'); + $common_user_status_list = MyConst('common_user_status_list'); foreach($data as &$v) { // 生日 @@ -277,13 +277,13 @@ class UserService [ 'checked_type' => 'in', 'key_name' => 'gender', - 'checked_data' => array_column(lang('common_gender_list'), 'id'), + 'checked_data' => array_column(MyConst('common_gender_list'), 'id'), 'error_msg' => '性别值范围不正确', ], [ 'checked_type' => 'in', 'key_name' => 'status', - 'checked_data' => array_column(lang('common_user_status_list'), 'id'), + 'checked_data' => array_column(MyConst('common_user_status_list'), 'id'), 'error_msg' => '状态值范围不正确', ], [ @@ -498,7 +498,7 @@ class UserService } if(isset($user['gender'])) { - $user['gender_text'] = lang('common_gender_list')[$user['gender']]['name']; + $user['gender_text'] = MyConst('common_gender_list')[$user['gender']]['name']; } if(isset($user['birthday'])) { @@ -663,7 +663,7 @@ class UserService [ 'checked_type' => 'in', 'key_name' => 'type', - 'checked_data' => array_column(lang('common_login_type_list'), 'value'), + 'checked_data' => array_column(MyConst('common_login_type_list'), 'value'), 'error_msg' => '登录类型有误', ], [ @@ -786,7 +786,7 @@ class UserService // 用户状态 if(in_array($user['status'], [2,3])) { - return DataReturn(lang('common_user_status_list')[$user['status']]['tips'], -10); + return DataReturn(MyConst('common_user_status_list')[$user['status']]['tips'], -10); } // 用户登录前钩子 @@ -899,7 +899,7 @@ class UserService [ 'checked_type' => 'in', 'key_name' => 'type', - 'checked_data' => array_column(lang('common_user_reg_type_list'), 'value'), + 'checked_data' => array_column(MyConst('common_user_reg_type_list'), 'value'), 'error_msg' => '注册类型有误', ], [ @@ -1220,7 +1220,7 @@ class UserService [ 'checked_type' => 'in', 'key_name' => 'type', - 'checked_data' => array_column(lang('common_login_type_list'), 'value'), + 'checked_data' => array_column(MyConst('common_login_type_list'), 'value'), 'error_msg' => '登录类型有误', ], ]; @@ -1322,7 +1322,7 @@ class UserService [ 'checked_type' => 'in', 'key_name' => 'type', - 'checked_data' => array_column(lang('common_user_reg_type_list'), 'value'), + 'checked_data' => array_column(MyConst('common_user_reg_type_list'), 'value'), 'error_msg' => '注册类型有误', ], ]; @@ -2163,7 +2163,7 @@ class UserService ]; // 是否小程序请求 - $is_appmini = array_key_exists(APPLICATION_CLIENT_TYPE, lang('common_appmini_type')); + $is_appmini = array_key_exists(APPLICATION_CLIENT_TYPE, MyConst('common_appmini_type')); // 手机号码获取用户信息 $mobile_user = Db::name('User')->where([ diff --git a/extend/base/Excel.php b/extend/base/Excel.php index d5de5c8c8..e096a5bd3 100755 --- a/extend/base/Excel.php +++ b/extend/base/Excel.php @@ -126,7 +126,7 @@ class Excel // 获取配置编码类型 $excel_charset = MyC('admin_excel_charset', 0); - $charset = lang('common_excel_charset_list')[$excel_charset]['value']; + $charset = MyConst('common_excel_charset_list')[$excel_charset]['value']; // 水平,垂直居中 if($this->horizontal_center == 1) diff --git a/extend/base/Images.php b/extend/base/Images.php index 92f554d3e..95e9a84ad 100755 --- a/extend/base/Images.php +++ b/extend/base/Images.php @@ -70,7 +70,10 @@ class Images */ private function IsGD() { - if(!isset(gd_info()['GD Version']) || empty(gd_info()['GD Version'])) Api_Return(lang('code_412'), 412); + if(!isset(gd_info()['GD Version']) || empty(gd_info()['GD Version'])) + { + die('not support gd'); + } } /** diff --git a/public/core.php b/public/core.php index cb1351d5e..b32ea7a15 100755 --- a/public/core.php +++ b/public/core.php @@ -10,7 +10,7 @@ // +---------------------------------------------------------------------- // 系统版本 -define('APPLICATION_VERSION', 'v2.2.0'); +define('APPLICATION_VERSION', 'v2.2.1'); // 检测PHP环境 if(version_compare(PHP_VERSION,'7.2.5','<')) diff --git a/sourcecode/alipay/default/pages/common/copyright.axml b/sourcecode/alipay/default/pages/common/copyright.axml index b8f9b153d..22341eca6 100644 --- a/sourcecode/alipay/default/pages/common/copyright.axml +++ b/sourcecode/alipay/default/pages/common/copyright.axml @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/sourcecode/baidu/default/pages/common/copyright.swan b/sourcecode/baidu/default/pages/common/copyright.swan index b8f9b153d..22341eca6 100755 --- a/sourcecode/baidu/default/pages/common/copyright.swan +++ b/sourcecode/baidu/default/pages/common/copyright.swan @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/sourcecode/qq/default/pages/common/copyright.qml b/sourcecode/qq/default/pages/common/copyright.qml index b8f9b153d..22341eca6 100755 --- a/sourcecode/qq/default/pages/common/copyright.qml +++ b/sourcecode/qq/default/pages/common/copyright.qml @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/sourcecode/toutiao/default/pages/common/copyright.ttml b/sourcecode/toutiao/default/pages/common/copyright.ttml index b8f9b153d..22341eca6 100755 --- a/sourcecode/toutiao/default/pages/common/copyright.ttml +++ b/sourcecode/toutiao/default/pages/common/copyright.ttml @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/sourcecode/weixin/default/pages/common/copyright.wxml b/sourcecode/weixin/default/pages/common/copyright.wxml index b8f9b153d..22341eca6 100755 --- a/sourcecode/weixin/default/pages/common/copyright.wxml +++ b/sourcecode/weixin/default/pages/common/copyright.wxml @@ -1,5 +1,5 @@ \ No newline at end of file -- Gitee From bb3667ba6662eeb3a27d84823ef3b5183be8e6fc Mon Sep 17 00:00:00 2001 From: Devil Date: Sat, 14 Aug 2021 17:27:14 +0800 Subject: [PATCH 25/57] =?UTF-8?q?=E8=AF=AD=E8=A8=80=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/form/Order.php | 2 +- app/admin/lang/zh-cn.php | 94 +----- app/index/form/Order.php | 4 +- app/lang/zh-cn.php | 444 +-------------------------- app/service/ConstService.php | 17 +- app/service/GoodsCommentsService.php | 2 +- app/service/OrderService.php | 20 +- app/service/StatisticalService.php | 4 +- 8 files changed, 21 insertions(+), 566 deletions(-) diff --git a/app/admin/form/Order.php b/app/admin/form/Order.php index 8f20b01b9..e086a1bcd 100644 --- a/app/admin/form/Order.php +++ b/app/admin/form/Order.php @@ -88,7 +88,7 @@ class Order 'form_type' => 'select', 'form_name' => 'status', 'where_type' => 'in', - 'data' => MyConst('common_order_admin_status'), + 'data' => MyConst('common_order_status'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/admin/lang/zh-cn.php b/app/admin/lang/zh-cn.php index 307babc9a..113a119d0 100755 --- a/app/admin/lang/zh-cn.php +++ b/app/admin/lang/zh-cn.php @@ -16,97 +16,5 @@ * @version 0.0.1 * @datetime 2016-12-01T21:51:08+0800 */ -return [ - // 图片验证码 - 'site_images_verify_rules_list' => [ - 0 => ['value' => 'bgcolor', 'name' => '彩色背景'], - 1 => ['value' => 'textcolor', 'name' => '彩色文本'], - 2 => ['value' => 'point', 'name' => '干扰点'], - 3 => ['value' => 'line', 'name' => '干扰线'], - ], - - // 时区 - 'site_timezone_list' => [ - 'Pacific/Pago_Pago' => '(标准时-11:00) 中途岛、萨摩亚群岛', - 'Pacific/Rarotonga' => '(标准时-10:00) 夏威夷', - 'Pacific/Gambier' => '(标准时-9:00) 阿拉斯加', - 'America/Dawson' => '(标准时-8:00) 太平洋时间(美国和加拿大)', - 'America/Creston' => '(标准时-7:00) 山地时间(美国和加拿大)', - 'America/Belize' => '(标准时-6:00) 中部时间(美国和加拿大)、墨西哥城', - 'America/Eirunepe' => '(标准时-5:00) 东部时间(美国和加拿大)、波哥大', - 'America/Antigua' => '(标准时-4:00) 大西洋时间(加拿大)、加拉加斯', - 'America/Argentina/Buenos_Aires' => '(标准时-3:00) 巴西、布宜诺斯艾利斯、乔治敦', - 'America/Noronha' => '(标准时-2:00) 中大西洋', - 'Atlantic/Cape_Verde' => '(标准时-1:00) 亚速尔群岛、佛得角群岛', - 'Africa/Ouagadougou' => '(格林尼治标准时) 西欧时间、伦敦、卡萨布兰卡', - 'Europe/Andorra' => '(标准时+1:00) 中欧时间、安哥拉、利比亚', - 'Europe/Mariehamn' => '(标准时+2:00) 东欧时间、开罗,雅典', - 'Asia/Bahrain' => '(标准时+3:00) 巴格达、科威特、莫斯科', - 'Asia/Dubai' => '(标准时+4:00) 阿布扎比、马斯喀特、巴库', - 'Asia/Kolkata' => '(标准时+5:00) 叶卡捷琳堡、伊斯兰堡、卡拉奇', - 'Asia/Dhaka' => '(标准时+6:00) 阿拉木图、 达卡、新亚伯利亚', - 'Indian/Christmas' => '(标准时+7:00) 曼谷、河内、雅加达', - 'Asia/Shanghai' => '(标准时+8:00)北京、重庆、香港、新加坡', - 'Australia/Darwin' => '(标准时+9:00) 东京、汉城、大阪、雅库茨克', - 'Australia/Adelaide' => '(标准时+10:00) 悉尼、关岛', - 'Australia/Currie' => '(标准时+11:00) 马加丹、索罗门群岛', - 'Pacific/Fiji' => '(标准时+12:00) 奥克兰、惠灵顿、堪察加半岛' - ], - - // seo - // url模式列表 - 'seo_url_model_list' => [ - 0 => ['value' => 0, 'name' => '兼容模式', 'checked' => true], - 1 => ['value' => 1, 'name' => 'PATHINFO模式'], - 2 => ['value' => 2, 'name' => 'PATHINFO模式+短地址'], - ], - - // 用户excel导出标题列表 - 'excel_user_title_list' => [ - 'username' => [ - 'name' => '用户名', - 'type' => 'string', - ], - 'nickname' => [ - 'name' => '昵称', - 'type' => 'int', - ], - 'gender_text' => [ - 'name' => '性别', - 'type' => 'string', - ], - 'birthday_text'=> [ - 'name' => '生日', - 'type' => 'string', - ], - 'status_text'=> [ - 'name' => '状态', - 'type' => 'string', - ], - 'mobile' => [ - 'name' => '手机号码', - 'type' => 'int', - ], - 'email' => [ - 'name' => '电子邮箱', - 'type' => 'string', - ], - 'province' => [ - 'name' => '所在省', - 'type' => 'string', - ], - 'city' => [ - 'name' => '所在市', - 'type' => 'string', - ], - 'address' => [ - 'name' => '详细地址', - 'type' => 'string', - ], - 'add_time' => [ - 'name' => '注册时间', - 'type' => 'string', - ], - ], -]; +return []; ?> \ No newline at end of file diff --git a/app/index/form/Order.php b/app/index/form/Order.php index b921783b3..cc98ece6c 100644 --- a/app/index/form/Order.php +++ b/app/index/form/Order.php @@ -88,12 +88,12 @@ class Order 'view_type' => 'field', 'view_key' => 'status', 'view_data_key' => 'name', - 'view_data' => MyConst('common_order_user_status'), + 'view_data' => MyConst('common_order_status'), 'is_sort' => 1, 'search_config' => [ 'form_type' => 'select', 'where_type' => 'in', - 'data' => MyConst('common_order_user_status'), + 'data' => MyConst('common_order_status'), 'data_key' => 'id', 'data_name' => 'name', 'is_multiple' => 1, diff --git a/app/lang/zh-cn.php b/app/lang/zh-cn.php index d381c3252..e69962f9f 100755 --- a/app/lang/zh-cn.php +++ b/app/lang/zh-cn.php @@ -16,447 +16,5 @@ * @version 0.0.1 * @datetime 2016-12-01T21:51:08+0800 */ -return [ - // 系统版本列表 - 'common_system_version_list' => [ - '1.1.0' => ['value' => '1.1.0', 'name' => 'v1.1.0'], - '1.2.0' => ['value' => '1.2.0', 'name' => 'v1.2.0'], - '1.3.0' => ['value' => '1.3.0', 'name' => 'v1.3.0'], - '1.4.0' => ['value' => '1.4.0', 'name' => 'v1.4.0'], - '1.5.0' => ['value' => '1.5.0', 'name' => 'v1.5.0'], - '1.6.0' => ['value' => '1.6.0', 'name' => 'v1.6.0'], - '1.7.0' => ['value' => '1.7.0', 'name' => 'v1.7.0'], - '1.8.0' => ['value' => '1.8.0', 'name' => 'v1.8.0'], - '1.8.1' => ['value' => '1.8.1', 'name' => 'v1.8.1'], - '1.9.0' => ['value' => '1.9.0', 'name' => 'v1.9.0'], - '1.9.1' => ['value' => '1.9.1', 'name' => 'v1.9.1'], - '1.9.2' => ['value' => '1.9.2', 'name' => 'v1.9.2'], - '1.9.3' => ['value' => '1.9.3', 'name' => 'v1.9.3'], - '2.0.0' => ['value' => '2.0.0', 'name' => 'v2.0.0'], - '2.0.1' => ['value' => '2.0.1', 'name' => 'v2.0.1'], - '2.0.2' => ['value' => '2.0.2', 'name' => 'v2.0.2'], - '2.0.3' => ['value' => '2.0.3', 'name' => 'v2.0.3'], - '2.1.0' => ['value' => '2.1.0', 'name' => 'v2.1.0'], - '2.2.0' => ['value' => '2.2.0', 'name' => 'v2.2.0'], - ], - - // 用户注册类型列表 - 'common_user_reg_type_list' => [ - 0 => ['value' => 'sms', 'name' => '短信'], - 1 => ['value' => 'email', 'name' => '邮箱'], - 2 => ['value' => 'username', 'name' => '用户名'], - ], - - // 登录方式 - 'common_login_type_list' => [ - 0 => ['value' => 'username', 'name' => '帐号密码', 'checked' => true], - 1 => ['value' => 'email', 'name' => '邮箱验证码'], - 2 => ['value' => 'sms', 'name' => '手机验证码'], - ], - - // 性别 - 'common_gender_list' => [ - 0 => ['id' => 0, 'name' => '保密', 'checked' => true], - 1 => ['id' => 1, 'name' => '女'], - 2 => ['id' => 2, 'name' => '男'], - ], - - // 关闭开启状态 - 'common_close_open_list' => [ - 0 => ['value' => 0, 'name' => '关闭'], - 1 => ['value' => 1, 'name' => '开启'], - ], - - // 是否启用 - 'common_is_enable_tips' => [ - 0 => ['id' => 0, 'name' => '未启用'], - 1 => ['id' => 1, 'name' => '已启用'], - ], - 'common_is_enable_list' => [ - 0 => ['id' => 0, 'name' => '不启用'], - 1 => ['id' => 1, 'name' => '启用', 'checked' => true], - ], - - // 是否显示 - 'common_is_show_list' => [ - 0 => ['id' => 0, 'name' => '不显示'], - 1 => ['id' => 1, 'name' => '显示', 'checked' => true], - ], - - // 状态 - 'common_state_list' => [ - 0 => ['id' => 0, 'name' => '不可用'], - 1 => ['id' => 1, 'name' => '可用', 'checked' => true], - ], - - // excel编码列表 - 'common_excel_charset_list' => [ - 0 => ['id' => 0, 'value' => 'utf-8', 'name' => 'utf-8', 'checked' => true], - 1 => ['id' => 1, 'value' => 'gbk', 'name' => 'gbk'], - ], - - // 支付状态 - 'common_order_pay_status' => [ - 0 => ['id' => 0, 'name' => '待支付', 'checked' => true], - 1 => ['id' => 1, 'name' => '已支付'], - 2 => ['id' => 2, 'name' => '已退款'], - 3 => ['id' => 3, 'name' => '部分退款'], - ], - - // 用户端 - 订单管理 - 'common_order_user_status' => [ - 0 => ['id' => 0, 'name' => '待确认', 'checked' => true], - 1 => ['id' => 1, 'name' => '待付款'], - 2 => ['id' => 2, 'name' => '待发货'], - 3 => ['id' => 3, 'name' => '待收货'], - 4 => ['id' => 4, 'name' => '已完成'], - 5 => ['id' => 5, 'name' => '已取消'], - 6 => ['id' => 6, 'name' => '已关闭'], - ], - - // 后台管理 - 订单管理 - 'common_order_admin_status' => [ - 0 => ['id' => 0, 'name' => '待确认', 'checked' => true], - 1 => ['id' => 1, 'name' => '已确认/待支付'], - 2 => ['id' => 2, 'name' => '待发货/待取货'], - 3 => ['id' => 3, 'name' => '已发货/待收货'], - 4 => ['id' => 4, 'name' => '已完成'], - 5 => ['id' => 5, 'name' => '已取消'], - 6 => ['id' => 6, 'name' => '已关闭'], - ], - - // 优惠券类型 - 'common_coupon_type' => [ - 0 => ['id' => 0, 'name' => '缤纷活动', 'checked' => true], - 1 => ['id' => 1, 'name' => '注册送'], - ], - - // 用户优惠券状态 - 'common_user_coupon_status' => [ - 0 => ['id' => 0, 'name' => '未使用', 'checked' => true], - 1 => ['id' => 1, 'name' => '已使用'], - 2 => ['id' => 2, 'name' => '已过期'], - ], - - // 所属平台 - 'common_platform_type' => [ - 'pc' => ['value' => 'pc', 'name' => 'PC网站'], - 'h5' => ['value' => 'h5', 'name' => 'H5手机网站'], - 'ios' => ['value' => 'ios', 'name' => '苹果APP'], - 'android' => ['value' => 'android', 'name' => '安卓APP'], - 'weixin' => ['value' => 'weixin', 'name' => '微信小程序'], - 'alipay' => ['value' => 'alipay', 'name' => '支付宝小程序'], - 'baidu' => ['value' => 'baidu', 'name' => '百度小程序'], - 'toutiao' => ['value' => 'toutiao', 'name' => '头条小程序'], - 'qq' => ['value' => 'qq', 'name' => 'QQ小程序'], - ], - - // app平台 - 'common_app_type' => [ - 'ios' => ['value' => 'ios', 'name' => '苹果APP'], - 'android' => ['value' => 'android', 'name' => '安卓APP'], - ], - - // 小程序平台 - 'common_appmini_type' => [ - 'weixin' => ['value' => 'weixin', 'name' => '微信小程序'], - 'alipay' => ['value' => 'alipay', 'name' => '支付宝小程序'], - 'baidu' => ['value' => 'baidu', 'name' => '百度小程序'], - 'toutiao' => ['value' => 'toutiao', 'name' => '头条小程序'], - 'qq' => ['value' => 'qq', 'name' => 'QQ小程序'], - ], - - // 小程序url跳转类型 - 'common_jump_url_type' => [ - 0 => ['value' => 0, 'name' => 'WEB页面'], - 1 => ['value' => 1, 'name' => '内部页面(小程序或APP内部地址)'], - 2 => ['value' => 2, 'name' => '外部小程序(同一个主体下的小程序appid)'], - ], - - // 扣除库存规则 - 'common_deduction_inventory_rules_list' => [ - 0 => ['id' => 0, 'name' => '订单确认成功'], - 1 => ['id' => 1, 'name' => '订单支付成功'], - 2 => ['id' => 2, 'name' => '订单发货'], - ], - - // 商品增加销量规则 - 'common_sales_count_inc_rules_list' => [ - 0 => ['id' => 0, 'name' => '订单支付'], - 1 => ['id' => 1, 'name' => '订单收货'], - ], - - // 是否已读 - 'common_is_read_list' => [ - 0 => ['id' => 0, 'name' => '未读', 'checked' => true], - 1 => ['id' => 1, 'name' => '已读'], - ], - - // 消息类型 - 'common_message_type_list' => [ - 0 => ['id' => 0, 'name' => '默认', 'checked' => true], - ], - - // 用户积分 - 操作类型 - 'common_integral_log_type_list' => [ - 0 => ['id' => 0, 'name' => '减少', 'checked' => true], - 1 => ['id' => 1, 'name' => '增加'], - ], - - // 是否上架/下架 - 'common_is_shelves_list' => [ - 0 => ['id' => 0, 'name' => '下架'], - 1 => ['id' => 1, 'name' => '上架', 'checked' => true], - ], - - // 是否 - 'common_is_text_list' => [ - 0 => ['id' => 0, 'name' => '否', 'checked' => true], - 1 => ['id' => 1, 'name' => '是'], - ], - - // 用户状态 - 'common_user_status_list' => [ - 0 => ['id' => 0, 'name' => '正常', 'checked' => true], - 1 => ['id' => 1, 'name' => '禁止发言', 'tips' => '用户被禁止发言'], - 2 => ['id' => 2, 'name' => '禁止登录', 'tips' => '用户被禁止登录'], - 3 => ['id' => 3, 'name' => '待审核', 'tips' => '用户等待审核中'], - ], - - // 导航数据类型 - 'common_nav_type_list' => [ - 'custom' => ['value'=>'custom', 'name'=>'自定义'], - 'article' => ['value'=>'article', 'name'=>'文章'], - 'customview' => ['value'=>'customview', 'name'=>'自定义页面'], - 'goods_category' => ['value'=>'goods_category', 'name'=>'商品分类'], - ], - - // 搜索框下热门关键字类型 - 'common_search_keywords_type_list' => [ - 0 => ['value' => 0, 'name' => '关闭'], - 1 => ['value' => 1, 'name' => '自动'], - 2 => ['value' => 2, 'name' => '自定义'], - ], - - // 发送状态 - 'common_send_status_list' => [ - 0 => ['value' => 0, 'name' => '未发送'], - 1 => ['value' => 1, 'name' => '发送中'], - 2 => ['value' => 2, 'name' => '发送成功'], - 3 => ['value' => 3, 'name' => '部分成功'], - 4 => ['value' => 4, 'name' => '发送失败'], - ], - - // 发布状态 - 'common_release_status_list' => [ - 0 => ['value' => 0, 'name' => '未发布'], - 1 => ['value' => 1, 'name' => '发布中'], - 2 => ['value' => 2, 'name' => '已发布'], - 3 => ['value' => 3, 'name' => '部分成功'], - 4 => ['value' => 4, 'name' => '发布失败'], - ], - - // 处理状态 - 'common_handle_status_list' => [ - 0 => ['value' => 0, 'name' => '未处理'], - 1 => ['value' => 1, 'name' => '处理中'], - 2 => ['value' => 2, 'name' => '已处理'], - 3 => ['value' => 3, 'name' => '部分成功'], - 4 => ['value' => 4, 'name' => '处理失败'], - ], - - // 支付宝生活号菜单事件类型 - 'common_alipay_life_menu_action_type_list' => [ - 0 => ['value' => 0, 'out_value' => 'out', 'name' => '事件型菜单'], - 1 => ['value' => 1, 'out_value' => 'link', 'name' => '链接型菜单'], - 2 => ['value' => 2, 'out_value' => 'tel', 'name' => '点击拨打电话'], - 3 => ['value' => 3, 'out_value' => 'map', 'name' => '点击查看地图'], - 4 => ['value' => 4, 'out_value' => 'consumption', 'name' => '点击查看用户与生活号'], - ], - - // app事件类型 - 'common_app_event_type' => [ - 0 => ['value' => 0, 'name' => 'WEB页面'], - 1 => ['value' => 1, 'name' => '内部页面(小程序/APP内部地址)'], - 2 => ['value' => 2, 'name' => '外部小程序(同一个主体下的小程序appid)'], - 3 => ['value' => 3, 'name' => '跳转原生地图查看指定位置'], - 4 => ['value' => 4, 'name' => '拨打电话'], - ], - - // 订单售后类型 - 'common_order_aftersale_type_list' => [ - 0 => ['value' => 0, 'name' => '仅退款', 'desc' => '未收到货(未签收),协商同意前提下', 'icon' => 'am-icon-random', 'class' => 'am-fl'], - 1 => ['value' => 1, 'name' => '退款退货', 'desc' => '已收到货,需要退换已收到的货物', 'icon' => 'am-icon-retweet', 'class' => 'am-fr'], - ], - - // 订单售后状态 - 'common_order_aftersale_status_list' => [ - 0 => ['value' => 0, 'name' => '待确认'], - 1 => ['value' => 1, 'name' => '待退货'], - 2 => ['value' => 2, 'name' => '待审核'], - 3 => ['value' => 3, 'name' => '已完成'], - 4 => ['value' => 4, 'name' => '已拒绝'], - 5 => ['value' => 5, 'name' => '已取消'], - ], - - // 订单售后退款方式 - 'common_order_aftersale_refundment_list' => [ - 0 => ['value' => 0, 'name' => '原路退回'], - 1 => ['value' => 1, 'name' => '退至钱包'], - 2 => ['value' => 2, 'name' => '手动处理'], - ], - - // 商品评分 - 'common_goods_comments_rating_list' => [ - 0 => ['value'=>0, 'name'=>'未评分', 'badge'=>''], - 1 => ['value'=>1, 'name'=>'1分', 'badge'=>'danger'], - 2 => ['value'=>2, 'name'=>'2分', 'badge'=>'warning'], - 3 => ['value'=>3, 'name'=>'3分', 'badge'=>'secondary'], - 4 => ['value'=>4, 'name'=>'4分', 'badge'=>'primary'], - 5 => ['value'=>5, 'name'=>'5分', 'badge'=>'success'], - ], - - // 商品评论业务类型 - 'common_goods_comments_business_type_list' => [ - 'order' => ['value' => 'order', 'name' => '订单'], - ], - - // 站点类型 - 'common_site_type_list' => [ - 0 => ['value' => 0, 'name' => '销售'], - 1 => ['value' => 1, 'name' => '展示'], - 2 => ['value' => 2, 'name' => '自提'], - 3 => ['value' => 3, 'name' => '虚拟销售'], - 4 => ['value' => 4, 'name' => '销售+自提', 'is_ext' => 1], - ], - - // 管理员状态 - 'common_admin_status_list' => [ - 0 => ['value' => 0, 'name' => '正常', 'checked' => true], - 1 => ['value' => 1, 'name' => '暂停'], - 2 => ['value' => 2, 'name' => '已离职'], - ], - - // 支付日志状态 - 'common_pay_log_status_list' => [ - 0 => ['value' => 0, 'name' => '待支付', 'checked' => true], - 1 => ['value' => 1, 'name' => '已支付'], - 2 => ['value' => 2, 'name' => '已关闭'], - ], - - // 商品参数组件类型 - 'common_goods_parameters_type_list' => [ - 0 => ['value' => 0, 'name' => '全部'], - 1 => ['value' => 1, 'name' => '详情', 'checked' => true], - 2 => ['value' => 2, 'name' => '基础'], - ], - - // 商品关联排序类型 - 'goods_order_by_type_list' => [ - 0 => ['value' => 'g.access_count,g.sales_count,g.id', 'name' => '综合', 'checked' => true], - 1 => ['value' => 'g.sales_count', 'name' => '销量'], - 2 => ['value' => 'g.access_count', 'name' => '热度'], - 3 => ['value' => 'g.min_price', 'name' => '价格'], - 4 => ['value' => 'g.id', 'name' => '最新'], - ], - - // 商品关联排序规则 - 'goods_order_by_rule_list' => [ - 0 => ['value' => 'desc', 'name' => '降序(desc)', 'checked' => true], - 1 => ['value' => 'asc', 'name' => '升序(asc)'], - ], - - // 首页数据类型 - 'common_site_floor_data_type_list' => [ - 0 => ['value' => 0, 'name' => '自动模式', 'checked' => true], - 1 => ['value' => 1, 'name' => '手动模式'], - 2 => ['value' => 2, 'name' => '拖拽模式'], - ], - - // 色彩值 - 'common_color_list' => [ - '', - 'am-badge-primary', - 'am-badge-secondary', - 'am-badge-success', - 'am-badge-warning', - 'am-badge-danger', - ], - - // 文件上传错误码 - 'common_file_upload_error_list' => [ - 1 => '文件大小超过服务器允许上传的最大值', - 2 => '文件大小超出浏览器限制,查看是否超过[站点设置->附件最大限制]', - 3 => '文件仅部分被上传', - 4 => '没有找到要上传的文件', - 5 => '没有找到服务器临时文件夹', - 6 => '没有找到服务器临时文件夹', - 7 => '文件写入失败', - 8 => '文件上传扩展没有打开', - ], - - // 正则 - // 用户名 - 'common_regex_username' => '^[A-Za-z0-9_]{2,18}$', - - // 用户名 - 'common_regex_pwd' => '^.{6,18}$', - - // 手机号码 - 'common_regex_mobile' => '^1((3|4|5|6|7|8|9){1}\d{1})\d{8}$', - - // 座机号码 - 'common_regex_tel' => '^\d{3,4}-?\d{8}$', - - // 电子邮箱 - 'common_regex_email' => '^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$', - - // 身份证号码 - 'common_regex_id_card' => '^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$', - - // 价格格式 - 'common_regex_price' => '^([0-9]{1}\d{0,7})(\.\d{1,2})?$', - - // ip - 'common_regex_ip' => '^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$', - - // url - 'common_regex_url' => '^http[s]?:\/\/[A-Za-z0-9-]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$', - - // 控制器名称 - 'common_regex_control' => '^[A-Za-z]{1}[A-Za-z0-9_]{0,29}$', - - // 方法名称 - 'common_regex_action' => '^[A-Za-z]{1}[A-Za-z0-9_]{0,29}$', - - // 顺序 - 'common_regex_sort' => '^[0-9]{1,3}$', - - // 日期 - 'common_regex_date' => '^\d{4}-\d{2}-\d{2}$', - - // 分数 - 'common_regex_score' => '^[0-9]{1,3}$', - - // 分页 - 'common_regex_page_number' => '^[1-9]{1}[0-9]{0,2}$', - - // 时段格式 10:00-10:45 - 'common_regex_interval' => '^\d{2}\:\d{2}\-\d{2}\:\d{2}$', - - // 颜色 - 'common_regex_color' => '^(#([a-fA-F0-9]{6}|[a-fA-F0-9]{3}))?$', - - // id逗号隔开 - 'common_regex_id_comma_split' => '^\d(\d|,?)*\d$', - - // url伪静态后缀 - 'common_regex_url_html_suffix' => '^[a-z]{0,8}$', - - // 图片比例值 - 'common_regex_image_proportion' => '^([1-9]{1}[0-9]?|[1-9]{1}[0-9]?\.{1}[0-9]{1,2}|100|0)?$', - - // 版本号 - 'common_regex_version' => '^[0-9]{1,6}\.[0-9]{1,6}\.[0-9]{1,6}$', -]; +return []; ?> \ No newline at end of file diff --git a/app/service/ConstService.php b/app/service/ConstService.php index d6b264e9d..601fe98bc 100644 --- a/app/service/ConstService.php +++ b/app/service/ConstService.php @@ -114,7 +114,7 @@ class ConstService 1 => ['id' => 1, 'value' => 'gbk', 'name' => 'gbk'], ], - // 支付状态 + // 支付支付状态 'common_order_pay_status' => [ 0 => ['id' => 0, 'name' => '待支付', 'checked' => true], 1 => ['id' => 1, 'name' => '已支付'], @@ -122,8 +122,8 @@ class ConstService 3 => ['id' => 3, 'name' => '部分退款'], ], - // 用户端 - 订单管理 - 'common_order_user_status' => [ + // 订单状态 + 'common_order_status' => [ 0 => ['id' => 0, 'name' => '待确认', 'checked' => true], 1 => ['id' => 1, 'name' => '待付款'], 2 => ['id' => 2, 'name' => '待发货'], @@ -133,17 +133,6 @@ class ConstService 6 => ['id' => 6, 'name' => '已关闭'], ], - // 后台管理 - 订单管理 - 'common_order_admin_status' => [ - 0 => ['id' => 0, 'name' => '待确认', 'checked' => true], - 1 => ['id' => 1, 'name' => '已确认/待支付'], - 2 => ['id' => 2, 'name' => '待发货/待取货'], - 3 => ['id' => 3, 'name' => '已发货/待收货'], - 4 => ['id' => 4, 'name' => '已完成'], - 5 => ['id' => 5, 'name' => '已取消'], - 6 => ['id' => 6, 'name' => '已关闭'], - ], - // 所属平台 'common_platform_type' => [ 'pc' => ['value' => 'pc', 'name' => 'PC网站'], diff --git a/app/service/GoodsCommentsService.php b/app/service/GoodsCommentsService.php index c17bdeaeb..dc086d6f0 100644 --- a/app/service/GoodsCommentsService.php +++ b/app/service/GoodsCommentsService.php @@ -140,7 +140,7 @@ class GoodsCommentsService } if($order['status'] != 4) { - $status_text = MyConst('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } if($order['user_is_comments'] != 0) diff --git a/app/service/OrderService.php b/app/service/OrderService.php index acfeba254..e02088905 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -109,7 +109,7 @@ class OrderService $operate = self::OrderOperateData($order, 'user'); if($operate['is_pay'] != 1) { - $status_text = MyConst('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.'-'.$order['order_no'].']', -1); } @@ -424,7 +424,7 @@ class OrderService $operate = self::OrderOperateData($order, 'admin'); if($operate['is_pay'] != 1) { - $status_text = MyConst('common_order_admin_status')[$order['status']]['name']; + $status_text = MyConst('common_order_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.'-'.$order['order_no'].']', -1); } @@ -1180,7 +1180,7 @@ class OrderService $user_type = isset($params['user_type']) ? $params['user_type'] : 'user'; // 静态数据 - $order_status_list = MyConst('common_order_user_status'); + $order_status_list = MyConst('common_order_status'); $order_pay_status = MyConst('common_order_pay_status'); $common_platform_type = MyConst('common_platform_type'); $common_site_type_list = MyConst('common_site_type_list'); @@ -1652,7 +1652,7 @@ class OrderService public static function OrderHistoryAdd($order_id, $new_status, $original_status, $msg = '', $creator = 0, $creator_name = '') { // 状态描述 - $order_status_list = MyConst('common_order_user_status'); + $order_status_list = MyConst('common_order_status'); $original_status_name = $order_status_list[$original_status]['name']; $new_status_name = $order_status_list[$new_status]['name']; $msg .= '['.$original_status_name.'-'.$new_status_name.']'; @@ -1729,7 +1729,7 @@ class OrderService $operate = self::OrderOperateData($order, $user_type); if($operate['is_cancel'] != 1) { - $status_text = MyConst('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -1812,7 +1812,7 @@ class OrderService $operate = self::OrderOperateData($order, $user_type); if($operate['is_delivery'] != 1) { - $status_text = MyConst('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -1949,7 +1949,7 @@ class OrderService $operate = self::OrderOperateData($order, $user_type); if($operate['is_collect'] != 1) { - $status_text = MyConst('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -2043,7 +2043,7 @@ class OrderService $operate = self::OrderOperateData($order, $user_type); if($operate['is_confirm'] != 1) { - $status_text = MyConst('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -2147,7 +2147,7 @@ class OrderService $operate = self::OrderOperateData($order, $user_type); if($operate['is_delete'] != 1) { - $status_text = MyConst('common_order_user_status')[$order['status']]['name']; + $status_text = MyConst('common_order_status')[$order['status']]['name']; return DataReturn('状态不可操作['.$status_text.']', -1); } @@ -2179,7 +2179,7 @@ class OrderService { // 状态数据封装 $result = []; - $order_status_list = MyConst('common_order_user_status'); + $order_status_list = MyConst('common_order_status'); foreach($order_status_list as $v) { $result[] = [ diff --git a/app/service/StatisticalService.php b/app/service/StatisticalService.php index ebd9dbe72..52238f3bc 100755 --- a/app/service/StatisticalService.php +++ b/app/service/StatisticalService.php @@ -390,7 +390,7 @@ class StatisticalService self::Init($params); // 订单状态列表 - $order_status_list = MyConst('common_order_user_status'); + $order_status_list = MyConst('common_order_status'); $status_arr = array_column($order_status_list, 'id'); // 循环获取统计数据 @@ -452,7 +452,7 @@ class StatisticalService self::Init($params); // 订单状态列表 - $order_status_list = MyConst('common_order_user_status'); + $order_status_list = MyConst('common_order_status'); $status_arr = array_column($order_status_list, 'id'); // 循环获取统计数据 -- Gitee From f8d19863efef388c82fd3bea4507130885dd37a6 Mon Sep 17 00:00:00 2001 From: Devil Date: Sat, 14 Aug 2021 21:30:06 +0800 Subject: [PATCH 26/57] =?UTF-8?q?=E5=B8=B8=E9=87=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/ConstService.php | 51 ++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/app/service/ConstService.php b/app/service/ConstService.php index 601fe98bc..709ed091c 100644 --- a/app/service/ConstService.php +++ b/app/service/ConstService.php @@ -21,7 +21,7 @@ namespace app\service; class ConstService { /** - * 数据定义容器 + * 获取数据 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 @@ -33,7 +33,37 @@ class ConstService public static function Run($key = '', $default = null) { // 数据定义 - $container = [ + $container = self::ConstData(); + + // 匹配数据 + // 空 key 则返回全部 + // 未匹配到数据则返回null + $data = empty($key) ? $container : (array_key_exists($key, $container) ? $container[$key] : $default); + + // 常量数据读取钩子 + $hook_name = 'plugins_service_const_data'; + MyEventTrigger($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'key' => $key, + 'default' => $default, + 'data' => &$data, + ]); + + return $data; + } + + /** + * 数据定义容器 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-14 + * @desc description + */ + public static function ConstData() + { + return [ // -------------------- 公共 -------------------- // 系统版本列表 'common_system_version_list' => [ @@ -496,23 +526,6 @@ class ConstService ], ], ]; - - // 匹配数据 - // 空 key 则返回全部 - // 未匹配到数据则返回null - $data = empty($key) ? $container : (array_key_exists($key, $container) ? $container[$key] : $default); - - // 常量数据读取钩子 - $hook_name = 'plugins_service_const_data'; - MyEventTrigger($hook_name, [ - 'hook_name' => $hook_name, - 'is_backend' => true, - 'key' => $key, - 'default' => $default, - 'data' => &$data, - ]); - - return $data; } } ?> \ No newline at end of file -- Gitee From c3bd59f15b585bc5f85fc8c943ee20b47e51365e Mon Sep 17 00:00:00 2001 From: Devil Date: Sat, 14 Aug 2021 21:57:56 +0800 Subject: [PATCH 27/57] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E7=BC=93=E5=AD=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/PackageInstallService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/service/PackageInstallService.php b/app/service/PackageInstallService.php index fe9ed7fc7..4c939cb8a 100644 --- a/app/service/PackageInstallService.php +++ b/app/service/PackageInstallService.php @@ -177,8 +177,8 @@ class PackageInstallService $ret = DataReturn('插件操作类型未定义['.$params['type'].']', -1); } - // 移除session - MySession($params['key'], null); + // 移除缓存 + MyCache($params['key'], null); // 删除本地文件 \base\FileUtil::UnlinkFile($res['url']); @@ -198,7 +198,7 @@ class PackageInstallService public static function DownloadHandle($key) { // 获取下载地址 - $url = MySession($key); + $url = MyCache($key); if(empty($url)) { return DataReturn('下载地址为空', -1); @@ -247,7 +247,7 @@ class PackageInstallService if(!empty($ret) && isset($ret['code']) && $ret['code'] == 0) { $key = md5($ret['data']); - MySession($key, $ret['data']); + MyCache($key, $ret['data'], 600); $ret['data'] = $key; } return $ret; -- Gitee From 9dbe3005f0bd48bb6f87a755a9ca8292f861067d Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 15 Aug 2021 16:43:18 +0800 Subject: [PATCH 28/57] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/common/js/common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index 787b91aa3..70b9ba9d3 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -290,11 +290,12 @@ function FromInit(form_name) // 错误 onInValid: function(validity) { + var $this = this; setTimeout(function() { // 错误信息 var $field = $(validity.field); - var msg = $field.data('validationMessage') || this.getValidationMessage(validity); + var msg = $field.data('validationMessage') || $this.getValidationMessage(validity); if($field.hasClass('am-field-error')) { Prompt(msg); -- Gitee From bfb462b62370b08bf5a6860e68cbf32e4adc55ed Mon Sep 17 00:00:00 2001 From: Devil Date: Mon, 16 Aug 2021 13:18:33 +0800 Subject: [PATCH 29/57] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/common/css/common.css | 12 ++--- public/static/common/js/common.js | 81 +++++++++++++++++------------ 2 files changed, 55 insertions(+), 38 deletions(-) diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css index f400fbbad..cad41f45c 100755 --- a/public/static/common/css/common.css +++ b/public/static/common/css/common.css @@ -63,12 +63,12 @@ form.am-form .am-form-group-refreshing, .plug-file-upload-view { border-bottom: /** * 公共提示信息 */ -#common-prompt {position:fixed;top:20px;left:0;right:0;text-align:center;padding:10px 15px;font-size:14px;z-index:10000; border-radius: 2px; width: 260px; margin: 0 auto; word-break: break-all;} -#common-prompt.am-alert-danger { background-color: #fef0f0; border-color: #f9d4d4; color: #f56c6c; box-shadow: 0 2px 4px #fef0f0, 0 0 6px rgba(0, 0, 0, 0); } -#common-prompt.am-alert-warning { background-color: #ffe7d5; border-color: #fbceac; color: #f37b1d; box-shadow: 0 2px 4px #ffe7d5, 0 0 6px rgba(0, 0, 0, 0); } -#common-prompt.am-alert-success { background-color: #e3fbd6; border-color: #bbe8a3; color: #67c23a; box-shadow: 0 2px 4px #e3fbd6, 0 0 6px rgba(0, 0, 0, 0); } -#common-prompt .prompt-content { text-align: left; font-size: 12px; } -#common-prompt .prompt-msg {width: calc(100% - 50px);display: -webkit-inline-box;} +.common-prompt {position:fixed;top:20px;left:0;right:0;text-align:center;padding:10px 15px;font-size:14px;z-index:10000; border-radius: 2px; width: 260px; margin: 0 auto; word-break: break-all;} +.common-prompt.am-alert-danger { background-color: #fef0f0; border-color: #f9d4d4; color: #f56c6c; box-shadow: 0 2px 4px #fef0f0, 0 0 6px rgba(0, 0, 0, 0); } +.common-prompt.am-alert-warning { background-color: #ffe7d5; border-color: #fbceac; color: #f37b1d; box-shadow: 0 2px 4px #ffe7d5, 0 0 6px rgba(0, 0, 0, 0); } +.common-prompt.am-alert-success { background-color: #e3fbd6; border-color: #bbe8a3; color: #67c23a; box-shadow: 0 2px 4px #e3fbd6, 0 0 6px rgba(0, 0, 0, 0); } +.common-prompt .prompt-content { text-align: left; font-size: 12px; } +.common-prompt .prompt-msg {width: calc(100% - 50px);display: -webkit-inline-box;} /** * 默认地图宽高 diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index 70b9ba9d3..4b50582a5 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -8,48 +8,66 @@ * @param {[string]} type [类型(失败:error, 警告:warning, 成功:success)] * @param {[int]} time [自动关闭时间(秒), 默认3秒] */ -var temp_time_out; + function Prompt(msg, type, time) { if(msg != undefined && msg != '') { - // 是否已存在提示条 - if($('#common-prompt').length > 0) + // 存在的提示信息则不继续 + var status = true; + $('.common-prompt').each(function(k, v) { - clearTimeout(temp_time_out); - } - - // 提示信息添加 - $('#common-prompt').remove(); - if((type || null) == null) + if(status && $(this).find('.prompt-msg').text() == msg) + { + status = false; + } + }); + if(status) { - type = 'danger'; - } + // 是否已存在提示条 + var height = 55; + var length = $('.common-prompt').length; - // icon图标, 默认错误 - var icon = 'am-icon-times-circle'; - switch(type) - { - // 成功 - case 'success' : - icon = 'am-icon-check-circle'; - break; + // 提示信息添加 + if((type || null) == null) + { + type = 'danger'; + } - // 警告 - case 'warning' : - icon = 'am-icon-exclamation-circle'; - break; + // icon图标, 默认错误 + var icon = 'am-icon-times-circle'; + switch(type) + { + // 成功 + case 'success' : + icon = 'am-icon-check-circle'; + break; - } - var html = '

'+msg+'

'; - $('body').append(html); + // 警告 + case 'warning' : + icon = 'am-icon-exclamation-circle'; + break; + } + var index = parseInt(Math.random()*1000001); + var html = '

'+msg+'

'; + $('body').append(html); - // 自动关闭提示 - temp_time_out = setTimeout(function() - { - $('#common-prompt').slideToggle(); - }, (time || 3)*1000); + // 自动关闭提示 + setTimeout(function() + { + $('.common-prompt-'+index).slideToggle(300, function() + { + $('.common-prompt-'+index).remove(); + $('.common-prompt').each(function(k, v) + { + $(this).animate({'top':(k*height+20)+'px'}); + }); + }); + }, (time || 3)*1000); + return true; + } } + return false; } /** @@ -138,7 +156,6 @@ function GetFormVal(element, is_json) { if($(this).is(':checked')) { - console.log(tmp); if(tmp_all[tmp.name] == undefined) { tmp_all[tmp.name] = []; -- Gitee From c749c90d3d9cfb55fb363c121365aded04d1d66b Mon Sep 17 00:00:00 2001 From: Devil Date: Mon, 16 Aug 2021 13:19:12 +0800 Subject: [PATCH 30/57] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/common/js/common.js | 1 - 1 file changed, 1 deletion(-) diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index 4b50582a5..134a793ae 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -8,7 +8,6 @@ * @param {[string]} type [类型(失败:error, 警告:warning, 成功:success)] * @param {[int]} time [自动关闭时间(秒), 默认3秒] */ - function Prompt(msg, type, time) { if(msg != undefined && msg != '') -- Gitee From 2af06ced33a538598473b45b9980c4cf2ff0948d Mon Sep 17 00:00:00 2001 From: Devil Date: Mon, 16 Aug 2021 18:51:36 +0800 Subject: [PATCH 31/57] =?UTF-8?q?=E9=95=82=E7=A9=BA=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/common/css/common.css | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css index cad41f45c..dceec01d0 100755 --- a/public/static/common/css/common.css +++ b/public/static/common/css/common.css @@ -770,31 +770,61 @@ button.colorpicker-submit img { background: transparent; color: #999; } +a.am-badge-default-plain:hover, +a.am-badge-default-plain:focus { + color: #666; + border: 1px solid #666; +} .am-badge-primary-plain { border: 1px solid #0e90d2; background: transparent; color: #0e90d2; } +a.am-badge-primary-plain:hover, +a.am-badge-primary-plain:focus { + color: #0071aa; + border: 1px solid #0071aa; +} .am-badge-secondary-plain { border: 1px solid #3bb4f2; background: transparent; color: #3bb4f2; } +a.am-badge-secondary-plain:hover, +a.am-badge-secondary-plain:focus { + color: #03a9f4; + border: 1px solid #03a9f4; +} .am-badge-success-plain { border: 1px solid #5eb95e; background: transparent; color: #5eb95e; } +a.am-badge-success-plain:hover, +a.am-badge-success-plain:focus { + color: #4caf50; + border: 1px solid #4caf50; +} .am-badge-warning-plain { border: 1px solid #F37B1D; background: transparent; color: #F37B1D; } +a.am-badge-warning-plain:hover, +a.am-badge-warning-plain:focus { + color: #ff7000; + border: 1px solid #ff7000; +} .am-badge-danger-plain { border: 1px solid #dd514c; background: transparent; color: #dd514c; } +a.am-badge-danger-plain:hover, +a.am-badge-danger-plain:focus { + color: #ee2d26; + border: 1px solid #ee2d26; +} /** * 分页 -- Gitee From 65da8bb3bf3426e9578ca17123728a8bd89815c7 Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 17 Aug 2021 11:29:52 +0800 Subject: [PATCH 32/57] =?UTF-8?q?=20=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98?= =?UTF-8?q?=20urlencode=20=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/payment/Weixin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extend/payment/Weixin.php b/extend/payment/Weixin.php index 6292a524e..ad1f0987e 100755 --- a/extend/payment/Weixin.php +++ b/extend/payment/Weixin.php @@ -50,7 +50,7 @@ class Weixin // 基础信息 $base = [ 'name' => '微信', // 插件名称 - 'version' => '1.1.2', // 插件版本 + 'version' => '1.1.3', // 插件版本 'apply_version' => '不限', // 适用系统版本描述 'apply_terminal'=> ['pc', 'h5', 'ios', 'android', 'weixin', 'qq'], // 适用终端 默认全部 ['pc', 'h5', 'app', 'alipay', 'weixin', 'baidu'] 'desc' => '适用公众号+PC+H5+APP+微信小程序,即时到帐支付方式,买家的交易资金直接打入卖家账户,快速回笼交易资金。 立即申请', // 插件描述(支持html) @@ -257,7 +257,7 @@ class Weixin case 'MWEB' : if(!empty($params['order_id'])) { - $data['mweb_url'] .= '&redirect_url='.$redirect_url; + $data['mweb_url'] .= '&redirect_url='.urlencode($redirect_url); } $result = DataReturn('success', 0, $data['mweb_url']); break; -- Gitee From fb034fbcd738eadebf2326f06eac9f91ef4f67c3 Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 17 Aug 2021 14:38:25 +0800 Subject: [PATCH 33/57] =?UTF-8?q?=20=E5=95=86=E5=93=81=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0=E6=96=B0=E5=A2=9E=E9=92=A9?= =?UTF-8?q?=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/GoodsService.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/service/GoodsService.php b/app/service/GoodsService.php index 4cddc48f0..a103dd24d 100755 --- a/app/service/GoodsService.php +++ b/app/service/GoodsService.php @@ -1335,11 +1335,24 @@ class GoodsService // 更新商品表 $data['upd_time'] = time(); - if(Db::name('Goods')->where(['id'=>$goods_id])->update($data)) + if(Db::name('Goods')->where(['id'=>$goods_id])->update($data) === false) { - return DataReturn('操作成功', 0); + return DataReturn('商品基础更新失败', -1); } - return DataReturn('操作失败', 0); + + // 商品基础数据更新钩子 + $hook_name = 'plugins_service_goods_base_update'; + $ret = EventReturnHandle(MyEventTrigger($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'goods_id' => $goods_id + ])); + if(isset($ret['code']) && $ret['code'] != 0) + { + return $ret; + } + + return DataReturn('操作成功', 0); } /** -- Gitee From 00f44389ffd559a659d079efe22a1e32962c2f64 Mon Sep 17 00:00:00 2001 From: Devil Date: Fri, 20 Aug 2021 09:49:30 +0800 Subject: [PATCH 34/57] =?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 --- app/service/BuyService.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/service/BuyService.php b/app/service/BuyService.php index c460043b5..7c144d1cb 100755 --- a/app/service/BuyService.php +++ b/app/service/BuyService.php @@ -1075,7 +1075,7 @@ class BuyService // 订单主信息 $order = [ - 'order_no' => date('YmdHis').GetNumberCode(6), + 'order_no' => self::OrderNoCreate(), 'user_id' => $params['user']['id'], 'warehouse_id' => $v['id'], 'user_note' => $user_note, @@ -1260,6 +1260,19 @@ class BuyService return DataReturn($msg, 0, $result); } + /** + * 订单号生成 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-17 + * @desc description + */ + public static function OrderNoCreate() + { + return date('YmdHis').GetNumberCode(6); + } + /** * 订单详情添加 * @author Devil -- Gitee From 8032d01ea808837034024707d84aa07cf0dabc39 Mon Sep 17 00:00:00 2001 From: Devil Date: Sat, 21 Aug 2021 11:14:42 +0800 Subject: [PATCH 35/57] =?UTF-8?q?=20=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=9C=A8=E9=A9=AC=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/base/Uploader.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/extend/base/Uploader.php b/extend/base/Uploader.php index 3a4556ce1..f7419a5f6 100755 --- a/extend/base/Uploader.php +++ b/extend/base/Uploader.php @@ -50,8 +50,9 @@ class Uploader "ERROR_DEAD_LINK" => "链接不可用", "ERROR_HTTP_LINK" => "链接不是http链接", "ERROR_HTTP_CONTENTTYPE" => "链接contentType不正确", - "INVALID_URL" => "非法 URL", - "INVALID_IP" => "非法 IP", + "INVALID_URL" => "非法URL", + "INVALID_IP" => "非法IP", + "INVALID_FILE" => "非法文件", "ERROR_IMAGE_SAVE" => "保存出错,图片有误", "ERROR_UPLOAD_TYPE" => "操作类型有误", ); @@ -193,9 +194,9 @@ class Uploader } // 防止原名称没有带后缀 + $info = getimagesize($file['tmp_name']); if(stripos($file['name'], '.') === false) { - $info = getimagesize($file['tmp_name']); $file['name'] .= str_replace('/', '.', $info['mime']); } @@ -228,7 +229,14 @@ class Uploader return; } - // 存储图片、使用GD存储图片、防止图片包含木马 + // 验证一句话木马(如果是加密的无法判断) + $content = @file_get_contents($file["tmp_name"]); + if(false == $content || preg_match('#<\?php#i', $content) || $info['mime'] == 'text/x-php') + { + $this->stateInfo = $this->getStateInfo("INVALID_FILE"); + return; + } + // 如未安装相应的gd库则直接存储文件 // 未开启重新绘制 $is_move = false; @@ -333,7 +341,6 @@ class Uploader } else { //移动成功 $this->stateInfo = $this->stateMap[0]; } - } /** @@ -398,6 +405,13 @@ class Uploader $this->fileName = $this->getFileName(); $dirname = dirname($this->filePath); + // 验证一句话木马(如果是加密的无法判断) + if(preg_match('#<\?php#i', $img)) + { + $this->stateInfo = $this->getStateInfo("INVALID_FILE"); + return; + } + //检查文件大小是否超出限制 if (!$this->checkSize()) { $this->stateInfo = $this->getStateInfo("ERROR_SIZE_EXCEED"); @@ -419,7 +433,6 @@ class Uploader } else { //移动成功 $this->stateInfo = $this->stateMap[0]; } - } /** -- Gitee From 241d5bc846e1e57704bac11b273d7b5400f4770c Mon Sep 17 00:00:00 2001 From: whats <3022194113@qq.com> Date: Tue, 24 Aug 2021 10:38:28 +0800 Subject: [PATCH 36/57] =?UTF-8?q?'=E6=96=87=E7=AB=A0=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=92=A9=E5=AD=90'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Article.php | 33 +++++++++++++++++++++-- app/index/view/default/article/index.html | 13 +++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index c60f27901..60728cf60 100755 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -89,8 +89,9 @@ class Article extends Common { MyViewAssign('home_seo_site_description', $ret['data'][0]['seo_desc']); } - - MyViewAssign('article', $ret['data'][0]); + $article = $ret['data'][0]; + $this->PluginsHook($id, $article); + MyViewAssign('article', $article); return MyView(); } @@ -98,5 +99,33 @@ class Article extends Common MyViewAssign('msg', '文章不存在或已删除'); return MyView('public/tips_error'); } + + /** + * 钩子处理 + * @author whats + * @blog + * @version 1.0.0 + * @date 2019-04-22 + * @desc description + * @param [int] $article_id [文章id] + * @param [array] $params [输入参数] + */ + private function PluginsHook($article_id, &$article) + { + $hook_arr = [ + //文章内容内部钩子 + 'plugins_view_article_detail_content_within', + ]; + foreach($hook_arr as $hook_name) + { + MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name, + [ + 'hook_name' => $hook_name, + 'is_backend' => false, + 'article_id' => $article_id, + 'article' => &$article, + ])); + } + } } ?> \ No newline at end of file diff --git a/app/index/view/default/article/index.html b/app/index/view/default/article/index.html index 42cb32310..6cd012c78 100755 --- a/app/index/view/default/article/index.html +++ b/app/index/view/default/article/index.html @@ -25,6 +25,19 @@
{{$article.content|raw}}
+ + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
+ plugins_view_article_detail_content_within +
+ {{/if}} + {{if !empty($plugins_view_article_detail_content_within_data) and is_array($plugins_view_article_detail_content_within_data)}} + {{foreach $plugins_view_article_detail_content_within_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}}
-- Gitee From ad991d6b7fc49b32389e711466187f42f8846b3c Mon Sep 17 00:00:00 2001 From: Devil Date: Wed, 25 Aug 2021 11:00:18 +0800 Subject: [PATCH 37/57] =?UTF-8?q?=20=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 --- app/install/controller/Index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/install/controller/Index.php b/app/install/controller/Index.php index 244908f87..2776c587d 100755 --- a/app/install/controller/Index.php +++ b/app/install/controller/Index.php @@ -287,7 +287,7 @@ return [ \PDO::ATTR_CASE => \PDO::CASE_LOWER, \PDO::ATTR_EMULATE_PREPARES => true, ], - // 数据库编码默认采用utf8 + // 数据库编码默认采用utf8mb4 'charset' => '{$params['DB_CHARSET']}', // 数据库表前缀 'prefix' => '{$params['DB_PREFIX']}', -- Gitee From 4f73b139fbb15f4555f2ddef774408fceccffb8b Mon Sep 17 00:00:00 2001 From: Devil Date: Wed, 25 Aug 2021 11:27:35 +0800 Subject: [PATCH 38/57] =?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 --- .../view/default/order/module/goods.html | 10 +-- .../default/orderaftersale/module/goods.html | 6 +- app/admin/view/default/public/footer.html | 2 +- .../view/default/public/module/detail.html | 8 +- .../view/default/public/module/form.html | 8 +- .../public/module/form_operate_bottom.html | 2 +- .../public/module/form_operate_top.html | 2 +- .../default/public/module/form_table.html | 2 +- app/index/controller/Article.php | 58 ++++++++----- app/index/view/default/article/index.html | 87 +++++++++++++++++-- app/index/view/default/buy/index.html | 34 ++++---- app/index/view/default/cart/index.html | 22 ++--- app/index/view/default/goods/index.html | 50 +++++------ app/index/view/default/index/index.html | 22 ++--- app/index/view/default/order/detail.html | 16 ++-- .../view/default/order/module/goods.html | 10 +-- .../view/default/orderaftersale/detail.html | 14 +-- .../default/orderaftersale/module/goods.html | 6 +- app/index/view/default/public/footer.html | 8 +- app/index/view/default/public/footer_nav.html | 2 +- .../view/default/public/header_top_nav.html | 8 +- .../view/default/public/module/detail.html | 8 +- .../view/default/public/module/form.html | 8 +- .../public/module/form_operate_bottom.html | 2 +- .../public/module/form_operate_top.html | 2 +- .../default/public/module/form_table.html | 2 +- .../view/default/public/module/user_form.html | 8 +- app/index/view/default/public/nav_search.html | 4 +- app/index/view/default/search/content.html | 6 +- app/index/view/default/search/index.html | 26 +++--- 30 files changed, 268 insertions(+), 175 deletions(-) diff --git a/app/admin/view/default/order/module/goods.html b/app/admin/view/default/order/module/goods.html index d554e2264..82f4f4f49 100644 --- a/app/admin/view/default/order/module/goods.html +++ b/app/admin/view/default/order/module/goods.html @@ -1,7 +1,7 @@ {{if !empty($module_data) and !empty($module_data['items'])}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_admin_order_list_base_top
@@ -63,7 +63,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_admin_order_list_base_nav_bottom
@@ -86,7 +86,7 @@

- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_admin_order_list_base_goods_top
@@ -135,7 +135,7 @@ {{/foreach}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_admin_order_list_base_goods_bottom
@@ -160,7 +160,7 @@
{{$module_data.describe}}
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_admin_order_list_base_bottom
diff --git a/app/admin/view/default/orderaftersale/module/goods.html b/app/admin/view/default/orderaftersale/module/goods.html index dfca33ab2..405411f2d 100644 --- a/app/admin/view/default/orderaftersale/module/goods.html +++ b/app/admin/view/default/orderaftersale/module/goods.html @@ -1,7 +1,7 @@ {{if !empty($module_data) and !empty($module_data['order_data'])}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_admin_orderaftersale_list_base_top
@@ -28,7 +28,7 @@

- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_admin_orderaftersale_list_base_goods_top
@@ -74,7 +74,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_admin_orderaftersale_list_base_bottom
diff --git a/app/admin/view/default/public/footer.html b/app/admin/view/default/public/footer.html index 8b04cbc0b..403167f6f 100755 --- a/app/admin/view/default/public/footer.html +++ b/app/admin/view/default/public/footer.html @@ -54,7 +54,7 @@ -{{if !empty($plugins_admin_view_common_bottom_data) and is_array($plugins_admin_view_common_bottom_data) and (!isset($is_footer) or $is_footer eq 1)}} +{{if !empty($plugins_admin_view_common_bottom_data) and is_array($plugins_admin_view_common_bottom_data)}} {{foreach $plugins_admin_view_common_bottom_data as $hook}} {{if is_string($hook) or is_int($hook)}} {{$hook|raw}} diff --git a/app/admin/view/default/public/module/detail.html b/app/admin/view/default/public/module/detail.html index 3e611c546..ab3f1f78a 100644 --- a/app/admin/view/default/public/module/detail.html +++ b/app/admin/view/default/public/module/detail.html @@ -1,7 +1,7 @@ {{include file="public/header" /}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_detail_top}}
@@ -23,7 +23,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_detail_inside_top}}
@@ -164,7 +164,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_detail_inside_bottom}}
@@ -186,7 +186,7 @@ -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_detail_bottom}}
diff --git a/app/admin/view/default/public/module/form.html b/app/admin/view/default/public/module/form.html index b43e23a94..f62f7a936 100644 --- a/app/admin/view/default/public/module/form.html +++ b/app/admin/view/default/public/module/form.html @@ -1,7 +1,7 @@ {{include file="public/header" /}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_top}}
@@ -29,7 +29,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_inside_top}}
@@ -98,7 +98,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_inside_bottom}}
@@ -121,7 +121,7 @@ -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_bottom}}
diff --git a/app/admin/view/default/public/module/form_operate_bottom.html b/app/admin/view/default/public/module/form_operate_bottom.html index fe8f38c8e..dfe37fad2 100644 --- a/app/admin/view/default/public/module/form_operate_bottom.html +++ b/app/admin/view/default/public/module/form_operate_bottom.html @@ -1,4 +1,4 @@ -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_form_bottom_operate}}
diff --git a/app/admin/view/default/public/module/form_operate_top.html b/app/admin/view/default/public/module/form_operate_top.html index be8b2df0d..5167405a2 100644 --- a/app/admin/view/default/public/module/form_operate_top.html +++ b/app/admin/view/default/public/module/form_operate_top.html @@ -14,7 +14,7 @@ {{/if}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_form_top_operate}}
diff --git a/app/admin/view/default/public/module/form_table.html b/app/admin/view/default/public/module/form_table.html index ce08aaad9..ca81aeabe 100644 --- a/app/admin/view/default/public/module/form_table.html +++ b/app/admin/view/default/public/module/form_table.html @@ -249,7 +249,7 @@ ])}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_form_list_operate}}
diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index 60728cf60..9b812449c 100755 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -65,13 +65,15 @@ class Article extends Common $ret = ArticleService::ArticleList($params); if(!empty($ret['data'][0])) { + $article = $ret['data'][0]; + // 访问统计 ArticleService::ArticleAccessCountInc(['id'=>$id]); // 是否外部链接 - if(!empty($ret['data'][0]['jump_url'])) + if(!empty($article['jump_url'])) { - return MyRedirect($ret['data'][0]['jump_url']); + return MyRedirect($article['jump_url']); } // 获取分类 @@ -79,18 +81,20 @@ class Article extends Common MyViewAssign('category_list', $article_category_content['data']); // seo - $seo_title = empty($ret['data'][0]['seo_title']) ? $ret['data'][0]['title'] : $ret['data'][0]['seo_title']; + $seo_title = empty($article['seo_title']) ? $article['title'] : $article['seo_title']; MyViewAssign('home_seo_site_title', SeoService::BrowserSeoTitle($seo_title, 2)); - if(!empty($ret['data'][0]['seo_keywords'])) + if(!empty($article['seo_keywords'])) { - MyViewAssign('home_seo_site_keywords', $ret['data'][0]['seo_keywords']); + MyViewAssign('home_seo_site_keywords', $article['seo_keywords']); } - if(!empty($ret['data'][0]['seo_desc'])) + if(!empty($article['seo_desc'])) { - MyViewAssign('home_seo_site_description', $ret['data'][0]['seo_desc']); + MyViewAssign('home_seo_site_description', $article['seo_desc']); } - $article = $ret['data'][0]; + + // 钩子 $this->PluginsHook($id, $article); + MyViewAssign('article', $article); return MyView(); } @@ -102,29 +106,43 @@ class Article extends Common /** * 钩子处理 - * @author whats - * @blog + * @author whats * @version 1.0.0 * @date 2019-04-22 * @desc description - * @param [int] $article_id [文章id] - * @param [array] $params [输入参数] + * @param [int] $article_id [文章id] + * @param [array] $article [文章内容] */ private function PluginsHook($article_id, &$article) { $hook_arr = [ - //文章内容内部钩子 - 'plugins_view_article_detail_content_within', + // 文章内容顶部钩子 + 'plugins_view_article_detail_top', + + // 文章底部钩子 + 'plugins_view_article_detail_bottom', + + // 文章内容顶部钩子 + 'plugins_view_article_detail_content_top', + + // 文章内容底部钩子 + 'plugins_view_article_detail_content_botton', + + // 文章左侧内部顶部钩子 + 'plugins_view_article_detail_left_inside_top', + + // 文章左侧内部底部钩子 + 'plugins_view_article_detail_left_inside_botton', ]; foreach($hook_arr as $hook_name) { MyViewAssign($hook_name.'_data', MyEventTrigger($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'article_id' => $article_id, - 'article' => &$article, - ])); + [ + 'hook_name' => $hook_name, + 'is_backend' => false, + 'article_id' => $article_id, + 'article' => &$article, + ])); } } } diff --git a/app/index/view/default/article/index.html b/app/index/view/default/article/index.html index 6cd012c78..d4d8be9ae 100755 --- a/app/index/view/default/article/index.html +++ b/app/index/view/default/article/index.html @@ -12,7 +12,21 @@ {{include file="public/goods_category" /}} - + +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ plugins_view_article_detail_top +
+{{/if}} +{{if !empty($plugins_view_article_detail_top_data) and is_array($plugins_view_article_detail_top_data)}} + {{foreach $plugins_view_article_detail_top_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} +{{/if}} + +
@@ -24,15 +38,32 @@


+ + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ plugins_view_article_detail_content_top +
+ {{/if}} + {{if !empty($plugins_view_article_detail_content_top_data) and is_array($plugins_view_article_detail_content_top_data)}} + {{foreach $plugins_view_article_detail_content_top_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} + +
{{$article.content|raw}}
- - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
- plugins_view_article_detail_content_within + plugins_view_article_detail_content_botton
{{/if}} - {{if !empty($plugins_view_article_detail_content_within_data) and is_array($plugins_view_article_detail_content_within_data)}} - {{foreach $plugins_view_article_detail_content_within_data as $hook}} + {{if !empty($plugins_view_article_detail_content_botton_data) and is_array($plugins_view_article_detail_content_botton_data)}} + {{foreach $plugins_view_article_detail_content_botton_data as $hook}} {{if is_string($hook) or is_int($hook)}} {{$hook|raw}} {{/if}} @@ -44,6 +75,21 @@ @@ -75,6 +135,21 @@ 侧栏导航
+ + + +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}} +
+ plugins_view_article_detail_bottom +
+{{/if}} +{{if !empty($plugins_view_article_detail_bottom_data) and is_array($plugins_view_article_detail_bottom_data)}} + {{foreach $plugins_view_article_detail_bottom_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} +{{/if}} {{include file="public/footer" /}} diff --git a/app/index/view/default/buy/index.html b/app/index/view/default/buy/index.html index 256f145bf..ede0a1b12 100755 --- a/app/index/view/default/buy/index.html +++ b/app/index/view/default/buy/index.html @@ -13,7 +13,7 @@ {{include file="public/goods_category" /}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_buy_top
@@ -31,7 +31,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_buy_user_note_bottom
@@ -587,7 +587,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_buy_base_confirm_top
@@ -656,7 +656,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_buy_form_inside
@@ -677,7 +677,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_buy_inside_bottom
@@ -694,7 +694,7 @@
-{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_buy_bottom
diff --git a/app/index/view/default/cart/index.html b/app/index/view/default/cart/index.html index b3eaf2219..a478bcf19 100755 --- a/app/index/view/default/cart/index.html +++ b/app/index/view/default/cart/index.html @@ -35,7 +35,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_cart_base_begin
@@ -83,7 +83,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_cart_base_end
@@ -106,7 +106,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_cart_price_begin
@@ -136,7 +136,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_cart_price_end
@@ -159,7 +159,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_cart_number_begin
@@ -195,7 +195,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_cart_number_end
@@ -218,7 +218,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_cart_total_price_begin
@@ -242,7 +242,7 @@ {{$currency_symbol}}{{$goods.total_price}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_cart_total_price_end
@@ -267,7 +267,7 @@ 删除 - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_cart_operate
@@ -303,7 +303,7 @@ 删除 - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_cart_nav_left_inside
@@ -326,7 +326,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_photo_bottom
@@ -101,7 +101,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_photo_within
@@ -116,7 +116,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_photo_bottom
@@ -133,7 +133,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_right_content_top
@@ -150,7 +150,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_right_content_inside_top
@@ -180,7 +180,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_title
@@ -210,7 +210,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_base_top
@@ -236,7 +236,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_panel_price_top
@@ -265,7 +265,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_panel_bottom
@@ -325,7 +325,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_base_inventory_top
@@ -388,7 +388,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_base_inventory_bottom
@@ -423,7 +423,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_buy_nav_top
@@ -440,7 +440,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_base_buy_nav_min_inside_begin
@@ -478,7 +478,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_base_buy_nav_min_inside
@@ -550,7 +550,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_right_content_inside_bottom
@@ -566,7 +566,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_right_content_bottom
@@ -583,7 +583,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_base_bottom
@@ -601,7 +601,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_left_top
@@ -642,7 +642,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_tabs_top
@@ -689,7 +689,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_content_top
@@ -716,7 +716,7 @@
{{$goods.content_web|raw}}
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_content_bottom
@@ -804,7 +804,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_tabs_content
@@ -821,7 +821,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_goods_detail_tabs_bottom
diff --git a/app/index/view/default/index/index.html b/app/index/view/default/index/index.html index 405db875f..b89cdb30f 100755 --- a/app/index/view/default/index/index.html +++ b/app/index/view/default/index/index.html @@ -95,7 +95,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_home_banner_mixed_bottom
@@ -113,7 +113,7 @@ {{/if}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_home_floor_top
@@ -148,7 +148,7 @@ {{if !empty($goods_floor_list) and is_array($goods_floor_list)}} {{foreach $goods_floor_list as $key=>$floor}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_home_floor_top_{{$key+1}}
@@ -189,7 +189,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_home_floor_inside_top
@@ -228,7 +228,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_home_aggregation_inside_bottom
@@ -255,7 +255,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_home_goods_inside_price_top
@@ -305,7 +305,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_home_goods_inside_bottom
@@ -330,7 +330,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_home_floor_inside_bottom
@@ -353,7 +353,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_home_floor_bottom_{{$key+1}}
@@ -378,7 +378,7 @@ {{/if}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_home_floor_bottom
diff --git a/app/index/view/default/order/detail.html b/app/index/view/default/order/detail.html index c7506137a..6f928301c 100755 --- a/app/index/view/default/order/detail.html +++ b/app/index/view/default/order/detail.html @@ -23,7 +23,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_detail_progress_top
@@ -110,7 +110,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_detail_base_top
@@ -299,7 +299,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_index_order_detail_operate
@@ -375,7 +375,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_detail_base_bottom
@@ -419,7 +419,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_detail_address_bottom
@@ -475,7 +475,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_detail_fictitious_bottom
@@ -565,7 +565,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_detail_goods_inside_bottom
@@ -642,7 +642,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_detail_goods_bottom
diff --git a/app/index/view/default/order/module/goods.html b/app/index/view/default/order/module/goods.html index 126f078d4..60c7d8e79 100644 --- a/app/index/view/default/order/module/goods.html +++ b/app/index/view/default/order/module/goods.html @@ -1,7 +1,7 @@ {{if !empty($module_data) and !empty($module_data['items'])}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_list_base_top
@@ -48,7 +48,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_list_base_nav_bottom
@@ -71,7 +71,7 @@

- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_list_base_goods_top
@@ -135,7 +135,7 @@ {{/foreach}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_list_base_goods_bottom
@@ -160,7 +160,7 @@
{{$module_data.describe}}
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_order_list_base_bottom
diff --git a/app/index/view/default/orderaftersale/detail.html b/app/index/view/default/orderaftersale/detail.html index 8d10e906b..d3ea3868b 100644 --- a/app/index/view/default/orderaftersale/detail.html +++ b/app/index/view/default/orderaftersale/detail.html @@ -23,7 +23,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_orderaftersale_detail_top
@@ -49,7 +49,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_orderaftersale_detail_goods_inside_top
@@ -108,7 +108,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_orderaftersale_detail_goods_inside_bottom
@@ -174,7 +174,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_orderaftersale_detail_goods_inside_base_bottom
@@ -198,7 +198,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_orderaftersale_detail_goods_bottom
@@ -285,7 +285,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_orderaftersale_detail_base_top
@@ -419,7 +419,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_orderaftersale_detail_bottom
diff --git a/app/index/view/default/orderaftersale/module/goods.html b/app/index/view/default/orderaftersale/module/goods.html index 73354d281..061180657 100644 --- a/app/index/view/default/orderaftersale/module/goods.html +++ b/app/index/view/default/orderaftersale/module/goods.html @@ -1,7 +1,7 @@ {{if !empty($module_data) and !empty($module_data['order_data'])}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_orderaftersale_list_base_top
@@ -28,7 +28,7 @@

- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_orderaftersale_list_base_goods_top
@@ -74,7 +74,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_user_orderaftersale_list_base_bottom
diff --git a/app/index/view/default/public/footer.html b/app/index/view/default/public/footer.html index 1b8066c2c..b1f867f12 100755 --- a/app/index/view/default/public/footer.html +++ b/app/index/view/default/public/footer.html @@ -8,12 +8,12 @@ -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_common_bottom
{{/if}} -{{if !empty($plugins_view_common_bottom_data) and is_array($plugins_view_common_bottom_data) and (!isset($is_footer) or $is_footer eq 1)}} +{{if !empty($plugins_view_common_bottom_data) and is_array($plugins_view_common_bottom_data)}} {{foreach $plugins_view_common_bottom_data as $hook}} {{if is_string($hook) or is_int($hook)}} {{$hook|raw}} @@ -103,7 +103,7 @@ {{:MyC('home_footer_info')}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_js
@@ -131,7 +131,7 @@ {{/if}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_common_page_bottom
diff --git a/app/index/view/default/public/footer_nav.html b/app/index/view/default/public/footer_nav.html index ef18d7845..bff4c3f50 100755 --- a/app/index/view/default/public/footer_nav.html +++ b/app/index/view/default/public/footer_nav.html @@ -1,5 +1,5 @@ -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_common_footer_top
diff --git a/app/index/view/default/public/header_top_nav.html b/app/index/view/default/public/header_top_nav.html index 11240ce68..c37bac4fa 100755 --- a/app/index/view/default/public/header_top_nav.html +++ b/app/index/view/default/public/header_top_nav.html @@ -10,7 +10,7 @@ plugins_view_header_navigation_top_left_begin
{{/if}} - {{if !empty($plugins_view_header_navigation_top_left_begin_data) and is_array($plugins_view_header_navigation_top_left_begin_data) and (!isset($is_footer) or $is_footer eq 1)}} + {{if !empty($plugins_view_header_navigation_top_left_begin_data) and is_array($plugins_view_header_navigation_top_left_begin_data)}} {{foreach $plugins_view_header_navigation_top_left_begin_data as $hook}} {{if is_string($hook) or is_int($hook)}} {{$hook|raw}} @@ -43,7 +43,7 @@ plugins_view_header_navigation_top_left_end
{{/if}} - {{if !empty($plugins_view_header_navigation_top_left_end_data) and is_array($plugins_view_header_navigation_top_left_end_data) and (!isset($is_footer) or $is_footer eq 1)}} + {{if !empty($plugins_view_header_navigation_top_left_end_data) and is_array($plugins_view_header_navigation_top_left_end_data)}} {{foreach $plugins_view_header_navigation_top_left_end_data as $hook}} {{if is_string($hook) or is_int($hook)}} {{$hook|raw}} @@ -61,7 +61,7 @@ plugins_view_header_navigation_top_right_begin
{{/if}} - {{if !empty($plugins_view_header_navigation_top_right_begin_data) and is_array($plugins_view_header_navigation_top_right_begin_data) and (!isset($is_footer) or $is_footer eq 1)}} + {{if !empty($plugins_view_header_navigation_top_right_begin_data) and is_array($plugins_view_header_navigation_top_right_begin_data)}} {{foreach $plugins_view_header_navigation_top_right_begin_data as $hook}} {{if is_string($hook) or is_int($hook)}} {{$hook|raw}} @@ -127,7 +127,7 @@ plugins_view_header_navigation_top_right_end
{{/if}} - {{if !empty($plugins_view_header_navigation_top_right_end_data) and is_array($plugins_view_header_navigation_top_right_end_data) and (!isset($is_footer) or $is_footer eq 1)}} + {{if !empty($plugins_view_header_navigation_top_right_end_data) and is_array($plugins_view_header_navigation_top_right_end_data)}} {{foreach $plugins_view_header_navigation_top_right_end_data as $hook}} {{if is_string($hook) or is_int($hook)}} {{$hook|raw}} diff --git a/app/index/view/default/public/module/detail.html b/app/index/view/default/public/module/detail.html index 3e611c546..ab3f1f78a 100644 --- a/app/index/view/default/public/module/detail.html +++ b/app/index/view/default/public/module/detail.html @@ -1,7 +1,7 @@ {{include file="public/header" /}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_detail_top}}
@@ -23,7 +23,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_detail_inside_top}}
@@ -164,7 +164,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_detail_inside_bottom}}
@@ -186,7 +186,7 @@ -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_detail_bottom}}
diff --git a/app/index/view/default/public/module/form.html b/app/index/view/default/public/module/form.html index 12d6293c5..c262c90ec 100644 --- a/app/index/view/default/public/module/form.html +++ b/app/index/view/default/public/module/form.html @@ -15,7 +15,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_top}}
@@ -43,7 +43,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_inside_top}}
@@ -111,7 +111,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_inside_bottom}}
@@ -133,7 +133,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_bottom}}
diff --git a/app/index/view/default/public/module/form_operate_bottom.html b/app/index/view/default/public/module/form_operate_bottom.html index fe8f38c8e..dfe37fad2 100644 --- a/app/index/view/default/public/module/form_operate_bottom.html +++ b/app/index/view/default/public/module/form_operate_bottom.html @@ -1,4 +1,4 @@ -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_form_bottom_operate}}
diff --git a/app/index/view/default/public/module/form_operate_top.html b/app/index/view/default/public/module/form_operate_top.html index 153e81e60..5579b6894 100644 --- a/app/index/view/default/public/module/form_operate_top.html +++ b/app/index/view/default/public/module/form_operate_top.html @@ -14,7 +14,7 @@ {{/if}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_form_top_operate}}
diff --git a/app/index/view/default/public/module/form_table.html b/app/index/view/default/public/module/form_table.html index ce08aaad9..ca81aeabe 100644 --- a/app/index/view/default/public/module/form_table.html +++ b/app/index/view/default/public/module/form_table.html @@ -249,7 +249,7 @@ ])}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_form_list_operate}}
diff --git a/app/index/view/default/public/module/user_form.html b/app/index/view/default/public/module/user_form.html index a096044eb..ec5a0530c 100644 --- a/app/index/view/default/public/module/user_form.html +++ b/app/index/view/default/public/module/user_form.html @@ -23,7 +23,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_top}}
@@ -51,7 +51,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_inside_top}}
@@ -119,7 +119,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_inside_bottom}}
@@ -141,7 +141,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
{{$hook_name_content_bottom}}
diff --git a/app/index/view/default/public/nav_search.html b/app/index/view/default/public/nav_search.html index f5d3ea34c..694ebcfec 100755 --- a/app/index/view/default/public/nav_search.html +++ b/app/index/view/default/public/nav_search.html @@ -13,7 +13,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_common_logo_right
@@ -46,7 +46,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_common_search_right
diff --git a/app/index/view/default/search/content.html b/app/index/view/default/search/content.html index 1807cc722..54113efe5 100644 --- a/app/index/view/default/search/content.html +++ b/app/index/view/default/search/content.html @@ -4,7 +4,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_search_goods_inside_top
@@ -37,7 +37,7 @@

- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_search_goods_inside_price_top
@@ -62,7 +62,7 @@

- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_search_goods_inside_bottom
diff --git a/app/index/view/default/search/index.html b/app/index/view/default/search/index.html index bd4782a9e..ef41b1405 100755 --- a/app/index/view/default/search/index.html +++ b/app/index/view/default/search/index.html @@ -13,7 +13,7 @@ {{include file="public/goods_category" /}} -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_search_top
@@ -29,7 +29,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_search_inside_top
@@ -54,7 +54,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_search_map_top
@@ -73,7 +73,7 @@
    - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    plugins_view_search_map_inside_begin
    @@ -97,7 +97,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    plugins_view_search_map_inside_base_bottom
    @@ -229,7 +229,7 @@ {{/if}} - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    plugins_view_search_map_inside_end
    @@ -247,7 +247,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_search_nav_top
@@ -264,7 +264,7 @@
    - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    plugins_view_search_nav_inside_begin
    @@ -308,7 +308,7 @@ - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    plugins_view_search_nav_inside_end
    @@ -324,7 +324,7 @@
- {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
plugins_view_search_data_top
@@ -341,7 +341,7 @@
    - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    plugins_view_search_data_bottom
    @@ -368,7 +368,7 @@
    - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    plugins_view_search_inside_bottom
    @@ -383,7 +383,7 @@
    -{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    plugins_view_search_bottom
    -- Gitee From 624a9e5843e070eb1649acd7c31cc7d763bf3740 Mon Sep 17 00:00:00 2001 From: Devil Date: Thu, 26 Aug 2021 14:53:25 +0800 Subject: [PATCH 39/57] =?UTF-8?q?=E5=BC=B9=E7=AA=97=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=81=E6=94=AF=E6=8C=81=E5=A4=A7=E5=B0=8F=E8=AE=BE=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/common/css/common.css | 6 +++++ public/static/common/js/common.js | 33 ++++++++++++++++++++--- public/static/index/default/css/order.css | 2 +- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css index dceec01d0..00847a1df 100755 --- a/public/static/common/css/common.css +++ b/public/static/common/css/common.css @@ -165,6 +165,12 @@ form.am-form .am-form-group-refreshing, .plug-file-upload-view { border-bottom: .am-modal-dialog .am-modal-bd span { vertical-align: middle; } +@media only screen and (min-width:1200px) { + .popup-full-max { + max-width: 1200px; + left: calc(50% - 600px); + } +} /** * iframe diff --git a/public/static/common/js/common.js b/public/static/common/js/common.js index 134a793ae..8f10ee180 100755 --- a/public/static/common/js/common.js +++ b/public/static/common/js/common.js @@ -1019,14 +1019,37 @@ function CheckVideo() * @param {[string]} url [加载url] * @param {[string]} title [标题] * @param {[string]} class_tag [指定class] + * @param {[int]} full [是否满屏(0否, 1是)] + * @param {[int]} full_max [满屏最大限制(max-width:1200px)(0否, 1是)] */ -function ModalLoad(url, title, class_tag) +function ModalLoad(url, title, class_tag, full, full_max) { - class_tag = class_tag || ''; + // class 定义 + var ent = 'popup-iframe'; + + // 自定义 class + if((class_tag || null) != null) + { + ent += ' '+class_tag; + } + + // 是否满屏 + if((full || 0) == 1) + { + ent += ' popup-full'; + } + + // 满屏最大限制 + if((full_max || 0) == 1) + { + ent += ' popup-full-max'; + } + + // 调用弹窗组件 AMUI.dialog.popup({ title: title || '', content: '', - class: ' popup-iframe '+class_tag + class: ent }); } @@ -2904,9 +2927,11 @@ $(function() // 基础参数 var title = $(this).data('title') || ''; var class_tag = $(this).data('class') || ''; + var full = parseInt($(this).data('full')) || 0; + var full_max = parseInt($(this).data('full-max')) || 0; // 调用弹窗方法 - ModalLoad(url, title, class_tag); + ModalLoad(url, title, class_tag, full, full_max); }); // 地图弹窗 diff --git a/public/static/index/default/css/order.css b/public/static/index/default/css/order.css index 5950b6e9b..93fa5c79c 100755 --- a/public/static/index/default/css/order.css +++ b/public/static/index/default/css/order.css @@ -122,7 +122,7 @@ ul.progress li.current .title { box-shadow: none; } .order-base .am-panel-bd, .order-base .base-right { - padding: 5px 10px; + padding: 10px; } .order-base, .order-base .status { overflow: hidden; -- Gitee From 4856ad623cee6817923641f4a9e7741116bd391a Mon Sep 17 00:00:00 2001 From: Devil Date: Thu, 26 Aug 2021 14:53:37 +0800 Subject: [PATCH 40/57] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/view/default/order/detail.html | 6 +-- app/service/OrderService.php | 56 +++++++++++++++++------- 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/app/index/view/default/order/detail.html b/app/index/view/default/order/detail.html index 6f928301c..2487421c5 100755 --- a/app/index/view/default/order/detail.html +++ b/app/index/view/default/order/detail.html @@ -353,7 +353,7 @@ {{/if}} - {{if $data['order_model'] eq 2 and in_array($data['status'], [2,3])}} + {{if $data['order_model'] eq 2 and in_array($data['status'], [2,3]) and !empty($data['extraction_data'])}}

    @@ -397,7 +397,7 @@ - {{if in_array($data['order_model'], [0, 2])}} + {{if in_array($data['order_model'], [0, 2]) and !empty($data['address_data'])}}

    {{if $data.order_model eq 2}}取货地址{{else /}}收货地址{{/if}}
    @@ -498,7 +498,7 @@ {{if !empty($data.items)}} -
    +
    diff --git a/app/service/OrderService.php b/app/service/OrderService.php index e02088905..5ad5fec4c 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -1172,6 +1172,7 @@ class OrderService { // 字段列表 $keys = ArrayKeys($data); + $order_ids = array_column($data, 'id'); // 其它额外处理 $is_operate = isset($params['is_operate']) ? intval($params['is_operate']) : 0; @@ -1200,7 +1201,7 @@ class OrderService $currency_default = ResourcesService::CurrencyData(); // 订单货币 - $currency_data = OrderCurrencyService::OrderCurrencyGroupList(array_column($data, 'id')); + $currency_data = OrderCurrencyService::OrderCurrencyGroupList($order_ids); // 用户列表 if(in_array('user_id', $keys) && isset($params['is_public']) && $params['is_public'] == 0) @@ -1215,10 +1216,13 @@ class OrderService } // 支付方式名称 - $payment_list = PaymentService::OrderPaymentName(array_column($data, 'id')); + $payment_list = PaymentService::OrderPaymentName($order_ids); // 取货码 - $extraction_data = self::OrderExtractionData(array_column($data, 'id')); + $extraction_data = self::OrderExtractionData($order_ids); + + // 订单地址 + $address_data = self::OrderAddressData($order_ids); // 循环处理数据 foreach($data as &$v) @@ -1260,7 +1264,7 @@ class OrderService if(in_array($v['order_model'], [0,2])) { // 销售模式+自提模式 地址信息 - $v['address_data'] = self::OrderAddressData($v['id']); + $v['address_data'] = (!empty($address_data) && array_key_exists($v['id'], $address_data)) ? $address_data[$v['id']] : []; // 自提模式 添加订单取货码 if($v['order_model'] == 2) @@ -1573,6 +1577,16 @@ class OrderService ]; } } + + // 订单自提信息钩子 + $hook_name = 'plugins_service_order_extraction_data'; + MyEventTrigger($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'order_ids' => $order_ids, + 'data' => &$result, + ]); + return $result; } @@ -1583,22 +1597,34 @@ class OrderService * @version 1.0.0 * @date 2019-11-26 * @desc description - * @param [int] $order_id [订单id] + * @param [array] $order_ids [订单id] */ - private static function OrderAddressData($order_id) + private static function OrderAddressData($order_ids) { // 销售模式+自提模式 地址信息 - $data = Db::name('OrderAddress')->where(['order_id'=>$order_id])->find(); - if(!empty($data)) + $data = Db::name('OrderAddress')->where(['order_id'=>$order_ids])->column('*', 'order_id'); + if(!empty($data) && is_array($data)) { - // 附件 - $data['idcard_front_old'] = $data['idcard_front']; - $data['idcard_front'] = ResourcesService::AttachmentPathViewHandle($data['idcard_front']); - $data['idcard_back_old'] = $data['idcard_back']; - $data['idcard_back'] = ResourcesService::AttachmentPathViewHandle($data['idcard_back']); - return $data; + foreach($data as &$v) + { + // 附件 + $v['idcard_front_old'] = $v['idcard_front']; + $v['idcard_front'] = ResourcesService::AttachmentPathViewHandle($v['idcard_front']); + $v['idcard_back_old'] = $v['idcard_back']; + $v['idcard_back'] = ResourcesService::AttachmentPathViewHandle($v['idcard_back']); + } } - return []; + + // 订单地址信息钩子 + $hook_name = 'plugins_service_order_address_data'; + MyEventTrigger($hook_name, [ + 'hook_name' => $hook_name, + 'is_backend' => true, + 'order_ids' => $order_ids, + 'data' => &$data, + ]); + + return empty($data) ? [] : $data; } /** -- Gitee From 4e457a7515f0e222003b72efb22400c788fd9f3a Mon Sep 17 00:00:00 2001 From: Devil Date: Thu, 26 Aug 2021 16:54:12 +0800 Subject: [PATCH 41/57] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E5=91=A8=E6=9C=9F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/OrderAftersaleService.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/service/OrderAftersaleService.php b/app/service/OrderAftersaleService.php index 89a123d70..a67a69e88 100644 --- a/app/service/OrderAftersaleService.php +++ b/app/service/OrderAftersaleService.php @@ -1591,6 +1591,13 @@ class OrderAftersaleService */ public static function OrderIsCanLaunchAftersale($collect_time) { + // 售后周期、0则关闭售后 + $launch_day = intval(MyC('home_order_aftersale_return_launch_day', 30)); + if($launch_day <= 0) + { + return 0; + } + // 未收货 if(empty($collect_time)) { @@ -1598,7 +1605,6 @@ class OrderAftersaleService } // 是否超出限制时间 - $launch_day = intval(MyC('home_order_aftersale_return_launch_day', 30, true)); $end_time = $collect_time+($launch_day*86400); return ($end_time >= time()) ? 1 : 0; } -- Gitee From 2af422787361f5433e16f5064ff3c70b656c3091 Mon Sep 17 00:00:00 2001 From: Devil Date: Thu, 26 Aug 2021 17:53:47 +0800 Subject: [PATCH 42/57] =?UTF-8?q?=20=E8=AE=A2=E5=8D=95=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E6=8B=86=E5=88=86=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/OrderService.php | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/app/service/OrderService.php b/app/service/OrderService.php index 5ad5fec4c..76a0201c3 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -1982,20 +1982,41 @@ class OrderService // 开启事务 Db::startTrans(); + // 收货处理 + $ret = self::OrderCollectHandle($order, $params); + if($ret['code'] == 0) + { + Db::commit(); + } else { + Db::rollback(); + } + return $ret; + } + + /** + * 订单收货完成处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-26 + * @desc description + * @param [array] $order [订单数据] + * @param [array] $params [输入参数] + */ + public static function OrderCollectHandle($order, $params = []) + { // 更新订单状态 $upd_data = [ 'status' => 4, 'collect_time' => time(), 'upd_time' => time(), ]; - if(Db::name('Order')->where($where)->update($upd_data)) + if(Db::name('Order')->where(['id'=>$order['id']])->update($upd_data)) { // 订单商品积分赠送 $ret = IntegralService::OrderGoodsIntegralGiving(['order_id'=>$order['id']]); if($ret['code'] != 0) { - // 事务回滚 - Db::rollback(); return $ret; } @@ -2003,8 +2024,6 @@ class OrderService $ret = self::GoodsSalesCountInc(['order_id'=>$order['id'], 'opt_type'=>'collect']); if($ret['code'] != 0) { - // 事务回滚 - Db::rollback(); return $ret; } @@ -2016,13 +2035,8 @@ class OrderService $creator_name = isset($params['creator_name']) ? htmlentities($params['creator_name']) : ''; self::OrderHistoryAdd($order['id'], $upd_data['status'], $order['status'], '收货', $creator, $creator_name); - // 提交事务 - Db::commit(); return DataReturn('收货成功', 0); } - - // 事务回滚 - Db::rollback(); return DataReturn('收货失败', -1); } -- Gitee From af087e530783e233c138a739c3c1d9a0a605b19d Mon Sep 17 00:00:00 2001 From: Devil Date: Fri, 27 Aug 2021 13:56:56 +0800 Subject: [PATCH 43/57] =?UTF-8?q?=20=E7=94=A8=E6=88=B7=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/default/useraddress/save_info.html | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/app/index/view/default/useraddress/save_info.html b/app/index/view/default/useraddress/save_info.html index 9669ce6c5..97fbd9f8f 100755 --- a/app/index/view/default/useraddress/save_info.html +++ b/app/index/view/default/useraddress/save_info.html @@ -3,7 +3,7 @@
    - +
    @@ -102,22 +102,4 @@ $(function() MapInit({{if !empty($data['lng'])}}{{$data['lng']}}{{else /}}116.400244{{/if}},{{if !empty($data['lat'])}}{{$data['lat']}}{{else /}}39.92556{{/if}}); {{/if}} }); - -// 返回处理 -function ViewModalBack(e) -{ - if(e.code == 0) - { - $.AMUI.progress.done(); - Prompt(e.msg, 'success'); - setTimeout(function() - { - parent.location.reload(); - }, 1500); - } else { - $('form.form-validation').find('button[type="submit"]').button('reset'); - $.AMUI.progress.done(); - Prompt(e.msg); - } -} \ No newline at end of file -- Gitee From 0608bb9f045a5cd8c17cee0477afb104b0d556b4 Mon Sep 17 00:00:00 2001 From: Devil Date: Fri, 27 Aug 2021 13:57:15 +0800 Subject: [PATCH 44/57] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E4=BC=98=E5=8C=96=EF=BC=8C=E5=87=8F=E5=B0=91?= =?UTF-8?q?=20sql=20=E6=9F=A5=E8=AF=A2=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/OrderService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/service/OrderService.php b/app/service/OrderService.php index 76a0201c3..03836dac9 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -1289,7 +1289,7 @@ class OrderService $v['client_type_name'] = isset($common_platform_type[$v['client_type']]) ? $common_platform_type[$v['client_type']]['name'] : ''; // 状态 - $v['status_name'] = ($v['order_model'] == 2 && $v['status'] == 2) ? '待取货' : $order_status_list[$v['status']]['name']; + $v['status_name'] = ($v['order_model'] == 2 && $v['status'] == 2) ? '待取货' : (array_key_exists($v['status'], $order_status_list) ? $order_status_list[$v['status']]['name'] : '未知'); // 支付状态 $v['pay_status_name'] = $order_pay_status[$v['pay_status']]['name']; -- Gitee From e3ae34c4d580085a19823049b3d5cbef55c3bc75 Mon Sep 17 00:00:00 2001 From: Devil Date: Fri, 27 Aug 2021 14:13:59 +0800 Subject: [PATCH 45/57] =?UTF-8?q?=E5=95=86=E5=93=81=20seo=20=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E4=B8=BA=E7=A9=BA=E5=88=99=E5=8F=96=E5=95=86=E5=93=81?= =?UTF-8?q?=E7=AE=80=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Goods.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/index/controller/Goods.php b/app/index/controller/Goods.php index b08b186de..6b4a31f5d 100755 --- a/app/index/controller/Goods.php +++ b/app/index/controller/Goods.php @@ -89,9 +89,9 @@ class Goods extends Common { MyViewAssign('home_seo_site_keywords', $goods['seo_keywords']); } - if(!empty($goods['seo_desc'])) + if(!empty($goods['seo_desc']) || !empty($goods['simple_desc'])) { - MyViewAssign('home_seo_site_description', $goods['seo_desc']); + MyViewAssign('home_seo_site_description', empty($goods['seo_desc']) ? $goods['simple_desc'] : $goods['seo_desc']); } // 二维码 -- Gitee From 20edec0082d52bbbc6b640cc636153fa4dbd61b6 Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 29 Aug 2021 12:17:59 +0800 Subject: [PATCH 46/57] =?UTF-8?q?=E9=93=B6=E8=81=94=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=87=91=E9=A2=9D=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E6=94=AF=E4=BB=98=E5=B9=B3=E5=8F=B0=E4=BC=98?= =?UTF-8?q?=E6=83=A0=E5=AF=BC=E8=87=B4=E9=87=91=E9=A2=9D=E5=8F=98=E5=B0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/payment/ChinaUmsWeixin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extend/payment/ChinaUmsWeixin.php b/extend/payment/ChinaUmsWeixin.php index d89657785..907f2aa24 100644 --- a/extend/payment/ChinaUmsWeixin.php +++ b/extend/payment/ChinaUmsWeixin.php @@ -50,7 +50,7 @@ class ChinaUmsWeixin // 基础信息 $base = [ 'name' => '银联商务-微信', // 插件名称 - 'version' => '1.0.0', // 插件版本 + 'version' => '1.0.1', // 插件版本 'apply_version' => '不限', // 适用系统版本描述 'apply_terminal'=> ['weixin'], // 适用终端 默认全部 ['pc', 'h5', 'app', 'alipay', 'weixin', 'baidu'] 'desc' => '适用微信小程序,即时到帐支付方式,买家的交易资金直接打入卖家账户,快速回笼交易资金。 立即申请', // 插件描述(支持html) @@ -244,7 +244,7 @@ class ChinaUmsWeixin $data['buyer_user'] = isset($data['subBuyerId']) ? $data['subBuyerId'] : ''; // 支付平台 - 用户 $data['out_trade_no'] = str_replace($this->config['msg_id'], '', $data['merOrderId']); // 本系统发起支付的 - 订单号 $data['subject'] = isset($data['attachedData']) ? $data['attachedData'] : ''; // 本系统发起支付的 - 商品名称 - $data['pay_price'] = $data['buyerPayAmount']/100; // 本系统发起支付的 - 总价 + $data['pay_price'] = $data['totalAmount']/100; // 本系统发起支付的 - 总价 return $data; } -- Gitee From e9dda109e7deec0a11ea5ac2f98cf21cef693200 Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 29 Aug 2021 13:11:28 +0800 Subject: [PATCH 47/57] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/ConstService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/service/ConstService.php b/app/service/ConstService.php index 709ed091c..5f692fe17 100644 --- a/app/service/ConstService.php +++ b/app/service/ConstService.php @@ -86,7 +86,7 @@ class ConstService '2.0.3' => ['value' => '2.0.3', 'name' => 'v2.0.3'], '2.1.0' => ['value' => '2.1.0', 'name' => 'v2.1.0'], '2.2.0' => ['value' => '2.2.0', 'name' => 'v2.2.0'], - '2.2.1' => ['value' => '2.2.0', 'name' => 'v2.2.1'], + '2.2.1' => ['value' => '2.2.1', 'name' => 'v2.2.1'], ], // 用户注册类型列表 -- Gitee From 5f626b8d5ef28441c4df6c57d736730b5c54512b Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 29 Aug 2021 14:20:21 +0800 Subject: [PATCH 48/57] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=85=B3=E9=97=AD=E5=AD=97=E6=AE=B5=E7=BC=93=E5=AD=98?= =?UTF-8?q?=EF=BC=8C=E5=BC=80=E5=90=AF=20sql=20=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/install/controller/Index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/install/controller/Index.php b/app/install/controller/Index.php index 2776c587d..d4c13618e 100755 --- a/app/install/controller/Index.php +++ b/app/install/controller/Index.php @@ -305,9 +305,9 @@ return [ // 是否需要断线重连 'break_reconnect' => false, // 监听SQL - 'trigger_sql' => false, + 'trigger_sql' => true, // 开启字段缓存 - 'fields_cache' => true, + 'fields_cache' => false, ] ] ]; -- Gitee From c0cce4d07bbe5c30847c36224b81f26ed2c52318 Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 29 Aug 2021 16:36:04 +0800 Subject: [PATCH 49/57] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/OrderService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/service/OrderService.php b/app/service/OrderService.php index 03836dac9..3c4608ddb 100755 --- a/app/service/OrderService.php +++ b/app/service/OrderService.php @@ -1292,7 +1292,7 @@ class OrderService $v['status_name'] = ($v['order_model'] == 2 && $v['status'] == 2) ? '待取货' : (array_key_exists($v['status'], $order_status_list) ? $order_status_list[$v['status']]['name'] : '未知'); // 支付状态 - $v['pay_status_name'] = $order_pay_status[$v['pay_status']]['name']; + $v['pay_status_name'] = (in_array($v['status'], [2,3,4]) && $v['pay_status'] == 0) ? '待确认' : $order_pay_status[$v['pay_status']]['name']; // 快递公司 $v['express_name'] = (!empty($express_list) && is_array($express_list) && array_key_exists($v['express_id'], $express_list)) ? $express_list[$v['express_id']] : null; -- Gitee From d6a07aaac608ce2c08847a9daa22cb1ae0216f9f Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 29 Aug 2021 16:58:06 +0800 Subject: [PATCH 50/57] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/tpl/think_exception.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/tpl/think_exception.tpl b/app/tpl/think_exception.tpl index 694701254..7c00999ef 100644 --- a/app/tpl/think_exception.tpl +++ b/app/tpl/think_exception.tpl @@ -423,7 +423,7 @@ if (!function_exists('echo_value')) {
    -- Gitee From e2e79149bbb462fddb6916df2ebcd1c95415bd9a Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 29 Aug 2021 17:17:19 +0800 Subject: [PATCH 51/57] =?UTF-8?q?=E5=95=86=E5=93=81+=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E6=94=B6=E8=97=8F=E5=8D=95=E8=AF=8D=E9=94=99=E8=AF=AF=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sourcecode/alipay/default/app.json | 4 ++-- .../pages/plugins/shop/{faovr/faovr.acss => favor/favor.acss} | 0 .../pages/plugins/shop/{faovr/faovr.axml => favor/favor.axml} | 0 .../pages/plugins/shop/{faovr/faovr.js => favor/favor.js} | 0 .../pages/plugins/shop/{faovr/faovr.json => favor/favor.json} | 0 .../user-faovr.acss => user-favor/user-favor.acss} | 0 .../user-faovr.axml => user-favor/user-favor.axml} | 0 .../{user-faovr/user-faovr.js => user-favor/user-favor.js} | 0 .../user-faovr.json => user-favor/user-favor.json} | 0 sourcecode/alipay/default/pages/user/user.js | 2 +- sourcecode/baidu/default/app.json | 4 ++-- .../pages/plugins/shop/{faovr/faovr.css => favor/favor.css} | 0 .../pages/plugins/shop/{faovr/faovr.js => favor/favor.js} | 0 .../pages/plugins/shop/{faovr/faovr.json => favor/favor.json} | 0 .../pages/plugins/shop/{faovr/faovr.swan => favor/favor.swan} | 0 .../{user-faovr/user-faovr.css => user-favor/user-favor.css} | 0 .../{user-faovr/user-faovr.js => user-favor/user-favor.js} | 0 .../user-faovr.json => user-favor/user-favor.json} | 0 .../user-faovr.swan => user-favor/user-favor.swan} | 0 sourcecode/baidu/default/pages/user/user.js | 2 +- sourcecode/qq/default/app.json | 4 ++-- .../pages/plugins/shop/{faovr/faovr.js => favor/favor.js} | 0 .../pages/plugins/shop/{faovr/faovr.json => favor/favor.json} | 0 .../pages/plugins/shop/{faovr/faovr.qml => favor/favor.qml} | 0 .../pages/plugins/shop/{faovr/faovr.qss => favor/favor.qss} | 0 .../{user-faovr/user-faovr.js => user-favor/user-favor.js} | 0 .../user-faovr.json => user-favor/user-favor.json} | 0 .../{user-faovr/user-faovr.qml => user-favor/user-favor.qml} | 0 .../{user-faovr/user-faovr.qss => user-favor/user-favor.qss} | 0 sourcecode/qq/default/pages/user/user.js | 2 +- sourcecode/toutiao/default/app.json | 4 ++-- .../pages/plugins/shop/{faovr/faovr.js => favor/favor.js} | 0 .../pages/plugins/shop/{faovr/faovr.json => favor/favor.json} | 0 .../pages/plugins/shop/{faovr/faovr.ttml => favor/favor.ttml} | 0 .../pages/plugins/shop/{faovr/faovr.ttss => favor/favor.ttss} | 0 .../{user-faovr/user-faovr.js => user-favor/user-favor.js} | 0 .../user-faovr.json => user-favor/user-favor.json} | 0 .../user-faovr.ttml => user-favor/user-favor.ttml} | 0 .../user-faovr.ttss => user-favor/user-favor.ttss} | 0 sourcecode/toutiao/default/pages/user/user.js | 2 +- sourcecode/weixin/default/app.json | 4 ++-- .../pages/plugins/shop/{faovr/faovr.js => favor/favor.js} | 0 .../pages/plugins/shop/{faovr/faovr.json => favor/favor.json} | 0 .../pages/plugins/shop/{faovr/faovr.wxml => favor/favor.wxml} | 0 .../pages/plugins/shop/{faovr/faovr.wxss => favor/favor.wxss} | 0 .../{user-faovr/user-faovr.js => user-favor/user-favor.js} | 0 .../user-faovr.json => user-favor/user-favor.json} | 0 .../user-faovr.wxml => user-favor/user-favor.wxml} | 0 .../user-faovr.wxss => user-favor/user-favor.wxss} | 0 sourcecode/weixin/default/pages/user/user.js | 2 +- 50 files changed, 15 insertions(+), 15 deletions(-) rename sourcecode/alipay/default/pages/plugins/shop/{faovr/faovr.acss => favor/favor.acss} (100%) rename sourcecode/alipay/default/pages/plugins/shop/{faovr/faovr.axml => favor/favor.axml} (100%) rename sourcecode/alipay/default/pages/plugins/shop/{faovr/faovr.js => favor/favor.js} (100%) rename sourcecode/alipay/default/pages/plugins/shop/{faovr/faovr.json => favor/favor.json} (100%) rename sourcecode/alipay/default/pages/{user-faovr/user-faovr.acss => user-favor/user-favor.acss} (100%) rename sourcecode/alipay/default/pages/{user-faovr/user-faovr.axml => user-favor/user-favor.axml} (100%) rename sourcecode/alipay/default/pages/{user-faovr/user-faovr.js => user-favor/user-favor.js} (100%) rename sourcecode/alipay/default/pages/{user-faovr/user-faovr.json => user-favor/user-favor.json} (100%) rename sourcecode/baidu/default/pages/plugins/shop/{faovr/faovr.css => favor/favor.css} (100%) rename sourcecode/baidu/default/pages/plugins/shop/{faovr/faovr.js => favor/favor.js} (100%) rename sourcecode/baidu/default/pages/plugins/shop/{faovr/faovr.json => favor/favor.json} (100%) rename sourcecode/baidu/default/pages/plugins/shop/{faovr/faovr.swan => favor/favor.swan} (100%) rename sourcecode/baidu/default/pages/{user-faovr/user-faovr.css => user-favor/user-favor.css} (100%) rename sourcecode/baidu/default/pages/{user-faovr/user-faovr.js => user-favor/user-favor.js} (100%) rename sourcecode/baidu/default/pages/{user-faovr/user-faovr.json => user-favor/user-favor.json} (100%) rename sourcecode/baidu/default/pages/{user-faovr/user-faovr.swan => user-favor/user-favor.swan} (100%) rename sourcecode/qq/default/pages/plugins/shop/{faovr/faovr.js => favor/favor.js} (100%) rename sourcecode/qq/default/pages/plugins/shop/{faovr/faovr.json => favor/favor.json} (100%) rename sourcecode/qq/default/pages/plugins/shop/{faovr/faovr.qml => favor/favor.qml} (100%) rename sourcecode/qq/default/pages/plugins/shop/{faovr/faovr.qss => favor/favor.qss} (100%) rename sourcecode/qq/default/pages/{user-faovr/user-faovr.js => user-favor/user-favor.js} (100%) rename sourcecode/qq/default/pages/{user-faovr/user-faovr.json => user-favor/user-favor.json} (100%) rename sourcecode/qq/default/pages/{user-faovr/user-faovr.qml => user-favor/user-favor.qml} (100%) rename sourcecode/qq/default/pages/{user-faovr/user-faovr.qss => user-favor/user-favor.qss} (100%) rename sourcecode/toutiao/default/pages/plugins/shop/{faovr/faovr.js => favor/favor.js} (100%) rename sourcecode/toutiao/default/pages/plugins/shop/{faovr/faovr.json => favor/favor.json} (100%) rename sourcecode/toutiao/default/pages/plugins/shop/{faovr/faovr.ttml => favor/favor.ttml} (100%) rename sourcecode/toutiao/default/pages/plugins/shop/{faovr/faovr.ttss => favor/favor.ttss} (100%) rename sourcecode/toutiao/default/pages/{user-faovr/user-faovr.js => user-favor/user-favor.js} (100%) rename sourcecode/toutiao/default/pages/{user-faovr/user-faovr.json => user-favor/user-favor.json} (100%) rename sourcecode/toutiao/default/pages/{user-faovr/user-faovr.ttml => user-favor/user-favor.ttml} (100%) rename sourcecode/toutiao/default/pages/{user-faovr/user-faovr.ttss => user-favor/user-favor.ttss} (100%) rename sourcecode/weixin/default/pages/plugins/shop/{faovr/faovr.js => favor/favor.js} (100%) rename sourcecode/weixin/default/pages/plugins/shop/{faovr/faovr.json => favor/favor.json} (100%) rename sourcecode/weixin/default/pages/plugins/shop/{faovr/faovr.wxml => favor/favor.wxml} (100%) rename sourcecode/weixin/default/pages/plugins/shop/{faovr/faovr.wxss => favor/favor.wxss} (100%) rename sourcecode/weixin/default/pages/{user-faovr/user-faovr.js => user-favor/user-favor.js} (100%) rename sourcecode/weixin/default/pages/{user-faovr/user-faovr.json => user-favor/user-favor.json} (100%) rename sourcecode/weixin/default/pages/{user-faovr/user-faovr.wxml => user-favor/user-favor.wxml} (100%) rename sourcecode/weixin/default/pages/{user-faovr/user-faovr.wxss => user-favor/user-favor.wxss} (100%) diff --git a/sourcecode/alipay/default/app.json b/sourcecode/alipay/default/app.json index 05b220c62..f1b941173 100644 --- a/sourcecode/alipay/default/app.json +++ b/sourcecode/alipay/default/app.json @@ -16,7 +16,7 @@ "pages/user-order/user-order", "pages/user-order-detail/user-order-detail", "pages/user-order-comments/user-order-comments", - "pages/user-faovr/user-faovr", + "pages/user-favor/user-favor", "pages/user-answer-list/user-answer-list", "pages/answer-list/answer-list", "pages/answer-form/answer-form", @@ -84,7 +84,7 @@ "pages/plugins/shop/detail/detail", "pages/plugins/shop/search/search", "pages/plugins/shop/design/design", - "pages/plugins/shop/faovr/faovr" + "pages/plugins/shop/favor/favor" ], "window": { "defaultTitle": "{{application_title}}", diff --git a/sourcecode/alipay/default/pages/plugins/shop/faovr/faovr.acss b/sourcecode/alipay/default/pages/plugins/shop/favor/favor.acss similarity index 100% rename from sourcecode/alipay/default/pages/plugins/shop/faovr/faovr.acss rename to sourcecode/alipay/default/pages/plugins/shop/favor/favor.acss diff --git a/sourcecode/alipay/default/pages/plugins/shop/faovr/faovr.axml b/sourcecode/alipay/default/pages/plugins/shop/favor/favor.axml similarity index 100% rename from sourcecode/alipay/default/pages/plugins/shop/faovr/faovr.axml rename to sourcecode/alipay/default/pages/plugins/shop/favor/favor.axml diff --git a/sourcecode/alipay/default/pages/plugins/shop/faovr/faovr.js b/sourcecode/alipay/default/pages/plugins/shop/favor/favor.js similarity index 100% rename from sourcecode/alipay/default/pages/plugins/shop/faovr/faovr.js rename to sourcecode/alipay/default/pages/plugins/shop/favor/favor.js diff --git a/sourcecode/alipay/default/pages/plugins/shop/faovr/faovr.json b/sourcecode/alipay/default/pages/plugins/shop/favor/favor.json similarity index 100% rename from sourcecode/alipay/default/pages/plugins/shop/faovr/faovr.json rename to sourcecode/alipay/default/pages/plugins/shop/favor/favor.json diff --git a/sourcecode/alipay/default/pages/user-faovr/user-faovr.acss b/sourcecode/alipay/default/pages/user-favor/user-favor.acss similarity index 100% rename from sourcecode/alipay/default/pages/user-faovr/user-faovr.acss rename to sourcecode/alipay/default/pages/user-favor/user-favor.acss diff --git a/sourcecode/alipay/default/pages/user-faovr/user-faovr.axml b/sourcecode/alipay/default/pages/user-favor/user-favor.axml similarity index 100% rename from sourcecode/alipay/default/pages/user-faovr/user-faovr.axml rename to sourcecode/alipay/default/pages/user-favor/user-favor.axml diff --git a/sourcecode/alipay/default/pages/user-faovr/user-faovr.js b/sourcecode/alipay/default/pages/user-favor/user-favor.js similarity index 100% rename from sourcecode/alipay/default/pages/user-faovr/user-faovr.js rename to sourcecode/alipay/default/pages/user-favor/user-favor.js diff --git a/sourcecode/alipay/default/pages/user-faovr/user-faovr.json b/sourcecode/alipay/default/pages/user-favor/user-favor.json similarity index 100% rename from sourcecode/alipay/default/pages/user-faovr/user-faovr.json rename to sourcecode/alipay/default/pages/user-favor/user-favor.json diff --git a/sourcecode/alipay/default/pages/user/user.js b/sourcecode/alipay/default/pages/user/user.js index e2405bb6a..9bf270241 100644 --- a/sourcecode/alipay/default/pages/user/user.js +++ b/sourcecode/alipay/default/pages/user/user.js @@ -6,7 +6,7 @@ Page({ message_total: 0, head_nav_list: [ { name: "订单总数", url: "user-order", count: 0 }, - { name: "商品收藏", url: "user-faovr", count: 0 }, + { name: "商品收藏", url: "user-favor", count: 0 }, { name: "我的足迹", url: "user-goods-browse", count: 0 }, { name: "我的积分", url: "user-integral", count: 0 }, ], diff --git a/sourcecode/baidu/default/app.json b/sourcecode/baidu/default/app.json index fdf694e9f..87495d498 100755 --- a/sourcecode/baidu/default/app.json +++ b/sourcecode/baidu/default/app.json @@ -16,7 +16,7 @@ "pages/user-order/user-order", "pages/user-order-detail/user-order-detail", "pages/user-order-comments/user-order-comments", - "pages/user-faovr/user-faovr", + "pages/user-favor/user-favor", "pages/user-answer-list/user-answer-list", "pages/answer-list/answer-list", "pages/answer-form/answer-form", @@ -62,7 +62,7 @@ "pages/plugins/shop/detail/detail", "pages/plugins/shop/search/search", "pages/plugins/shop/design/design", - "pages/plugins/shop/faovr/faovr" + "pages/plugins/shop/favor/favor" ], "window": { "navigationBarTitleText": "{{application_title}}", diff --git a/sourcecode/baidu/default/pages/plugins/shop/faovr/faovr.css b/sourcecode/baidu/default/pages/plugins/shop/favor/favor.css similarity index 100% rename from sourcecode/baidu/default/pages/plugins/shop/faovr/faovr.css rename to sourcecode/baidu/default/pages/plugins/shop/favor/favor.css diff --git a/sourcecode/baidu/default/pages/plugins/shop/faovr/faovr.js b/sourcecode/baidu/default/pages/plugins/shop/favor/favor.js similarity index 100% rename from sourcecode/baidu/default/pages/plugins/shop/faovr/faovr.js rename to sourcecode/baidu/default/pages/plugins/shop/favor/favor.js diff --git a/sourcecode/baidu/default/pages/plugins/shop/faovr/faovr.json b/sourcecode/baidu/default/pages/plugins/shop/favor/favor.json similarity index 100% rename from sourcecode/baidu/default/pages/plugins/shop/faovr/faovr.json rename to sourcecode/baidu/default/pages/plugins/shop/favor/favor.json diff --git a/sourcecode/baidu/default/pages/plugins/shop/faovr/faovr.swan b/sourcecode/baidu/default/pages/plugins/shop/favor/favor.swan similarity index 100% rename from sourcecode/baidu/default/pages/plugins/shop/faovr/faovr.swan rename to sourcecode/baidu/default/pages/plugins/shop/favor/favor.swan diff --git a/sourcecode/baidu/default/pages/user-faovr/user-faovr.css b/sourcecode/baidu/default/pages/user-favor/user-favor.css similarity index 100% rename from sourcecode/baidu/default/pages/user-faovr/user-faovr.css rename to sourcecode/baidu/default/pages/user-favor/user-favor.css diff --git a/sourcecode/baidu/default/pages/user-faovr/user-faovr.js b/sourcecode/baidu/default/pages/user-favor/user-favor.js similarity index 100% rename from sourcecode/baidu/default/pages/user-faovr/user-faovr.js rename to sourcecode/baidu/default/pages/user-favor/user-favor.js diff --git a/sourcecode/baidu/default/pages/user-faovr/user-faovr.json b/sourcecode/baidu/default/pages/user-favor/user-favor.json similarity index 100% rename from sourcecode/baidu/default/pages/user-faovr/user-faovr.json rename to sourcecode/baidu/default/pages/user-favor/user-favor.json diff --git a/sourcecode/baidu/default/pages/user-faovr/user-faovr.swan b/sourcecode/baidu/default/pages/user-favor/user-favor.swan similarity index 100% rename from sourcecode/baidu/default/pages/user-faovr/user-faovr.swan rename to sourcecode/baidu/default/pages/user-favor/user-favor.swan diff --git a/sourcecode/baidu/default/pages/user/user.js b/sourcecode/baidu/default/pages/user/user.js index 60118ef80..fbf826eab 100755 --- a/sourcecode/baidu/default/pages/user/user.js +++ b/sourcecode/baidu/default/pages/user/user.js @@ -6,7 +6,7 @@ Page({ message_total: 0, head_nav_list: [ { name: "订单总数", url: "user-order", count: 0 }, - { name: "商品收藏", url: "user-faovr", count: 0 }, + { name: "商品收藏", url: "user-favor", count: 0 }, { name: "我的足迹", url: "user-goods-browse", count: 0 }, { name: "我的积分", url: "user-integral", count: 0 }, ], diff --git a/sourcecode/qq/default/app.json b/sourcecode/qq/default/app.json index 3a559b306..397c940b6 100755 --- a/sourcecode/qq/default/app.json +++ b/sourcecode/qq/default/app.json @@ -16,7 +16,7 @@ "pages/user-order/user-order", "pages/user-order-detail/user-order-detail", "pages/user-order-comments/user-order-comments", - "pages/user-faovr/user-faovr", + "pages/user-favor/user-favor", "pages/user-answer-list/user-answer-list", "pages/answer-list/answer-list", "pages/answer-form/answer-form", @@ -61,7 +61,7 @@ "pages/plugins/shop/detail/detail", "pages/plugins/shop/search/search", "pages/plugins/shop/design/design", - "pages/plugins/shop/faovr/faovr" + "pages/plugins/shop/favor/favor" ], "window": { "navigationBarTitleText": "{{application_title}}", diff --git a/sourcecode/qq/default/pages/plugins/shop/faovr/faovr.js b/sourcecode/qq/default/pages/plugins/shop/favor/favor.js similarity index 100% rename from sourcecode/qq/default/pages/plugins/shop/faovr/faovr.js rename to sourcecode/qq/default/pages/plugins/shop/favor/favor.js diff --git a/sourcecode/qq/default/pages/plugins/shop/faovr/faovr.json b/sourcecode/qq/default/pages/plugins/shop/favor/favor.json similarity index 100% rename from sourcecode/qq/default/pages/plugins/shop/faovr/faovr.json rename to sourcecode/qq/default/pages/plugins/shop/favor/favor.json diff --git a/sourcecode/qq/default/pages/plugins/shop/faovr/faovr.qml b/sourcecode/qq/default/pages/plugins/shop/favor/favor.qml similarity index 100% rename from sourcecode/qq/default/pages/plugins/shop/faovr/faovr.qml rename to sourcecode/qq/default/pages/plugins/shop/favor/favor.qml diff --git a/sourcecode/qq/default/pages/plugins/shop/faovr/faovr.qss b/sourcecode/qq/default/pages/plugins/shop/favor/favor.qss similarity index 100% rename from sourcecode/qq/default/pages/plugins/shop/faovr/faovr.qss rename to sourcecode/qq/default/pages/plugins/shop/favor/favor.qss diff --git a/sourcecode/qq/default/pages/user-faovr/user-faovr.js b/sourcecode/qq/default/pages/user-favor/user-favor.js similarity index 100% rename from sourcecode/qq/default/pages/user-faovr/user-faovr.js rename to sourcecode/qq/default/pages/user-favor/user-favor.js diff --git a/sourcecode/qq/default/pages/user-faovr/user-faovr.json b/sourcecode/qq/default/pages/user-favor/user-favor.json similarity index 100% rename from sourcecode/qq/default/pages/user-faovr/user-faovr.json rename to sourcecode/qq/default/pages/user-favor/user-favor.json diff --git a/sourcecode/qq/default/pages/user-faovr/user-faovr.qml b/sourcecode/qq/default/pages/user-favor/user-favor.qml similarity index 100% rename from sourcecode/qq/default/pages/user-faovr/user-faovr.qml rename to sourcecode/qq/default/pages/user-favor/user-favor.qml diff --git a/sourcecode/qq/default/pages/user-faovr/user-faovr.qss b/sourcecode/qq/default/pages/user-favor/user-favor.qss similarity index 100% rename from sourcecode/qq/default/pages/user-faovr/user-faovr.qss rename to sourcecode/qq/default/pages/user-favor/user-favor.qss diff --git a/sourcecode/qq/default/pages/user/user.js b/sourcecode/qq/default/pages/user/user.js index 03d8bce80..0ce040ba2 100755 --- a/sourcecode/qq/default/pages/user/user.js +++ b/sourcecode/qq/default/pages/user/user.js @@ -6,7 +6,7 @@ Page({ message_total: 0, head_nav_list: [ { name: "订单总数", url: "user-order", count: 0 }, - { name: "商品收藏", url: "user-faovr", count: 0 }, + { name: "商品收藏", url: "user-favor", count: 0 }, { name: "我的足迹", url: "user-goods-browse", count: 0 }, { name: "我的积分", url: "user-integral", count: 0 }, ], diff --git a/sourcecode/toutiao/default/app.json b/sourcecode/toutiao/default/app.json index 9c386d55e..5bcb84044 100755 --- a/sourcecode/toutiao/default/app.json +++ b/sourcecode/toutiao/default/app.json @@ -16,7 +16,7 @@ "pages/user-order/user-order", "pages/user-order-detail/user-order-detail", "pages/user-order-comments/user-order-comments", - "pages/user-faovr/user-faovr", + "pages/user-favor/user-favor", "pages/user-answer-list/user-answer-list", "pages/answer-list/answer-list", "pages/answer-form/answer-form", @@ -82,7 +82,7 @@ "pages/plugins/shop/detail/detail", "pages/plugins/shop/search/search", "pages/plugins/shop/design/design", - "pages/plugins/shop/faovr/faovr" + "pages/plugins/shop/favor/favor" ], "window": { "navigationBarTitleText": "{{application_title}}", diff --git a/sourcecode/toutiao/default/pages/plugins/shop/faovr/faovr.js b/sourcecode/toutiao/default/pages/plugins/shop/favor/favor.js similarity index 100% rename from sourcecode/toutiao/default/pages/plugins/shop/faovr/faovr.js rename to sourcecode/toutiao/default/pages/plugins/shop/favor/favor.js diff --git a/sourcecode/toutiao/default/pages/plugins/shop/faovr/faovr.json b/sourcecode/toutiao/default/pages/plugins/shop/favor/favor.json similarity index 100% rename from sourcecode/toutiao/default/pages/plugins/shop/faovr/faovr.json rename to sourcecode/toutiao/default/pages/plugins/shop/favor/favor.json diff --git a/sourcecode/toutiao/default/pages/plugins/shop/faovr/faovr.ttml b/sourcecode/toutiao/default/pages/plugins/shop/favor/favor.ttml similarity index 100% rename from sourcecode/toutiao/default/pages/plugins/shop/faovr/faovr.ttml rename to sourcecode/toutiao/default/pages/plugins/shop/favor/favor.ttml diff --git a/sourcecode/toutiao/default/pages/plugins/shop/faovr/faovr.ttss b/sourcecode/toutiao/default/pages/plugins/shop/favor/favor.ttss similarity index 100% rename from sourcecode/toutiao/default/pages/plugins/shop/faovr/faovr.ttss rename to sourcecode/toutiao/default/pages/plugins/shop/favor/favor.ttss diff --git a/sourcecode/toutiao/default/pages/user-faovr/user-faovr.js b/sourcecode/toutiao/default/pages/user-favor/user-favor.js similarity index 100% rename from sourcecode/toutiao/default/pages/user-faovr/user-faovr.js rename to sourcecode/toutiao/default/pages/user-favor/user-favor.js diff --git a/sourcecode/toutiao/default/pages/user-faovr/user-faovr.json b/sourcecode/toutiao/default/pages/user-favor/user-favor.json similarity index 100% rename from sourcecode/toutiao/default/pages/user-faovr/user-faovr.json rename to sourcecode/toutiao/default/pages/user-favor/user-favor.json diff --git a/sourcecode/toutiao/default/pages/user-faovr/user-faovr.ttml b/sourcecode/toutiao/default/pages/user-favor/user-favor.ttml similarity index 100% rename from sourcecode/toutiao/default/pages/user-faovr/user-faovr.ttml rename to sourcecode/toutiao/default/pages/user-favor/user-favor.ttml diff --git a/sourcecode/toutiao/default/pages/user-faovr/user-faovr.ttss b/sourcecode/toutiao/default/pages/user-favor/user-favor.ttss similarity index 100% rename from sourcecode/toutiao/default/pages/user-faovr/user-faovr.ttss rename to sourcecode/toutiao/default/pages/user-favor/user-favor.ttss diff --git a/sourcecode/toutiao/default/pages/user/user.js b/sourcecode/toutiao/default/pages/user/user.js index 4e07b0780..ddefc7584 100755 --- a/sourcecode/toutiao/default/pages/user/user.js +++ b/sourcecode/toutiao/default/pages/user/user.js @@ -6,7 +6,7 @@ Page({ message_total: 0, head_nav_list: [ { name: "订单总数", url: "user-order", count: 0 }, - { name: "商品收藏", url: "user-faovr", count: 0 }, + { name: "商品收藏", url: "user-favor", count: 0 }, { name: "我的足迹", url: "user-goods-browse", count: 0 }, { name: "我的积分", url: "user-integral", count: 0 }, ], diff --git a/sourcecode/weixin/default/app.json b/sourcecode/weixin/default/app.json index ebbfde39b..790f967fb 100755 --- a/sourcecode/weixin/default/app.json +++ b/sourcecode/weixin/default/app.json @@ -16,7 +16,7 @@ "pages/user-order/user-order", "pages/user-order-detail/user-order-detail", "pages/user-order-comments/user-order-comments", - "pages/user-faovr/user-faovr", + "pages/user-favor/user-favor", "pages/user-answer-list/user-answer-list", "pages/answer-list/answer-list", "pages/answer-form/answer-form", @@ -87,7 +87,7 @@ "pages/plugins/shop/detail/detail", "pages/plugins/shop/search/search", "pages/plugins/shop/design/design", - "pages/plugins/shop/faovr/faovr" + "pages/plugins/shop/favor/favor" ], "permission": { "scope.userLocation": { diff --git a/sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.js b/sourcecode/weixin/default/pages/plugins/shop/favor/favor.js similarity index 100% rename from sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.js rename to sourcecode/weixin/default/pages/plugins/shop/favor/favor.js diff --git a/sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.json b/sourcecode/weixin/default/pages/plugins/shop/favor/favor.json similarity index 100% rename from sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.json rename to sourcecode/weixin/default/pages/plugins/shop/favor/favor.json diff --git a/sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.wxml b/sourcecode/weixin/default/pages/plugins/shop/favor/favor.wxml similarity index 100% rename from sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.wxml rename to sourcecode/weixin/default/pages/plugins/shop/favor/favor.wxml diff --git a/sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.wxss b/sourcecode/weixin/default/pages/plugins/shop/favor/favor.wxss similarity index 100% rename from sourcecode/weixin/default/pages/plugins/shop/faovr/faovr.wxss rename to sourcecode/weixin/default/pages/plugins/shop/favor/favor.wxss diff --git a/sourcecode/weixin/default/pages/user-faovr/user-faovr.js b/sourcecode/weixin/default/pages/user-favor/user-favor.js similarity index 100% rename from sourcecode/weixin/default/pages/user-faovr/user-faovr.js rename to sourcecode/weixin/default/pages/user-favor/user-favor.js diff --git a/sourcecode/weixin/default/pages/user-faovr/user-faovr.json b/sourcecode/weixin/default/pages/user-favor/user-favor.json similarity index 100% rename from sourcecode/weixin/default/pages/user-faovr/user-faovr.json rename to sourcecode/weixin/default/pages/user-favor/user-favor.json diff --git a/sourcecode/weixin/default/pages/user-faovr/user-faovr.wxml b/sourcecode/weixin/default/pages/user-favor/user-favor.wxml similarity index 100% rename from sourcecode/weixin/default/pages/user-faovr/user-faovr.wxml rename to sourcecode/weixin/default/pages/user-favor/user-favor.wxml diff --git a/sourcecode/weixin/default/pages/user-faovr/user-faovr.wxss b/sourcecode/weixin/default/pages/user-favor/user-favor.wxss similarity index 100% rename from sourcecode/weixin/default/pages/user-faovr/user-faovr.wxss rename to sourcecode/weixin/default/pages/user-favor/user-favor.wxss diff --git a/sourcecode/weixin/default/pages/user/user.js b/sourcecode/weixin/default/pages/user/user.js index 7a79ba89a..24c3eda65 100755 --- a/sourcecode/weixin/default/pages/user/user.js +++ b/sourcecode/weixin/default/pages/user/user.js @@ -6,7 +6,7 @@ Page({ message_total: 0, head_nav_list: [ { name: "订单总数", url: "user-order", count: 0 }, - { name: "商品收藏", url: "user-faovr", count: 0 }, + { name: "商品收藏", url: "user-favor", count: 0 }, { name: "我的足迹", url: "user-goods-browse", count: 0 }, { name: "我的积分", url: "user-integral", count: 0 }, ], -- Gitee From dbece4e1998d86b9f1dcc6c0125ab374bf62ccbf Mon Sep 17 00:00:00 2001 From: Devil Date: Mon, 30 Aug 2021 23:52:18 +0800 Subject: [PATCH 52/57] =?UTF-8?q?=20=E9=93=B6=E8=81=94=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=80=80=E6=AC=BE=E5=BC=82=E6=AD=A5=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=A4=84=E7=90=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/payment/ChinaUmsWeixin.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extend/payment/ChinaUmsWeixin.php b/extend/payment/ChinaUmsWeixin.php index 907f2aa24..588cf8c44 100644 --- a/extend/payment/ChinaUmsWeixin.php +++ b/extend/payment/ChinaUmsWeixin.php @@ -50,7 +50,7 @@ class ChinaUmsWeixin // 基础信息 $base = [ 'name' => '银联商务-微信', // 插件名称 - 'version' => '1.0.1', // 插件版本 + 'version' => '1.0.2', // 插件版本 'apply_version' => '不限', // 适用系统版本描述 'apply_terminal'=> ['weixin'], // 适用终端 默认全部 ['pc', 'h5', 'app', 'alipay', 'weixin', 'baidu'] 'desc' => '适用微信小程序,即时到帐支付方式,买家的交易资金直接打入卖家账户,快速回笼交易资金。 立即申请', // 插件描述(支持html) @@ -216,6 +216,12 @@ class ChinaUmsWeixin return DataReturn('支付参数有误', -1); } + // 退款通直接成功结束 + if($params['status'] == 'TRADE_REFUND') + { + die('SUCCESS'); + } + // 状态 if($params['status'] == 'TRADE_SUCCESS') { -- Gitee From 920fcb58070efd8de34cdb5044976b73d61445f1 Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 31 Aug 2021 16:05:18 +0800 Subject: [PATCH 53/57] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=88=A4=E6=96=ADjs=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/view/default/public/header.html | 1 + 1 file changed, 1 insertion(+) diff --git a/app/index/view/default/public/header.html b/app/index/view/default/public/header.html index 4b27e4a99..0f6f9dd0b 100755 --- a/app/index/view/default/public/header.html +++ b/app/index/view/default/public/header.html @@ -72,6 +72,7 @@ var __seo_url_suffix__ = '{{:MyC("home_seo_url_html_suffix", "html", true)}}'; var __user_id__ = {{if empty($user['id'])}}0{{else /}}{{$user.id}}{{/if}}; var __currency_symbol__ = '{{$currency_symbol}}'; + var __is_mobile__ = '{{if IsMobile()}}1{{else}}0{{/if}}'; -- Gitee From a7b45d4f47412888b6a565b24dd7e8027f52dead Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 31 Aug 2021 16:06:01 +0800 Subject: [PATCH 54/57] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=96=B0=E5=A2=9E=E6=9D=83=E9=99=90=E5=92=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Common.php | 4 + app/admin/controller/Index.php | 109 ++-- app/admin/view/default/appconfig/base.html | 2 +- app/admin/view/default/config/index.html | 4 + app/admin/view/default/index/init.html | 465 +++++---------- app/admin/view/default/index/stats_where.html | 15 + app/admin/view/default/public/header.html | 1 + app/service/StatisticalService.php | 407 ++++++++++--- .../static/admin/default/css/index.init.css | 71 ++- public/static/admin/default/js/index.init.js | 561 ++++++++++++++++++ public/static/admin/default/js/index.js | 177 ------ 11 files changed, 1192 insertions(+), 624 deletions(-) create mode 100644 app/admin/view/default/index/stats_where.html create mode 100644 public/static/admin/default/js/index.init.js diff --git a/app/admin/controller/Common.php b/app/admin/controller/Common.php index 6642db5eb..45735267e 100755 --- a/app/admin/controller/Common.php +++ b/app/admin/controller/Common.php @@ -230,6 +230,10 @@ class Common extends BaseController // 系统基础信息 $is_system_show_base = (empty($site_store_info) || empty($site_store_info['vip']) || !isset($site_store_info['vip']['status']) || $site_store_info['vip']['status'] == 0 || ($site_store_info['vip']['status'] == 1 && (AdminIsPower('index', 'storeaccountsbind') || AdminIsPower('index', 'inspectupgrade')))) ? 1 : 0; MyViewAssign('is_system_show_base', $is_system_show_base); + + // 后台公告 + $admin_notice = MyC('admin_notice'); + MyViewAssign('admin_notice', empty($admin_notice) ? '' : str_replace("\n", '
    ', $admin_notice)); } /** diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 52c281acd..03da2fafc 100755 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -72,47 +72,55 @@ class Index extends Common { // 系统信息 $mysql_ver = \think\facade\Db::query('SELECT VERSION() AS `ver`'); - $data = array( - 'server_ver' => php_sapi_name(), - 'php_ver' => PHP_VERSION, - 'mysql_ver' => isset($mysql_ver[0]['ver']) ? $mysql_ver[0]['ver'] : '', - 'os_ver' => PHP_OS, - 'host' => isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : '', - 'ver' => 'ShopXO'.' '.APPLICATION_VERSION, - ); + $data = [ + 'server_ver' => php_sapi_name(), + 'php_ver' => PHP_VERSION, + 'mysql_ver' => isset($mysql_ver[0]['ver']) ? $mysql_ver[0]['ver'] : '', + 'os_ver' => PHP_OS, + 'host' => isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : '', + 'ver' => 'ShopXO'.' '.APPLICATION_VERSION, + ]; MyViewAssign('data', $data); - // 用户 - $user = StatisticalService::UserYesterdayTodayTotal(); - MyViewAssign('user', $user['data']); - - // 订单总数 - $order_number = StatisticalService::OrderNumberYesterdayTodayTotal(); - MyViewAssign('order_number', $order_number['data']); - - // 订单成交总量 - $order_complete_number = StatisticalService::OrderCompleteYesterdayTodayTotal(); - MyViewAssign('order_complete_number', $order_complete_number['data']); - - // 订单收入总计 - $order_complete_money = StatisticalService::OrderCompleteMoneyYesterdayTodayTotal(); - MyViewAssign('order_complete_money', $order_complete_money['data']); - - // 近30日订单成交金额走势 - $order_profit_chart = StatisticalService::OrderProfitSevenTodayTotal(); - MyViewAssign('order_profit_chart', $order_profit_chart['data']); - - // 近30日订单交易走势 - $order_trading_trend = StatisticalService::OrderTradingTrendSevenTodayTotal(); - MyViewAssign('order_trading_trend', $order_trading_trend['data']); - - // 近30日支付方式 - $pay_type_number = StatisticalService::PayTypeSevenTodayTotal(); - MyViewAssign('pay_type_number', $pay_type_number['data']); - - // 近30日热销商品 - $goods_hot_sale = StatisticalService::GoodsHotSaleSevenTodayTotal(); - MyViewAssign('goods_hot_sale', $goods_hot_sale['data']); + // 用户是否有数据统计权限 + $is_stats = AdminIsPower('index', 'stats'); + MyViewAssign('is_stats', $is_stats); + if($is_stats == 1) + { + // 默认时间 + $default_day = '30-day'; + MyViewAssign('default_day', $default_day); + + // 时间 + $time_data = StatisticalService::DateTimeList(); + MyViewAssign('time_data', $time_data); + + // 基础数据总计 + $time = []; + if(!empty($time_data) && !empty($default_day) && isset($time_data[$default_day])) + { + $time['start'] = strtotime($time_data[$default_day]['start']); + $time['end'] = strtotime($time_data[$default_day]['end']); + } + $base_count = StatisticalService::BaseTotalCount($time); + MyViewAssign('base_count', $base_count['data']); + + // 用户 + $user = StatisticalService::UserYesterdayTodayTotal(); + MyViewAssign('user', $user['data']); + + // 订单总数 + $order_number = StatisticalService::OrderNumberYesterdayTodayTotal(); + MyViewAssign('order_number', $order_number['data']); + + // 订单成交总量 + $order_complete_number = StatisticalService::OrderCompleteYesterdayTodayTotal(); + MyViewAssign('order_complete_number', $order_complete_number['data']); + + // 订单收入总计 + $order_complete_money = StatisticalService::OrderCompleteMoneyYesterdayTodayTotal(); + MyViewAssign('order_complete_money', $order_complete_money['data']); + } return MyView(); } @@ -188,5 +196,28 @@ class Index extends Common $params = $this->data_request; return SystemUpgradeService::Run($params); } + + /** + * 统计数据 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-30 + * @desc description + */ + public function Stats() + { + // 是否ajax请求 + if(!IS_AJAX) + { + return $this->error('非法访问'); + } + + // 权限校验 + $this->IsPower(); + + $params = $this->data_request; + return StatisticalService::StatsData($params); + } } ?> \ No newline at end of file diff --git a/app/admin/view/default/appconfig/base.html b/app/admin/view/default/appconfig/base.html index 73133dc07..f4e11555b 100755 --- a/app/admin/view/default/appconfig/base.html +++ b/app/admin/view/default/appconfig/base.html @@ -29,7 +29,7 @@
    - +
    diff --git a/app/admin/view/default/config/index.html b/app/admin/view/default/config/index.html index f6ba37504..4b836efcb 100755 --- a/app/admin/view/default/config/index.html +++ b/app/admin/view/default/config/index.html @@ -23,6 +23,10 @@
    +
    + + +
    diff --git a/app/admin/view/default/index/init.html b/app/admin/view/default/index/init.html index 7ba2cc18f..e62b42582 100755 --- a/app/admin/view/default/index/init.html +++ b/app/admin/view/default/index/init.html @@ -1,7 +1,7 @@ {{include file="public/header" /}} -
    +
    {{if $is_system_show_base eq 1}} @@ -44,152 +44,169 @@
    {{/if}} - -
    -
    - - 商城统计 + + {{if !empty($admin_notice)}} +
    + +

    {{$admin_notice|raw}}

    -
      -
    • -
      -

      用户总量

      -

      0

      -
      - 上月 - 0 -
      -
      - 当月 - 0 -
      -
      - 昨日 - 0 -
      -
      - 今日 - 0 -
      - -
      -
    • -
    • -
      -

      订单总量

      -

      0

      -
      - 上月 - 0 -
      -
      - 当月 - 0 -
      -
      - 昨日 - 0 -
      -
      - 今日 - 0 -
      - -
      -
    • -
    • -
      -

      成交总量

      -

      0

      -
      - 上月 - 0 -
      -
      - 当月 - 0 -
      -
      - 昨日 - 0 -
      -
      - 今日 - 0 -
      - -
      -
    • -
    • -
      -

      收入总计

      -

      0.00

      -
      - 上月 - 0 + {{/if}} + + + {{if isset($is_stats) and $is_stats eq 1}} + +
      +
      + + 商城统计 + + {{include file="/index/stats_where" type="base-count" init="0" /}} +
      +
        +
      • +
        +

        用户总量

        +

        0

        +
        + 上月 + 0 +
        +
        + 当月 + 0 +
        +
        + 昨日 + 0 +
        +
        + 今日 + 0 +
        +
        -
        - 当月 - 0 +
      • +
      • +
        +

        订单总量

        +

        0

        +
        + 上月 + 0 +
        +
        + 当月 + 0 +
        +
        + 昨日 + 0 +
        +
        + 今日 + 0 +
        +
        -
        - 昨日 - 0.00 +
      • +
      • +
        +

        成交总量

        +

        0

        +
        + 上月 + 0 +
        +
        + 当月 + 0 +
        +
        + 昨日 + 0 +
        +
        + 今日 + 0 +
        +
        -
        - 今日 - 0.00 +
      • +
      • +
        +

        收入总计

        +

        0.00

        +
        + 上月 + 0 +
        +
        + 当月 + 0 +
        +
        + 昨日 + 0.00 +
        +
        + 今日 + 0.00 +
        +
        - -
      -
    • -
    -
    - - -
    -
    - - 近30日订单成交金额走势 + +
    -
    -
    - -
    -
    - - 近30日订单交易走势 -
    -
    -
    - - -
      -
    • - -
      + +
      +
      - 近30日热销商品 + 订单成交金额走势 + {{include file="/index/stats_where" type="order-profit" init="1" /}}
      -
      -
    • +
      +
    -
  • - -
    + +
    +
    - 近30日支付方式 + 订单交易走势 + {{include file="/index/stats_where" type="order-trading" init="1" /}}
    -
    -
  • - +
    +
    + + +
      +
    • + +
      + + 热销商品 + {{include file="/index/stats_where" type="goods-hot" init="1" /}} +
      +
      +
    • + +
    • + +
      + + 支付方式 + {{include file="/index/stats_where" type="pay-type" init="1" /}} +
      +
      +
    • +
    + {{/if}} {{if $is_system_show_base eq 1}}
    • -
      +
      系统信息
      @@ -215,7 +232,7 @@
    • -
      +
      开发团队
      @@ -284,188 +301,22 @@ \ No newline at end of file diff --git a/app/admin/view/default/index/stats_where.html b/app/admin/view/default/index/stats_where.html new file mode 100644 index 000000000..ac270878e --- /dev/null +++ b/app/admin/view/default/index/stats_where.html @@ -0,0 +1,15 @@ +
      + {{if !empty($time_data)}} + + {{foreach $time_data as $k=>$v}} + {{$v.name}} + {{/foreach}} + + {{/if}} + + + - + + + +
      \ No newline at end of file diff --git a/app/admin/view/default/public/header.html b/app/admin/view/default/public/header.html index c44eb02c2..a8f620e23 100755 --- a/app/admin/view/default/public/header.html +++ b/app/admin/view/default/public/header.html @@ -64,6 +64,7 @@ var __public__ = '{{$public_host}}'; var __attachment_host__ = '{{$attachment_host}}'; var __currency_symbol__ = '{{$currency_symbol}}'; + var __is_mobile__ = '{{if IsMobile()}}1{{else}}0{{/if}}'; {{if $module_name.$controller_name.$action_name neq 'adminindexindex'}} diff --git a/app/service/StatisticalService.php b/app/service/StatisticalService.php index 52238f3bc..11e11f73a 100755 --- a/app/service/StatisticalService.php +++ b/app/service/StatisticalService.php @@ -22,38 +22,50 @@ use think\facade\Db; class StatisticalService { // 近3天,近7天,近15天,近30天 - private static $nearly_three_days; - private static $nearly_seven_days; - private static $nearly_fifteen_days; - private static $nearly_thirty_days; + public static $nearly_three_days; + public static $nearly_seven_days; + public static $nearly_fifteen_days; + public static $nearly_thirty_days; + + // 昨天 + public static $yesterday_time_start; + public static $yesterday_time_end; + + // 今天 + public static $today_time_start; + public static $today_time_end; // 近30天 - private static $thirty_time_start; - private static $thirty_time_end; + public static $thirty_time_start; + public static $thirty_time_end; // 近15天 - private static $fifteen_time_start; - private static $fifteen_time_end; + public static $fifteen_time_start; + public static $fifteen_time_end; // 近7天 - private static $seven_time_start; - private static $seven_time_end; + public static $seven_time_start; + public static $seven_time_end; + + // 近3天 + public static $three_time_start; + public static $three_time_end; // 上月 - private static $last_month_time_start; - private static $last_month_time_end; + public static $last_month_time_start; + public static $last_month_time_end; // 当月 - private static $same_month_time_start; - private static $same_month_time_end; + public static $this_month_time_start; + public static $this_month_time_end; - // 昨天 - private static $yesterday_time_start; - private static $yesterday_time_end; + // 去年 + public static $this_year_time_start; + public static $this_year_time_end; - // 今天 - private static $today_time_start; - private static $today_time_end; + // 今年 + public static $last_year_time_start; + public static $last_year_time_end; /** * 初始化 @@ -72,33 +84,46 @@ class StatisticalService // 初始化标记对象,避免重复初始化 $object = (object) []; + // 昨天日期 + self::$yesterday_time_start = strtotime(date('Y-m-d 00:00:00', strtotime('-1 day'))); + self::$yesterday_time_end = strtotime(date('Y-m-d 23:59:59', strtotime('-1 day'))); + + // 今天日期 + self::$today_time_start = strtotime(date('Y-m-d 00:00:00')); + self::$today_time_end = time(); + // 近30天日期 - self::$thirty_time_start = strtotime(date('Y-m-d 00:00:00', strtotime('-30 day'))); + self::$thirty_time_start = strtotime(date('Y-m-d 00:00:00', strtotime('-29 day'))); self::$thirty_time_end = time(); // 近15天日期 - self::$fifteen_time_start = strtotime(date('Y-m-d 00:00:00', strtotime('-15 day'))); + self::$fifteen_time_start = strtotime(date('Y-m-d 00:00:00', strtotime('-14 day'))); self::$fifteen_time_end = time(); // 近7天日期 - self::$seven_time_start = strtotime(date('Y-m-d 00:00:00', strtotime('-7 day'))); + self::$seven_time_start = strtotime(date('Y-m-d 00:00:00', strtotime('-6 day'))); self::$seven_time_end = time(); + // 近3天日期 + self::$three_time_start = strtotime(date('Y-m-d 00:00:00', strtotime('-2 day'))); + self::$three_time_end = time(); + // 上月 self::$last_month_time_start = strtotime(date('Y-m-01 00:00:00', strtotime('-1 month', strtotime(date('Y-m', time()))))); self::$last_month_time_end = strtotime(date('Y-m-t 23:59:59', strtotime('-1 month', strtotime(date('Y-m', time()))))); // 当月 - self::$same_month_time_start = strtotime(date('Y-m-01 00:00:00')); - self::$same_month_time_end = time(); + self::$this_month_time_start = strtotime(date('Y-m-01 00:00:00')); + self::$this_month_time_end = time(); - // 昨天日期 - self::$yesterday_time_start = strtotime(date('Y-m-d 00:00:00', strtotime('-1 day'))); - self::$yesterday_time_end = strtotime(date('Y-m-d 23:59:59', strtotime('-1 day'))); + // 去年 + self::$last_year_time_start = strtotime(date('Y-01-01 00:00:00', strtotime('-1 year', strtotime(date('Y-m', time()))))); + self::$last_year_time_end = strtotime(date('Y-12-31 23:59:59', strtotime('-1 year', strtotime(date('Y-m', time()))))); + + // 今年 + self::$this_year_time_start = strtotime(date('Y-01-01 00:00:00')); + self::$this_year_time_end = time(); - // 今天日期 - self::$today_time_start = strtotime(date('Y-m-d 00:00:00')); - self::$today_time_end = time(); // 近3天,近7天,近15天,近30天 $nearly_all = [ @@ -124,6 +149,65 @@ class StatisticalService } } + /** + * 获取时间列表 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-31 + * @desc description + * @param [array] $params [数据参数] + */ + public static function DateTimeList($params = []) + { + // 初始化 + self::Init($params); + + // 统计时间配置列表 + return [ + '3-day' => [ + 'name' => '近3天', + 'start' => date('Y-m-d H:i:s', StatisticalService::$three_time_start), + 'end' => date('Y-m-d H:i:s', StatisticalService::$three_time_end), + ], + '7-day' => [ + 'name' => '近7天', + 'start' => date('Y-m-d H:i:s', StatisticalService::$seven_time_start), + 'end' => date('Y-m-d H:i:s', StatisticalService::$seven_time_end), + ], + '15-day' => [ + 'name' => '近15天', + 'start' => date('Y-m-d H:i:s', StatisticalService::$fifteen_time_start), + 'end' => date('Y-m-d H:i:s', StatisticalService::$fifteen_time_end), + ], + '30-day' => [ + 'name' => '近30天', + 'start' => date('Y-m-d H:i:s', StatisticalService::$thirty_time_start), + 'end' => date('Y-m-d H:i:s', StatisticalService::$thirty_time_end), + ], + 'this-month' => [ + 'name' => '当月', + 'start' => date('Y-m-d H:i:s', StatisticalService::$this_month_time_start), + 'end' => date('Y-m-d H:i:s', StatisticalService::$this_month_time_end), + ], + 'last-month' => [ + 'name' => '上月', + 'start' => date('Y-m-d H:i:s', StatisticalService::$last_month_time_start), + 'end' => date('Y-m-d H:i:s', StatisticalService::$last_month_time_end), + ], + 'this-year' => [ + 'name' => '今年', + 'start' => date('Y-m-d H:i:s', StatisticalService::$this_year_time_start), + 'end' => date('Y-m-d H:i:s', StatisticalService::$this_year_time_end), + ], + 'last-year' => [ + 'name' => '去年', + 'start' => date('Y-m-d H:i:s', StatisticalService::$last_year_time_start), + 'end' => date('Y-m-d H:i:s', StatisticalService::$last_year_time_end), + ], + ]; + } + /** * 用户总数,今日,昨日,当月,上月总数 * @author Devil @@ -137,9 +221,6 @@ class StatisticalService // 初始化 self::Init($params); - // 总数 - $total_count = Db::name('User')->count(); - // 上月 $where = [ ['status', '<=', 4], @@ -151,8 +232,8 @@ class StatisticalService // 当月 $where = [ ['status', '<=', 4], - ['add_time', '>=', self::$same_month_time_start], - ['add_time', '<=', self::$same_month_time_end], + ['add_time', '>=', self::$this_month_time_start], + ['add_time', '<=', self::$this_month_time_end], ]; $same_month_count = Db::name('User')->where($where)->count(); @@ -172,7 +253,6 @@ class StatisticalService // 数据组装 $result = [ - 'total_count' => $total_count, 'last_month_count' => $last_month_count, 'same_month_count' => $same_month_count, 'yesterday_count' => $yesterday_count, @@ -197,12 +277,6 @@ class StatisticalService // 订单状态 // (0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭) - // 总数 - $where = [ - ['status', '<=', 4], - ]; - $total_count = Db::name('Order')->where($where)->count(); - // 上月 $where = [ ['status', '<=', 4], @@ -214,8 +288,8 @@ class StatisticalService // 当月 $where = [ ['status', '<=', 4], - ['add_time', '>=', self::$same_month_time_start], - ['add_time', '<=', self::$same_month_time_end], + ['add_time', '>=', self::$this_month_time_start], + ['add_time', '<=', self::$this_month_time_end], ]; $same_month_count = Db::name('Order')->where($where)->count(); @@ -237,7 +311,6 @@ class StatisticalService // 数据组装 $result = [ - 'total_count' => $total_count, 'last_month_count' => $last_month_count, 'same_month_count' => $same_month_count, 'yesterday_count' => $yesterday_count, @@ -261,12 +334,6 @@ class StatisticalService // 订单状态 // (0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭) - - // 总数 - $where = [ - ['status', '=', 4], - ]; - $total_count = Db::name('Order')->where($where)->count(); // 上月 $where = [ @@ -279,8 +346,8 @@ class StatisticalService // 当月 $where = [ ['status', '=', 4], - ['add_time', '>=', self::$same_month_time_start], - ['add_time', '<=', self::$same_month_time_end], + ['add_time', '>=', self::$this_month_time_start], + ['add_time', '<=', self::$this_month_time_end], ]; $same_month_count = Db::name('Order')->where($where)->count(); @@ -302,7 +369,6 @@ class StatisticalService // 数据组装 $result = [ - 'total_count' => $total_count, 'last_month_count' => $last_month_count, 'same_month_count' => $same_month_count, 'yesterday_count' => $yesterday_count, @@ -326,12 +392,6 @@ class StatisticalService // 订单状态 // (0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭) - - // 总数 - $where = [ - ['status', 'in', [2,3,4]], - ]; - $total_count = Db::name('Order')->where($where)->sum('total_price'); // 上月 $where = [ @@ -344,8 +404,8 @@ class StatisticalService // 当月 $where = [ ['status', 'in', [2,3,4]], - ['add_time', '>=', self::$same_month_time_start], - ['add_time', '<=', self::$same_month_time_end], + ['add_time', '>=', self::$this_month_time_start], + ['add_time', '<=', self::$this_month_time_end], ]; $same_month_count = Db::name('Order')->where($where)->sum('total_price'); @@ -367,7 +427,6 @@ class StatisticalService // 数据组装 $result = [ - 'total_count' => PriceNumberFormat($total_count), 'last_month_count' => PriceNumberFormat($last_month_count), 'same_month_count' => PriceNumberFormat($same_month_count), 'yesterday_count' => PriceNumberFormat($yesterday_count), @@ -377,18 +436,98 @@ class StatisticalService } /** - * 订单收益趋势, 30天数据 + * 基础数据总计 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-31 + * @desc description + * @param [array] $params [输入参数] + */ + public static function BaseTotalCount($params = []) + { + // 日期条件处理 + $where = []; + if(!empty($params['start'])) + { + $where[] = ['add_time', '>=', $params['start']]; + } + if(!empty($params['end'])) + { + $where[] = ['add_time', '<=', $params['end']]; + } + + // 用户总数 + $user_count = Db::name('User')->where($where)->count(); + + // 订单总数 + $order_count = Db::name('Order')->where(array_merge($where, [['status', '<=', 4]]))->count(); + + // 订单成交总量 + $order_sale_count = Db::name('Order')->where(array_merge($where, [['status', '=', 4]]))->count(); + + // 订单收入总计 + $order_complete_total = PriceNumberFormat(Db::name('Order')->where(array_merge($where, [['status', 'in', [2,3,4]]]))->sum('total_price')); + + $result = [ + 'user_count' => $user_count, + 'order_count' => $order_count, + 'order_sale_count' => $order_sale_count, + 'order_complete_total' => $order_complete_total, + ]; + return DataReturn('处理成功', 0, $result); + } + + /** + * 区间时间创建 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-30 + * @desc description + * @param [int] $start [起始时间] + * @param [int] $end [结束时间] + */ + public static function DayCreate($start, $end) + { + $data = []; + while(true) + { + // 计算时间条件 + $temp_end = strtotime('+1 day', $start); + + // 最大时间减1秒,条件使用 start >= ? && end <= ? + // start 2021-01-01 00:00:00 , end 2021-01-01 23:59:58 + $data[] = [ + 'start' => $start, + 'end' => $temp_end-1, + 'date' => date('Y-m-d H:i:s', $start).' - '.date('Y-m-d H:i:s', $temp_end-1), + ]; + + // 结束跳出循环 + if($temp_end >= $end) + { + // 结束使用最大时间替代计算的最后一个最大时间 + $count = count($data)-1; + $data[$count]['end'] = $end; + $data[$count]['date'] = date('Y-m-d H:i:s', $data[$count]['start']).' - '.date('Y-m-d H:i:s', $end); + break; + } + $start = $temp_end; + } + return $data; + } + + /** + * 订单收益趋势 * @author Devil * @blog http://gong.gg/ * @version 0.0.1 * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public static function OrderProfitSevenTodayTotal($params = []) + public static function OrderProfitTotal($params = []) { - // 初始化 - self::Init($params); - // 订单状态列表 $order_status_list = MyConst('common_order_status'); $status_arr = array_column($order_status_list, 'id'); @@ -399,10 +538,11 @@ class StatisticalService $name_arr = []; if(!empty($status_arr)) { - foreach(self::$nearly_thirty_days as $day) + $date = self::DayCreate($params['start'], $params['end']); + foreach($date as $day) { // 当前日期名称 - $name_arr[] = $day['name']; + $name_arr[] = date('Y-m-d', $day['start']); // 根据状态获取数量 foreach($status_arr as $status) @@ -410,8 +550,8 @@ class StatisticalService // 获取订单 $where = [ ['status', '=', $status], - ['add_time', '>=', $day['start_time']], - ['add_time', '<=', $day['end_time']], + ['add_time', '>=', $day['start']], + ['add_time', '<=', $day['end']], ]; $value_arr[$status][] = Db::name('Order')->where($where)->sum('pay_price'); } @@ -439,18 +579,15 @@ class StatisticalService } /** - * 订单交易趋势, 30天数据 + * 订单交易趋势 * @author Devil * @blog http://gong.gg/ * @version 0.0.1 * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public static function OrderTradingTrendSevenTodayTotal($params = []) + public static function OrderTradingTotal($params = []) { - // 初始化 - self::Init($params); - // 订单状态列表 $order_status_list = MyConst('common_order_status'); $status_arr = array_column($order_status_list, 'id'); @@ -461,10 +598,11 @@ class StatisticalService $name_arr = []; if(!empty($status_arr)) { - foreach(self::$nearly_thirty_days as $day) + $date = self::DayCreate($params['start'], $params['end']); + foreach($date as $day) { // 当前日期名称 - $name_arr[] = $day['name']; + $name_arr[] = date('Y-m-d', $day['start']); // 根据状态获取数量 foreach($status_arr as $status) @@ -472,8 +610,8 @@ class StatisticalService // 获取订单 $where = [ ['status', '=', $status], - ['add_time', '>=', $day['start_time']], - ['add_time', '<=', $day['end_time']], + ['add_time', '>=', $day['start']], + ['add_time', '<=', $day['end']], ]; $value_arr[$status][] = Db::name('Order')->where($where)->count(); } @@ -501,14 +639,14 @@ class StatisticalService } /** - * 支付方式, 30天数据 + * 支付方式 * @author Devil * @blog http://gong.gg/ * @version 0.0.1 * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public static function PayTypeSevenTodayTotal($params = []) + public static function PayTypeTotal($params = []) { // 初始化 self::Init($params); @@ -527,10 +665,11 @@ class StatisticalService $name_arr = []; if(!empty($pay_name_arr)) { - foreach(self::$nearly_thirty_days as $day) + $date = self::DayCreate($params['start'], $params['end']); + foreach($date as $day) { // 当前日期名称 - $name_arr[] = date('m-d', strtotime($day['name'])); + $name_arr[] = date('m-d', $day['start']); // 根据支付名称获取数量 foreach($pay_name_arr as $payment) @@ -538,8 +677,8 @@ class StatisticalService // 获取订单 $where = [ ['payment_name', '=', $payment], - ['add_time', '>=', $day['start_time']], - ['add_time', '<=', $day['end_time']], + ['add_time', '>=', $day['start']], + ['add_time', '<=', $day['end']], ]; $value_arr[$payment][] = Db::name('PayLog')->where($where)->count(); } @@ -568,23 +707,20 @@ class StatisticalService } /** - * 热销商品, 30天数据 + * 热销商品 * @author Devil * @blog http://gong.gg/ * @version 0.0.1 * @datetime 2016-12-06T21:31:53+0800 * @param [array] $params [输入参数] */ - public static function GoodsHotSaleSevenTodayTotal($params = []) - { - // 初始化 - self::Init($params); - + public static function GoodsHotTotal($params = []) + { // 获取订单id $where = [ ['status', '<=', 4], - ['add_time', '>=', self::$thirty_time_start], - ['add_time', '<=', self::$thirty_time_end], + ['add_time', '>=', $params['start']], + ['add_time', '<=', $params['end']], ]; $order_ids = Db::name('Order')->where($where)->column('id'); @@ -593,7 +729,7 @@ class StatisticalService { $data = []; } else { - $data = Db::name('OrderDetail')->field('goods_id, sum(buy_number) AS value')->where('order_id', 'IN', $order_ids)->group('goods_id')->order('value desc')->limit(10)->select()->toArray(); + $data = Db::name('OrderDetail')->field('goods_id, sum(buy_number) AS value')->where('order_id', 'IN', $order_ids)->group('goods_id')->order('value desc')->limit(30)->select()->toArray(); } if(!empty($data)) @@ -617,5 +753,82 @@ class StatisticalService ]; return DataReturn('处理成功', 0, $result); } + + /** + * 统计数据 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-30 + * @desc description + * @param [array] $params [输入参数] + */ + public static function StatsData($params = []) + { + // 请求类型 + $p = [ + [ + 'checked_type' => 'empty', + 'key_name' => 'type', + 'error_msg' => '类型为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'start', + 'error_msg' => '开始时间为空', + ], + [ + 'checked_type' => 'empty', + 'key_name' => 'end', + 'error_msg' => '结束时间为空', + ], + ]; + $ret = ParamsChecked($params, $p); + if($ret !== true) + { + return DataReturn($ret, -1); + } + + // 时间处理 + $params['start'] = strtotime($params['start']); + $params['end'] = strtotime($params['end']); + if($params['end'] < $params['start']) + { + return DataReturn('开始时间不能小于结束时间', -1); + } + + // 根据类型处理数据 + switch($params['type']) + { + // 基础配置 + case 'base-count' : + $ret = self::BaseTotalCount($params); + break; + + // 订单成交金额走势 + case 'order-profit' : + $ret = self::OrderProfitTotal($params); + break; + + // 订单交易走势 + case 'order-trading' : + $ret = self::OrderTradingTotal($params); + break; + + // 热销商品 + case 'goods-hot' : + $ret = self::GoodsHotTotal($params); + break; + + // 支付方式 + case 'pay-type' : + $ret = self::PayTypeTotal($params); + break; + + default : + $ret = DataReturn('类型有误', -1); + } + return $ret; + } } ?> \ No newline at end of file diff --git a/public/static/admin/default/css/index.init.css b/public/static/admin/default/css/index.init.css index 402863c1c..23406e46d 100755 --- a/public/static/admin/default/css/index.init.css +++ b/public/static/admin/default/css/index.init.css @@ -20,10 +20,10 @@ html, body { margin-bottom: 20px; } -.block-container .echarts-title, .block-combination-container-2 li .echarts-title { +.block-container .block-title, .block-combination-container-2 li .block-title { margin-left: 10px; } -.block-container .echarts-title .icon, .block-combination-container-2 li .echarts-title .icon { +.block-container .block-title .icon, .block-combination-container-2 li .block-title .icon { background: #3f82fe; display: block; width: 5px; @@ -32,11 +32,57 @@ html, body { left: 10px; top: 13px; } -.block-container .echarts-title .title, .block-combination-container-2 li .echarts-title .title { +.block-container .block-title .title, .block-combination-container-2 li .block-title .title { color: #666; font-size: 14px; margin-left: 5px; } +.right-operate .quick-time a { + margin-right: 8px; + color: #bde2f4; +} +.right-operate .quick-time a:hover { + color: #095f8a; +} +.right-operate .echarts-where-time input { + display: -webkit-inline-box !important; + width: 155px !important; + border-color: #eee; + color: #888; +} +.right-operate .echarts-where-submit { + color: #8cd8ff; + background-color: transparent; + border-color: #d0efff; +} +.right-operate .echarts-where-submit:hover { + color: #fff; + background-color: #3bb4f2; + border-color: #3bb4f2; +} +.right-operate .echarts-where-time .join { + color: #ccc; +} +.block-container .echarts-title{ + height: 46px; +} +.block-combination-container-2 li .echarts-title { + height: 100px; +} +.block-combination-container-2 .right-operate { + float: none; +} +.block-combination-container-2 .right-operate .quick-time, +.block-combination-container-2 .right-operate .echarts-where-time { + display: block; + margin-top: 5px; +} +.block-combination-container-2 .right-operate .quick-time { + margin-top: 10px; +} +.block-combination-container-2 .right-operate .echarts-where-time input { + width: calc(50% - 46px) !important; + } @media only screen and (min-width: 641px) { .block-combination-container-2 { margin-bottom: 20px; @@ -60,6 +106,25 @@ html, body { margin-bottom: 20px; } } +@media only screen and (max-width: 800px) { + .block-container .echarts-title { + height: 100px; + } + .right-operate { + float: none; + } + .right-operate .quick-time, + .right-operate .echarts-where-time { + display: block; + margin-top: 5px; + } + .right-operate .quick-time { + margin-top: 10px; + } + .right-operate .echarts-where-time input { + width: calc(50% - 46px) !important; + } +} /** diff --git a/public/static/admin/default/js/index.init.js b/public/static/admin/default/js/index.init.js new file mode 100644 index 000000000..1a78d6dab --- /dev/null +++ b/public/static/admin/default/js/index.init.js @@ -0,0 +1,561 @@ +/** + * 系统更新异步请求步骤 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-02-22 + * @desc description + * @param {[string]} url [url地址] + * @param {[string]} opt [操作类型(url 获取下载地址, download_system 下载系统包, download_upgrade 下载升级包, upgrade 更新操作)] + * @param {[string]} msg [提示信息] + */ +function SystemUpgradeRequestHandle(params) +{ + // 参数处理 + if((params || null) == null) + { + Prompt('操作参数有误'); + return false; + } + var url = params.url || null; + var opt = params.opt || 'url'; + var msg = params.msg || '正在获取中...'; + + // 加载提示 + AMUI.dialog.loading({title: msg}); + + // ajax + $.ajax({ + url: url, + type: 'POST', + dataType: 'json', + timeout: 305000, + data: {"opt":opt}, + success: function(result) + { + if((result || null) != null && result.code == 0) + { + switch(opt) + { + // 获取下载地址 + case 'url' : + params['opt'] = 'download_system'; + params['msg'] = '系统包正在下载中...'; + SystemUpgradeRequestHandle(params); + break; + + // 下载系统包 + case 'download_system' : + params['opt'] = 'download_upgrade'; + params['msg'] = '升级包正在下载中...'; + SystemUpgradeRequestHandle(params); + break; + + // 下载升级包 + case 'download_upgrade' : + params['opt'] = 'upgrade'; + params['msg'] = '正在更新中...'; + SystemUpgradeRequestHandle(params); + break; + + // 更新完成 + case 'upgrade' : + Prompt(result.msg, 'success'); + setTimeout(function() + { + window.location.reload(); + }, 1500); + break; + } + } else { + AMUI.dialog.loading('close'); + Prompt(((result || null) == null) ? '返回数据格式错误' : (result.msg || '异常错误')); + } + }, + error: function(xhr, type) + { + AMUI.dialog.loading('close'); + Prompt(HtmlToString(xhr.responseText) || '异常错误'); + } + }); +} + +/** + * 基础数据总数 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-30 + * @desc description + * @param {[array]} data [数据] + */ +function EchartsBaseCount(data) +{ + $('.base-user-count').text(data.user_count); + $('.base-order-count').text(data.order_count); + $('.base-order-sale-count').text(data.order_asle_count); + $('.base-order-complete-total').text(data.order_complete_total); +} + +/** + * 订单成交金额走势 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-30 + * @desc description + * @param {[array]} title_arr [标题] + * @param {[array]} name_arr [名称] + * @param {[array]} data [数据] + */ +function EchartsOrderProfit(title_arr, name_arr, data) +{ + var chart = echarts.init(document.getElementById('echarts-order-profit'), 'macarons'); + var option = { + tooltip : { + trigger: 'axis', + axisPointer: { + type: 'cross', + label: { + backgroundColor: '#6a7985' + } + } + }, + legend: { + data: title_arr + }, + toolbox: { + show : (__is_mobile__ == 1) ? false : true, + feature : { + mark : {show: true}, + dataView : {show: true, readOnly: false}, + magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']}, + restore : {show: true}, + saveAsImage : {name:'订单交易走势', show: true} + } + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + xAxis : [ + { + type : 'category', + boundaryGap : false, + data : name_arr + } + ], + yAxis : [ + { + type : 'value' + } + ], + series : data + }; + chart.setOption(option); + return chart; +} + +/** + * 订单交易走势 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-30 + * @desc description + * @param {[array]} title_arr [标题] + * @param {[array]} name_arr [名称] + * @param {[array]} data [数据] + */ +function EchartsOrderTrading(title_arr, name_arr, data) +{ + var chart = echarts.init(document.getElementById('echarts-order-trading'), 'macarons'); + var option = { + tooltip : { + trigger: 'axis', + axisPointer: { + type: 'cross', + label: { + backgroundColor: '#6a7985' + } + } + }, + legend: { + data: title_arr + }, + toolbox: { + show : (__is_mobile__ == 1) ? false : true, + feature : { + mark : {show: true}, + dataView : {show: true, readOnly: false}, + magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']}, + restore : {show: true}, + saveAsImage : {name:'订单交易走势', show: true} + } + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + xAxis : [ + { + type : 'category', + boundaryGap : false, + data : name_arr + } + ], + yAxis : [ + { + type : 'value' + } + ], + series : data + }; + chart.setOption(option); + return chart; +} + +/** + * 热销商品 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-30 + * @desc description + * @param {[array]} title_arr [标题] + * @param {[array]} name_arr [名称] + * @param {[array]} data [数据] + */ +function EchartsGoodsHot(data) +{ + var chart = echarts.init(document.getElementById('echarts-goods-hot'), 'macarons'); + var option = { + title : { + subtext: '仅显示前30条商品', + x:'center' + }, + tooltip : { + trigger: 'item', + formatter: "{b} : {c} ({d}%)" + }, + toolbox: { + show : (__is_mobile__ == 1) ? false : true, + feature : { + mark : {show: true}, + dataView : {show: true, readOnly: false}, + magicType : { + show: true, + type: ['pie', 'funnel'], + option: { + funnel: { + x: '25%', + width: '50%', + funnelAlign: 'left', + max: 1548 + } + } + }, + restore : {show: false}, + saveAsImage : {name:'热销商品', show: true} + } + }, + calculable : true, + series : [ + { + type:'pie', + radius : '55%', + center: ['50%', '60%'], + data: data + } + ] + }; + chart.setOption(option); + return chart; +} + +/** + * 支付方式 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-30 + * @desc description + * @param {[array]} title_arr [标题] + * @param {[array]} name_arr [名称] + * @param {[array]} data [数据] + */ +function EchartsPayType(title_arr, name_arr, data) +{ + var chart = echarts.init(document.getElementById('echarts-pay-type'), 'macarons'); + var option = { + tooltip : { + trigger: 'axis' + }, + legend: { + data: title_arr + }, + toolbox: { + show : (__is_mobile__ == 1) ? false : true, + feature : { + mark : {show: true}, + dataView : {show: true, readOnly: false}, + magicType : {show: true, type: ['line', 'bar']}, + restore : {show: false}, + saveAsImage : {name:'支付方式', show: true} + } + }, + calculable : true, + xAxis : [ + { + type : 'category', + boundaryGap : false, + data : name_arr + } + ], + yAxis : [ + { + type : 'value' + } + ], + series : data + }; + chart.setOption(option); + return chart; +} + +/** + * 图表更新 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-08-30 + * @desc description + * @param {[object]} e [操作对象] + */ +var chart_object = []; +function EchartsInit(e) +{ + // 类型 + var $parent = e.parents('.right-operate'); + var type = $parent.data('type'); + + // 时间 + var $time = e.parent(); + var start = $time.find('input[name="time_start"]').val() || ''; + var end = $time.find('input[name="time_end"]').val() || ''; + + // ajax + e.button('loading'); + $.AMUI.progress.start(); + $.ajax({ + url: $('.content-right').data('url'), + type: 'POST', + dataType: 'json', + timeout: 30000, + data: {"type":type, "start":start, "end":end}, + success: function(res) + { + e.button('reset'); + $.AMUI.progress.done(); + if(res.code == 0) + { + var chart = null; + switch(type) + { + // 支付方式 + case 'base-count' : + EchartsBaseCount(res.data); + break; + + // 订单成交金额走势 + case 'order-profit' : + var chart = EchartsOrderProfit(res.data.title_arr, res.data.name_arr, res.data.data); + break; + + // 订单交易走势 + case 'order-trading' : + var chart = EchartsOrderTrading(res.data.title_arr, res.data.name_arr, res.data.data); + break; + + // 热销商品 + case 'goods-hot' : + var chart = EchartsGoodsHot(res.data.data); + break; + + // 支付方式 + case 'pay-type' : + var chart = EchartsPayType(res.data.title_arr, res.data.name_arr, res.data.data); + break; + + default : + console.info('操作类型未定义['+type+']') + } + + // 图表对象存储 + if(chart !== null) + { + chart_object.push(chart); + } + } else { + Prompt(res.msg); + } + }, + error: function(xhr, type) + { + e.button('reset'); + $.AMUI.progress.done(); + Prompt(HtmlToString(xhr.responseText) || '异常错误', null, 30); + } + }); +} + +$(function() +{ + // 检查更新 + var $inspect_upgrade_popup = $('#inspect-upgrade-popup'); + $('.inspect-upgrade-submit').on('click', function() + { + // 基础信息 + AMUI.dialog.loading({title: '正在获取最新内容、请稍候...'}); + + // ajax请求 + $.ajax({ + url: $(this).data('url'), + type: 'POST', + dataType: 'json', + timeout: 30000, + data: {}, + success: function(result) + { + AMUI.dialog.loading('close'); + if(result.code == 0) + { + // html内容处理 + // 基础信息 + // 是否存在数据、网络不通将返回空数据 + if((result.data || null) != null) + { + var html = '

      '; + html += ''; + html += ''+result.data.title+''; + html += '

      '; + html += '
      '; + html += '更新版本:'+result.data.version_new+''; + html += '更新日期:'+result.data.add_time+''; + // 是否带指定链接和链接名称 + if((result.data.go_title || null) != null && (result.data.go_url || null) != null) + { + html += ''+result.data.go_title+''; + } + html += '
      '; + + // 提示信息 + if((result.data.tips || null) != null) + { + html += '
      '; + html += '

      '+result.data.tips+'

      '; + html += '
      '; + } + + // 更新内容介绍 + if((result.data.content || null) != null && result.data.content.length > 0) + { + html += '
      '; + html += '
        '; + for(var i in result.data.content) + { + html += '
      • '+result.data.content[i]+'
      • '; + } + html += '
      '; + html += '
      '; + } + } else { + var html = '

      '; + html += ''; + html += ''+result.msg+''; + html += '

      '; + } + $inspect_upgrade_popup.find('.upgrade-content').html(html); + + // 是否支持在线自动更新 + if((result.data.is_auto || 0) == 1) + { + $inspect_upgrade_popup.find('.inspect-upgrade-confirm').removeClass('am-hide'); + } else { + $inspect_upgrade_popup.find('.inspect-upgrade-confirm').addClass('am-hide'); + } + + // 打开弹窗 + $inspect_upgrade_popup.modal('open'); + } else { + Prompt(result.msg); + } + }, + error: function(xhr, type) + { + AMUI.dialog.loading('close'); + Prompt(HtmlToString(xhr.responseText) || '异常错误', null, 30); + } + }); + }); + + // 系统更新确认 + $('.inspect-upgrade-confirm').on('click', function() + { + $inspect_upgrade_popup.modal('close'); + SystemUpgradeRequestHandle({"url": $(this).data('url')}); + }); + + // 初始化 + $('.content-right .echarts-where-submit').each(function(k ,v) + { + if(parseInt($(this).parents('.right-operate').data('init')) == 1) + { + EchartsInit($(this)); + } + }); + + // 条件确认 + $('.echarts-where-submit').on('click', function() + { + EchartsInit($(this)); + }); + + // 快捷时间 + $('.quick-time a').on('click', function() + { + // 参数判断 + var start = $(this).data('start') || null; + var end = $(this).data('end') || null; + if(start == null || end == null) + { + Prompt('快捷时间配置有误'); + return false; + } + + // 时间 + var $time = $(this).parent().next(); + if(!$time.find('button').is(':disabled')) + { + $time.find('input[name="time_start"]').val(start); + $time.find('input[name="time_end"]').val(end); + $time.find('button').trigger('click'); + } + }); + + // 浏览器大小改变则实时更新图表大小 + window.onresize = function() + { + if(chart_object.length > 0) + { + for(var i in chart_object) + { + chart_object[i].resize(); + } + } + }; +}); \ No newline at end of file diff --git a/public/static/admin/default/js/index.js b/public/static/admin/default/js/index.js index 9ab0e4d7e..923fe4d88 100755 --- a/public/static/admin/default/js/index.js +++ b/public/static/admin/default/js/index.js @@ -1,85 +1,3 @@ -/** - * 系统更新异步请求步骤 - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @date 2021-02-22 - * @desc description - * @param {[string]} url [url地址] - * @param {[string]} opt [操作类型(url 获取下载地址, download_system 下载系统包, download_upgrade 下载升级包, upgrade 更新操作)] - * @param {[string]} msg [提示信息] - */ -function SystemUpgradeRequestHandle(params) -{ - // 参数处理 - if((params || null) == null) - { - Prompt('操作参数有误'); - return false; - } - var url = params.url || null; - var opt = params.opt || 'url'; - var msg = params.msg || '正在获取中...'; - - // 加载提示 - AMUI.dialog.loading({title: msg}); - - // ajax - $.ajax({ - url: url, - type: 'POST', - dataType: 'json', - timeout: 305000, - data: {"opt":opt}, - success: function(result) - { - if((result || null) != null && result.code == 0) - { - switch(opt) - { - // 获取下载地址 - case 'url' : - params['opt'] = 'download_system'; - params['msg'] = '系统包正在下载中...'; - SystemUpgradeRequestHandle(params); - break; - - // 下载系统包 - case 'download_system' : - params['opt'] = 'download_upgrade'; - params['msg'] = '升级包正在下载中...'; - SystemUpgradeRequestHandle(params); - break; - - // 下载升级包 - case 'download_upgrade' : - params['opt'] = 'upgrade'; - params['msg'] = '正在更新中...'; - SystemUpgradeRequestHandle(params); - break; - - // 更新完成 - case 'upgrade' : - Prompt(result.msg, 'success'); - setTimeout(function() - { - window.location.reload(); - }, 1500); - break; - } - } else { - AMUI.dialog.loading('close'); - Prompt(((result || null) == null) ? '返回数据格式错误' : (result.msg || '异常错误')); - } - }, - error: function(xhr, type) - { - AMUI.dialog.loading('close'); - Prompt(HtmlToString(xhr.responseText) || '异常错误'); - } - }); -} - $(function() { /** @@ -259,99 +177,4 @@ $(function() } } }); - - // 检查更新 - var $inspect_upgrade_popup = $('#inspect-upgrade-popup'); - $('.inspect-upgrade-submit').on('click', function() - { - // 基础信息 - AMUI.dialog.loading({title: '正在获取最新内容、请稍候...'}); - - // ajax请求 - $.ajax({ - url: $(this).data('url'), - type: 'POST', - dataType: 'json', - timeout: 30000, - data: {}, - success: function(result) - { - AMUI.dialog.loading('close'); - if(result.code == 0) - { - // html内容处理 - // 基础信息 - // 是否存在数据、网络不通将返回空数据 - if((result.data || null) != null) - { - var html = '

      '; - html += ''; - html += ''+result.data.title+''; - html += '

      '; - html += '
      '; - html += '更新版本:'+result.data.version_new+''; - html += '更新日期:'+result.data.add_time+''; - // 是否带指定链接和链接名称 - if((result.data.go_title || null) != null && (result.data.go_url || null) != null) - { - html += ''+result.data.go_title+''; - } - html += '
      '; - - // 提示信息 - if((result.data.tips || null) != null) - { - html += '
      '; - html += '

      '+result.data.tips+'

      '; - html += '
      '; - } - - // 更新内容介绍 - if((result.data.content || null) != null && result.data.content.length > 0) - { - html += '
      '; - html += '
        '; - for(var i in result.data.content) - { - html += '
      • '+result.data.content[i]+'
      • '; - } - html += '
      '; - html += '
      '; - } - } else { - var html = '

      '; - html += ''; - html += ''+result.msg+''; - html += '

      '; - } - $inspect_upgrade_popup.find('.upgrade-content').html(html); - - // 是否支持在线自动更新 - if((result.data.is_auto || 0) == 1) - { - $inspect_upgrade_popup.find('.inspect-upgrade-confirm').removeClass('am-hide'); - } else { - $inspect_upgrade_popup.find('.inspect-upgrade-confirm').addClass('am-hide'); - } - - // 打开弹窗 - $inspect_upgrade_popup.modal('open'); - } else { - Prompt(result.msg); - } - }, - error: function(xhr, type) - { - AMUI.dialog.loading('close'); - Prompt(HtmlToString(xhr.responseText) || '异常错误', null, 30); - } - }); - }); - - // 系统更新确认 - $('.inspect-upgrade-confirm').on('click', function() - { - $inspect_upgrade_popup.modal('close'); - SystemUpgradeRequestHandle({"url": $(this).data('url')}); - }); }); \ No newline at end of file -- Gitee From 4ffe6e67a2c90d9713491f88e6938ba226c9e8f5 Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 31 Aug 2021 18:08:12 +0800 Subject: [PATCH 55/57] =?UTF-8?q?=20=E5=90=8E=E5=8F=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Index.php | 11 +- app/admin/view/default/index/init.html | 106 +++++++++++++----- app/admin/view/default/index/stats_time.html | 6 + app/admin/view/default/index/stats_where.html | 15 --- app/service/StatisticalService.php | 104 ++++++++++------- .../static/admin/default/css/index.init.css | 15 +-- public/static/admin/default/js/index.init.js | 7 +- 7 files changed, 166 insertions(+), 98 deletions(-) create mode 100644 app/admin/view/default/index/stats_time.html delete mode 100644 app/admin/view/default/index/stats_where.html diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 03da2fafc..1b3143c9f 100755 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -91,6 +91,10 @@ class Index extends Common $default_day = '30-day'; MyViewAssign('default_day', $default_day); + // 收入统计权限 + $is_income = AdminIsPower('index', 'income'); + MyViewAssign('is_income', $is_income); + // 时间 $time_data = StatisticalService::DateTimeList(); MyViewAssign('time_data', $time_data); @@ -118,8 +122,11 @@ class Index extends Common MyViewAssign('order_complete_number', $order_complete_number['data']); // 订单收入总计 - $order_complete_money = StatisticalService::OrderCompleteMoneyYesterdayTodayTotal(); - MyViewAssign('order_complete_money', $order_complete_money['data']); + if($is_income == 1) + { + $order_complete_money = StatisticalService::OrderCompleteMoneyYesterdayTodayTotal(); + MyViewAssign('order_complete_money', $order_complete_money['data']); + } } return MyView(); diff --git a/app/admin/view/default/index/init.html b/app/admin/view/default/index/init.html index e62b42582..b0ca957d6 100755 --- a/app/admin/view/default/index/init.html +++ b/app/admin/view/default/index/init.html @@ -60,9 +60,19 @@ 商城统计 - {{include file="/index/stats_where" type="base-count" init="0" /}} +
      + {{if !empty($time_data)}} + + {{foreach $time_data as $k=>$v}} + {{$v.name}} + {{/foreach}} + 全部 + + {{/if}} + {{include file="/index/stats_time" /}} +
      -
        +
        • 用户总量

          @@ -132,29 +142,32 @@
        • -
        • -
          -

          收入总计

          -

          0.00

          -
          - 上月 - 0 -
          -
          - 当月 - 0 -
          -
          - 昨日 - 0.00 + + {{if isset($is_income) and $is_income eq true}} +
        • +
          +

          收入总计

          +

          0.00

          +
          + 上月 + 0 +
          +
          + 当月 + 0 +
          +
          + 昨日 + 0.00 +
          +
          + 今日 + 0.00 +
          +
          -
          - 今日 - 0.00 -
          - -
    - + + {{/if}} @@ -163,7 +176,16 @@
    订单成交金额走势 - {{include file="/index/stats_where" type="order-profit" init="1" /}} +
    + {{if !empty($time_data)}} + + {{foreach $time_data as $k=>$v}} + {{$v.name}} + {{/foreach}} + + {{/if}} + {{include file="/index/stats_time" /}} +
    @@ -173,7 +195,16 @@
    订单交易走势 - {{include file="/index/stats_where" type="order-trading" init="1" /}} +
    + {{if !empty($time_data)}} + + {{foreach $time_data as $k=>$v}} + {{$v.name}} + {{/foreach}} + + {{/if}} + {{include file="/index/stats_time" /}} +
    @@ -185,7 +216,17 @@
    热销商品 - {{include file="/index/stats_where" type="goods-hot" init="1" /}} +
    + {{if !empty($time_data)}} + + {{foreach $time_data as $k=>$v}} + {{$v.name}} + {{/foreach}} + 全部 + + {{/if}} + {{include file="/index/stats_time" /}} +
    @@ -195,7 +236,16 @@
    支付方式 - {{include file="/index/stats_where" type="pay-type" init="1" /}} +
    + {{if !empty($time_data)}} + + {{foreach $time_data as $k=>$v}} + {{$v.name}} + {{/foreach}} + + {{/if}} + {{include file="/index/stats_time" /}} +
    diff --git a/app/admin/view/default/index/stats_time.html b/app/admin/view/default/index/stats_time.html new file mode 100644 index 000000000..bdf815d69 --- /dev/null +++ b/app/admin/view/default/index/stats_time.html @@ -0,0 +1,6 @@ + + + - + + + \ No newline at end of file diff --git a/app/admin/view/default/index/stats_where.html b/app/admin/view/default/index/stats_where.html deleted file mode 100644 index ac270878e..000000000 --- a/app/admin/view/default/index/stats_where.html +++ /dev/null @@ -1,15 +0,0 @@ -
    - {{if !empty($time_data)}} - - {{foreach $time_data as $k=>$v}} - {{$v.name}} - {{/foreach}} - - {{/if}} - - - - - - - -
    \ No newline at end of file diff --git a/app/service/StatisticalService.php b/app/service/StatisticalService.php index 11e11f73a..789bf6a8d 100755 --- a/app/service/StatisticalService.php +++ b/app/service/StatisticalService.php @@ -393,37 +393,46 @@ class StatisticalService // 订单状态 // (0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭) - // 上月 - $where = [ - ['status', 'in', [2,3,4]], - ['add_time', '>=', self::$last_month_time_start], - ['add_time', '<=', self::$last_month_time_end], - ]; - $last_month_count = Db::name('Order')->where($where)->sum('total_price'); + // 是否有收入统计权限 + if(AdminIsPower('index', 'income')) + { + // 上月 + $where = [ + ['status', 'in', [2,3,4]], + ['add_time', '>=', self::$last_month_time_start], + ['add_time', '<=', self::$last_month_time_end], + ]; + $last_month_count = Db::name('Order')->where($where)->sum('total_price'); - // 当月 - $where = [ - ['status', 'in', [2,3,4]], - ['add_time', '>=', self::$this_month_time_start], - ['add_time', '<=', self::$this_month_time_end], - ]; - $same_month_count = Db::name('Order')->where($where)->sum('total_price'); + // 当月 + $where = [ + ['status', 'in', [2,3,4]], + ['add_time', '>=', self::$this_month_time_start], + ['add_time', '<=', self::$this_month_time_end], + ]; + $same_month_count = Db::name('Order')->where($where)->sum('total_price'); - // 昨天 - $where = [ - ['status', 'in', [2,3,4]], - ['add_time', '>=', self::$yesterday_time_start], - ['add_time', '<=', self::$yesterday_time_end], - ]; - $yesterday_count = Db::name('Order')->where($where)->sum('total_price'); + // 昨天 + $where = [ + ['status', 'in', [2,3,4]], + ['add_time', '>=', self::$yesterday_time_start], + ['add_time', '<=', self::$yesterday_time_end], + ]; + $yesterday_count = Db::name('Order')->where($where)->sum('total_price'); - // 今天 - $where = [ - ['status', 'in', [2,3,4]], - ['add_time', '>=', self::$today_time_start], - ['add_time', '<=', self::$today_time_end], - ]; - $today_count = Db::name('Order')->where($where)->sum('total_price'); + // 今天 + $where = [ + ['status', 'in', [2,3,4]], + ['add_time', '>=', self::$today_time_start], + ['add_time', '<=', self::$today_time_end], + ]; + $today_count = Db::name('Order')->where($where)->sum('total_price'); + } else { + $last_month_count = 0.00; + $same_month_count = 0.00; + $yesterday_count = 0.00; + $today_count = 0.00; + } // 数据组装 $result = [ @@ -466,14 +475,20 @@ class StatisticalService // 订单成交总量 $order_sale_count = Db::name('Order')->where(array_merge($where, [['status', '=', 4]]))->count(); - // 订单收入总计 - $order_complete_total = PriceNumberFormat(Db::name('Order')->where(array_merge($where, [['status', 'in', [2,3,4]]]))->sum('total_price')); + // 订单收入总计、是否有收入统计权限 + if(AdminIsPower('index', 'income')) + { + $order_complete_total = Db::name('Order')->where(array_merge($where, [['status', 'in', [2,3,4]]]))->sum('total_price'); + } else { + $order_complete_total = 0.00; + } + $result = [ 'user_count' => $user_count, 'order_count' => $order_count, 'order_sale_count' => $order_sale_count, - 'order_complete_total' => $order_complete_total, + 'order_complete_total' => PriceNumberFormat($order_complete_total), ]; return DataReturn('处理成功', 0, $result); } @@ -719,9 +734,15 @@ class StatisticalService // 获取订单id $where = [ ['status', '<=', 4], - ['add_time', '>=', $params['start']], - ['add_time', '<=', $params['end']], ]; + if(!empty($params['start'])) + { + $where[] = ['add_time', '>=', $params['start']]; + } + if(!empty($params['end'])) + { + $where[] = ['add_time', '<=', $params['end']]; + } $order_ids = Db::name('Order')->where($where)->column('id'); // 获取订单详情热销商品 @@ -772,17 +793,20 @@ class StatisticalService 'key_name' => 'type', 'error_msg' => '类型为空', ], - [ + ]; + if(isset($params['type']) && in_array($params['type'], ['order-profit', 'order-trading', 'pay-type'])) + { + $p[] = [ 'checked_type' => 'empty', 'key_name' => 'start', - 'error_msg' => '开始时间为空', - ], - [ + 'error_msg' => '开始时间不能为空', + ]; + $p[] = [ 'checked_type' => 'empty', 'key_name' => 'end', - 'error_msg' => '结束时间为空', - ], - ]; + 'error_msg' => '结束时间不能为空', + ]; + } $ret = ParamsChecked($params, $p); if($ret !== true) { diff --git a/public/static/admin/default/css/index.init.css b/public/static/admin/default/css/index.init.css index 23406e46d..24ae4ec26 100755 --- a/public/static/admin/default/css/index.init.css +++ b/public/static/admin/default/css/index.init.css @@ -181,17 +181,12 @@ html, body { color: rgba(255, 255, 255, 0.12); } @media only screen and (max-width: 641px) { - .shopxo-base li:nth-child(1){ - padding: 10px 5px 5px 0; + .shopxo-base li { + padding: 10px 5px; } - .shopxo-base li:nth-child(2){ - padding: 10px 0 5px 5px; - } - .shopxo-base li:nth-child(3){ - padding: 5px 5px 0 0; - } - .shopxo-base li:nth-child(4){ - padding: 5px 0 0 5px; + .shopxo-base ul.am-avg-lg-4 li:nth-child(3), + .shopxo-base ul.am-avg-lg-4 li:nth-child(4) { + padding-top: 0; } } diff --git a/public/static/admin/default/js/index.init.js b/public/static/admin/default/js/index.init.js index 1a78d6dab..79d4a4ae9 100644 --- a/public/static/admin/default/js/index.init.js +++ b/public/static/admin/default/js/index.init.js @@ -529,9 +529,10 @@ $(function() $('.quick-time a').on('click', function() { // 参数判断 - var start = $(this).data('start') || null; - var end = $(this).data('end') || null; - if(start == null || end == null) + var start = $(this).data('start') || ''; + var end = $(this).data('end') || ''; + var is_empty_time = parseInt($(this).parents('.right-operate').data('empty-time')) || 0; + if(is_empty_time == 0 && (start == '' || end == '')) { Prompt('快捷时间配置有误'); return false; -- Gitee From c17cdd6625cf9d745a7623346b36e34d75ff3c55 Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 31 Aug 2021 18:20:30 +0800 Subject: [PATCH 56/57] =?UTF-8?q?=20=E5=90=8E=E5=8F=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/default/index/init.html | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/app/admin/view/default/index/init.html b/app/admin/view/default/index/init.html index b0ca957d6..95278e57d 100755 --- a/app/admin/view/default/index/init.html +++ b/app/admin/view/default/index/init.html @@ -346,27 +346,4 @@ {{include file="public/footer" /}} - - - \ No newline at end of file + \ No newline at end of file -- Gitee From 4795de5c4442f238294e89881a75873dfa25c57e Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 31 Aug 2021 18:22:13 +0800 Subject: [PATCH 57/57] =?UTF-8?q?=20=E5=90=8E=E5=8F=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/admin/controller/Index.php b/app/admin/controller/Index.php index 1b3143c9f..f09637998 100755 --- a/app/admin/controller/Index.php +++ b/app/admin/controller/Index.php @@ -122,7 +122,7 @@ class Index extends Common MyViewAssign('order_complete_number', $order_complete_number['data']); // 订单收入总计 - if($is_income == 1) + if($is_income) { $order_complete_money = StatisticalService::OrderCompleteMoneyYesterdayTodayTotal(); MyViewAssign('order_complete_money', $order_complete_money['data']); @@ -223,6 +223,7 @@ class Index extends Common // 权限校验 $this->IsPower(); + // 开始处理 $params = $this->data_request; return StatisticalService::StatsData($params); } -- Gitee