From f26d24cf114107a835ba86c2a5519d4b316ed45a Mon Sep 17 00:00:00 2001 From: Devil Date: Thu, 25 Mar 2021 13:44:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=B2=98=E8=B4=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BD=93=E5=89=8D=E7=AB=99=E7=82=B9=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=B8=8D=E9=87=8D=E5=A4=8D=E9=87=87=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common.php | 4 + application/service/BrandService.php | 18 +- application/service/SafetyService.php | 6 +- application/service/UeditorService.php | 4 +- application/tags.php | 164 ++++++++++++++++++ config/app.php | 2 +- extend/payment/Alipay.php | 93 +++++----- extend/payment/AlipayMini.php | 38 ++-- extend/payment/Weixin.php | 15 ++ .../common/lib/ueditor/dialogs/map/map.html | 2 +- .../common/lib/ueditor/dialogs/map/show.html | 2 +- 11 files changed, 283 insertions(+), 65 deletions(-) diff --git a/application/common.php b/application/common.php index 42a8e1b9b..89b5f58f1 100755 --- a/application/common.php +++ b/application/common.php @@ -88,6 +88,10 @@ function GetUrlHost($url) // 查看是几级域名 $data = explode('.', $host); $n = count($data); + if(count($data) == 1) + { + return $host; + } // 判断是否是双后缀 $preg = '/[\w].+\.(com|net|org|gov|ac|bj|sh|tj|cq|he|sn|sx|nm|ln|jl|hl|js|zj|ah|fj|jx|sd|ha|hb|hn|gd|gx|hi|sc|gz|yn|gs|qh|nx|xj|tw|hk|mo|xz|edu|ge|dev)\.cn$/'; diff --git a/application/service/BrandService.php b/application/service/BrandService.php index 6a5aa3cb5..b2aba6e30 100755 --- a/application/service/BrandService.php +++ b/application/service/BrandService.php @@ -72,15 +72,21 @@ class BrandService { $ids = array_unique(array_column($category, 'brand_category_id')); $names = Db::name('BrandCategory')->where(['id'=>$ids])->column('name', 'id'); - foreach($category as $c) + if(!empty($names)) { - if(!array_key_exists($c['brand_id'], $category_group)) + foreach($category as $c) { - $category_group[$c['brand_id']]['ids'] = []; - $category_group[$c['brand_id']]['names'] = []; + if(array_key_exists($c['brand_category_id'], $names)) + { + if(!array_key_exists($c['brand_id'], $category_group)) + { + $category_group[$c['brand_id']]['ids'] = []; + $category_group[$c['brand_id']]['names'] = []; + } + $category_group[$c['brand_id']]['ids'][] = $c['brand_category_id']; + $category_group[$c['brand_id']]['names'][] = $names[$c['brand_category_id']]; + } } - $category_group[$c['brand_id']]['ids'][] = $c['brand_category_id']; - $category_group[$c['brand_id']]['names'][] = $names[$c['brand_category_id']]; } } } diff --git a/application/service/SafetyService.php b/application/service/SafetyService.php index ef50fcb1a..d022b43c7 100755 --- a/application/service/SafetyService.php +++ b/application/service/SafetyService.php @@ -243,9 +243,9 @@ class SafetyService // 发送验证码 $verify_params = array( - 'key_prefix' => md5('safety_'.$accounts), - 'expire_time' => MyC('common_verify_expire_time'), - 'interval_time' => MyC('common_verify_interval_time'), + 'key_prefix' => md5('safety_'.$accounts), + 'expire_time' => MyC('common_verify_expire_time'), + 'interval_time' => MyC('common_verify_interval_time'), ); $code = GetNumberCode(4); if($params['type'] == 'sms') diff --git a/application/service/UeditorService.php b/application/service/UeditorService.php index addf04b05..e5d8095bd 100644 --- a/application/service/UeditorService.php +++ b/application/service/UeditorService.php @@ -275,14 +275,14 @@ class UeditorService $field_name = self::$current_config['catcherFieldName']; // 当前站点域名或者附件域名不下载 - $cdn_attachment_host = MyFileConfig('common_cdn_attachment_host', '', __MY_PUBLIC_URL__, true); + $attachment_host = GetUrlHost(config('shopxo.attachment_host')); // 抓取远程图片 $list = array(); $source = isset(self::$params[$field_name]) ? self::$params[$field_name] : self::$params[$field_name]; foreach($source as $imgUrl) { - if(GetUrlHost($imgUrl) != $cdn_attachment_host) + if(GetUrlHost($imgUrl) != $attachment_host) { $up = new \base\Uploader($imgUrl, $temp_config, "remote"); /** diff --git a/application/tags.php b/application/tags.php index 975bac18d..9550b3761 100755 --- a/application/tags.php +++ b/application/tags.php @@ -32,5 +32,169 @@ return array ( 'log_write' => array ( ), + 'plugins_css' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_navigation_header_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_goods_handle_end' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_goods_spec_base' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_buy_group_goods_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_user_login_success_record' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_goods_spec_extends_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_view_admin_user_save' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_user_save_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_goods_save_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_view_goods_detail_panel_price_top' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_view_home_goods_inside_bottom' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_view_search_goods_inside_bottom' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_goods_spec_type' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_users_center_left_menu_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_header_navigation_top_right_handle' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + 1 => 'app\\plugins\\store\\Hook', + ), + 'plugins_module_form_admin_user_index' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_module_form_admin_user_detail' => + array ( + 0 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_admin_css' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_js' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_warehouse_goods_inventory_deduct' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_warehouse_goods_inventory_rollback' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_warehouse_goods_inventory_sync' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_goods_field_status_update' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_goods_delete' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_goods_save_end' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_editor_path_type_admin_goods_saveinfo' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_goods_detail_right_content_bottom' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_goods_detail_base_bottom' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_goods_detail_base_buy_nav_min_inside_begin' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_warehouse_handle_end' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_buy_order_insert_begin' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_buy_order_insert_end' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_system_begin' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_buy_form_inside' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_buy_base_confirm_top' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_view_admin_order_list_operate' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_order_status_change_history_success_handle' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_order_aftersale_audit_handle_end' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), + 'plugins_service_goods_buy_nav_button_handle' => + array ( + 0 => 'app\\plugins\\store\\Hook', + ), ); ?> \ No newline at end of file diff --git a/config/app.php b/config/app.php index 726db50bb..6d3a2b114 100755 --- a/config/app.php +++ b/config/app.php @@ -19,7 +19,7 @@ return [ // 应用地址 'app_host' => '', // 应用调试模式 - 'app_debug' => false, + 'app_debug' => true, // 应用Trace 'app_trace' => false, // 是否支持多模块 diff --git a/extend/payment/Alipay.php b/extend/payment/Alipay.php index 4d7cb6d03..17ba7b27e 100755 --- a/extend/payment/Alipay.php +++ b/extend/payment/Alipay.php @@ -169,21 +169,22 @@ class Alipay { // 支付参数 $parameter = array( - 'app_id' => $this->config['appid'], - 'method' => 'alipay.trade.app.pay', - 'format' => 'JSON', - 'charset' => 'utf-8', - 'sign_type' => 'RSA2', - 'timestamp' => date('Y-m-d H:i:s'), - 'version' => '1.0', - 'return_url' => $params['call_back_url'], - 'notify_url' => $params['notify_url'], + 'app_id' => $this->config['appid'], + 'method' => 'alipay.trade.app.pay', + 'format' => 'JSON', + 'charset' => 'utf-8', + 'sign_type' => 'RSA2', + 'timestamp' => date('Y-m-d H:i:s'), + 'version' => '1.0', + 'return_url' => $params['call_back_url'], + 'notify_url' => $params['notify_url'], ); $biz_content = array( - 'product_code' => 'QUICK_MSECURITY_PAY', - 'subject' => $params['name'], - 'out_trade_no' => $params['order_no'], - 'total_amount' => $params['total_price'], + 'product_code' => 'QUICK_MSECURITY_PAY', + 'subject' => $params['name'], + 'out_trade_no' => $params['order_no'], + 'total_amount' => $params['total_price'], + 'timeout_express' => $this->OrderAutoCloseTime(), ); $parameter['biz_content'] = json_encode($biz_content, JSON_UNESCAPED_UNICODE); @@ -222,21 +223,22 @@ class Alipay { // 支付参数 $parameter = array( - 'app_id' => $this->config['appid'], - 'method' => 'alipay.trade.wap.pay', - 'format' => 'JSON', - 'charset' => 'utf-8', - 'sign_type' => 'RSA2', - 'timestamp' => date('Y-m-d H:i:s'), - 'version' => '1.0', - 'return_url' => $params['call_back_url'], - 'notify_url' => $params['notify_url'], + 'app_id' => $this->config['appid'], + 'method' => 'alipay.trade.wap.pay', + 'format' => 'JSON', + 'charset' => 'utf-8', + 'sign_type' => 'RSA2', + 'timestamp' => date('Y-m-d H:i:s'), + 'version' => '1.0', + 'return_url' => $params['call_back_url'], + 'notify_url' => $params['notify_url'], ); $biz_content = array( - 'product_code' => 'QUICK_WAP_WAY', - 'subject' => $params['name'], - 'out_trade_no' => $params['order_no'], - 'total_amount' => $params['total_price'], + 'product_code' => 'QUICK_WAP_WAY', + 'subject' => $params['name'], + 'out_trade_no' => $params['order_no'], + 'total_amount' => $params['total_price'], + 'timeout_express' => $this->OrderAutoCloseTime(), ); $parameter['biz_content'] = json_encode($biz_content, JSON_UNESCAPED_UNICODE); @@ -260,21 +262,22 @@ class Alipay { // 支付参数 $parameter = array( - 'app_id' => $this->config['appid'], - 'method' => 'alipay.trade.page.pay', - 'format' => 'JSON', - 'charset' => 'utf-8', - 'sign_type' => 'RSA2', - 'timestamp' => date('Y-m-d H:i:s'), - 'version' => '1.0', - 'return_url' => $params['call_back_url'], - 'notify_url' => $params['notify_url'], + 'app_id' => $this->config['appid'], + 'method' => 'alipay.trade.page.pay', + 'format' => 'JSON', + 'charset' => 'utf-8', + 'sign_type' => 'RSA2', + 'timestamp' => date('Y-m-d H:i:s'), + 'version' => '1.0', + 'return_url' => $params['call_back_url'], + 'notify_url' => $params['notify_url'], ); $biz_content = array( - 'product_code' => 'FAST_INSTANT_TRADE_PAY', - 'subject' => $params['name'], - 'out_trade_no' => $params['order_no'], - 'total_amount' => $params['total_price'], + 'product_code' => 'FAST_INSTANT_TRADE_PAY', + 'subject' => $params['name'], + 'out_trade_no' => $params['order_no'], + 'total_amount' => $params['total_price'], + 'timeout_express' => $this->OrderAutoCloseTime(), ); $parameter['biz_content'] = json_encode($biz_content, JSON_UNESCAPED_UNICODE); @@ -285,6 +288,18 @@ class Alipay exit($this->BuildRequestForm($parameter)); } + /** + * 订单自动关闭的时间 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-03-24 + * @desc description + */ + public function OrderAutoCloseTime() + { + return intval(MyC('common_order_close_limit_time', 30, true)).'m'; + } /** * 支付回调处理 diff --git a/extend/payment/AlipayMini.php b/extend/payment/AlipayMini.php index 34786baa7..f37ed126a 100755 --- a/extend/payment/AlipayMini.php +++ b/extend/payment/AlipayMini.php @@ -130,20 +130,21 @@ class AlipayMini // 支付参数 $parameter = array( - 'app_id' => $this->config['appid'], - 'method' => 'alipay.trade.create', - 'format' => 'JSON', - 'charset' => 'utf-8', - 'sign_type' => 'RSA2', - 'timestamp' => date('Y-m-d H:i:s'), - 'version' => '1.0', - 'notify_url' => $params['notify_url'], + 'app_id' => $this->config['appid'], + 'method' => 'alipay.trade.create', + 'format' => 'JSON', + 'charset' => 'utf-8', + 'sign_type' => 'RSA2', + 'timestamp' => date('Y-m-d H:i:s'), + 'version' => '1.0', + 'notify_url' => $params['notify_url'], ); $biz_content = array( - 'subject' => $params['name'], - 'out_trade_no' => $params['order_no'], - 'total_amount' => $params['total_price'], - 'buyer_id' => $params['user']['alipay_openid'], + 'subject' => $params['name'], + 'out_trade_no' => $params['order_no'], + 'total_amount' => $params['total_price'], + 'buyer_id' => $params['user']['alipay_openid'], + 'timeout_express' => $this->OrderAutoCloseTime(), ); $parameter['biz_content'] = json_encode($biz_content, JSON_UNESCAPED_UNICODE); @@ -172,6 +173,19 @@ class AlipayMini return DataReturn($result[$key]['sub_msg'].'['.$result[$key]['sub_code'].']', -1000); } + /** + * 订单自动关闭的时间 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-03-24 + * @desc description + */ + public function OrderAutoCloseTime() + { + return intval(MyC('common_order_close_limit_time', 30, true)).'m'; + } + /** * 支付回调处理 * @author Devil diff --git a/extend/payment/Weixin.php b/extend/payment/Weixin.php index d1c86e25d..f32424304 100755 --- a/extend/payment/Weixin.php +++ b/extend/payment/Weixin.php @@ -389,11 +389,26 @@ class Weixin 'trade_type' => $trade_type, 'attach' => empty($params['attach']) ? $params['site_name'].'-'.$params['name'] : $params['attach'], 'sign_type' => 'MD5', + 'time_expire' => $this->OrderAutoCloseTime(), ]; $data['sign'] = $this->GetSign($data); return DataReturn('success', 0, $data); } + /** + * 订单自动关闭的时间 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-03-24 + * @desc description + */ + public function OrderAutoCloseTime() + { + $time = intval(MyC('common_order_close_limit_time', 30, true))*60; + return date('YmdHis', time()+$time); + } + /** * 获取异步通知地址 * @author Devil 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 @@ - + - +