修复粘贴数据当前站点图片不重复采集

This commit is contained in:
Devil 2021-03-25 13:44:23 +08:00
parent a444028be3
commit f26d24cf11
11 changed files with 283 additions and 65 deletions

View File

@ -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$/';

View File

@ -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']];
}
}
}

View File

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

View File

@ -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");
/**

View File

@ -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',
),
);
?>

View File

@ -19,7 +19,7 @@ return [
// 应用地址
'app_host' => '',
// 应用调试模式
'app_debug' => false,
'app_debug' => true,
// 应用Trace
'app_trace' => false,
// 是否支持多模块

View File

@ -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';
}
/**
* 支付回调处理

View File

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

View File

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

View File

@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="../internal.js"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={{common_baidu_map_ak}}"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=XSdiGjfg3wOHiKjpYEMG6CYA"></script>
<style type="text/css">
.content{width:530px; height: 350px;margin: 10px auto;}
.content table{width: 100%}

View File

@ -14,7 +14,7 @@
overflow: hidden;
}
</style>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak={{common_baidu_map_ak}}"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=XSdiGjfg3wOHiKjpYEMG6CYA"></script>
</head>
<body onload="initMap();">