diff --git a/app/admin/controller/Common.php b/app/admin/controller/Common.php
index c11e73821..7230a19e3 100755
--- a/app/admin/controller/Common.php
+++ b/app/admin/controller/Common.php
@@ -35,6 +35,8 @@ class Common extends BaseController
// 左边权限菜单
protected $left_menu;
+ // 当前管理员可使用的插件
+ protected $admin_plugins;
// 输入参数 post|get|request
protected $data_post;
@@ -111,9 +113,10 @@ public function __construct()
// 管理员信息
$this->admin = AdminService::LoginInfo();
- // 权限菜单
+ // 权限菜单、当前管理员可使用的插件
$menu = AdminPowerService::PowerMenuInit($this->admin);
$this->left_menu = $menu['admin_left_menu'];
+ $this->admin_plugins = $menu['admin_plugins'];
// 视图初始化
$this->ViewInit();
@@ -265,6 +268,8 @@ public function ViewInit()
// 权限菜单
$assign['left_menu'] = $this->left_menu;
+ // 当前管理员可使用的插件
+ $assign['admin_plugins'] = $this->admin_plugins;
// 分页信息
$this->page = max(1, isset($this->data_request['page']) ? intval($this->data_request['page']) : 1);
diff --git a/app/admin/form/Appcenternav.php b/app/admin/form/Appcenternav.php
index 9ce68ed97..b067a3155 100644
--- a/app/admin/form/Appcenternav.php
+++ b/app/admin/form/Appcenternav.php
@@ -60,6 +60,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'name',
'is_sort' => 1,
+ 'width' => 150,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
@@ -72,6 +73,7 @@ public function Run($params = [])
'view_data_key' => 'name',
'view_data' => MyConst('common_platform_type'),
'is_sort' => 1,
+ 'width' => 165,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -117,16 +119,6 @@ public function Run($params = [])
'where_type' => 'like',
],
],
- [
- 'label' => $lang['desc'],
- 'view_type' => 'field',
- 'view_key' => 'desc',
- 'is_sort' => 1,
- 'search_config' => [
- 'form_type' => 'input',
- 'where_type' => 'like',
- ],
- ],
[
'label' => $lang['is_enable'],
'view_type' => 'status',
@@ -135,6 +127,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -151,6 +144,7 @@ public function Run($params = [])
'post_url' => MyUrl('admin/appcenternav/statusupdate'),
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -160,6 +154,16 @@ public function Run($params = [])
'is_multiple' => 1,
],
],
+ [
+ 'label' => $lang['desc'],
+ 'view_type' => 'field',
+ 'view_key' => 'desc',
+ 'is_sort' => 1,
+ 'search_config' => [
+ 'form_type' => 'input',
+ 'where_type' => 'like',
+ ],
+ ],
[
'label' => $lang['sort'],
'view_type' => 'field',
diff --git a/app/admin/form/Apphomenav.php b/app/admin/form/Apphomenav.php
index 0d25751d9..3ff866755 100644
--- a/app/admin/form/Apphomenav.php
+++ b/app/admin/form/Apphomenav.php
@@ -60,6 +60,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'name',
'is_sort' => 1,
+ 'width' => 150,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
@@ -72,6 +73,7 @@ public function Run($params = [])
'view_data_key' => 'name',
'view_data' => MyConst('common_platform_type'),
'is_sort' => 1,
+ 'width' => 165,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -86,6 +88,7 @@ public function Run($params = [])
'view_type' => 'module',
'view_key' => 'apphomenav/module/images',
'align' => 'center',
+ 'width' => 70,
],
[
'label' => $lang['event_type'],
@@ -123,6 +126,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -139,6 +143,7 @@ public function Run($params = [])
'post_url' => MyUrl('admin/apphomenav/statusupdate'),
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
diff --git a/app/admin/form/Article.php b/app/admin/form/Article.php
index 46eaec44e..98b2c7675 100644
--- a/app/admin/form/Article.php
+++ b/app/admin/form/Article.php
@@ -84,6 +84,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'article_category_name',
'is_sort' => 1,
+ 'width' => 140,
'search_config' => [
'form_type' => 'select',
'form_name' => 'article_category_id',
@@ -102,6 +103,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -118,6 +120,7 @@ public function Run($params = [])
'post_url' => MyUrl('admin/article/statusupdate'),
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -132,6 +135,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'images_count',
'is_sort' => 1,
+ 'width' => 160,
'search_config' => [
'form_type' => 'section',
],
@@ -141,6 +145,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'access_count',
'is_sort' => 1,
+ 'width' => 160,
'search_config' => [
'form_type' => 'section',
],
diff --git a/app/admin/form/Brand.php b/app/admin/form/Brand.php
index 9140f28f0..26a62403c 100644
--- a/app/admin/form/Brand.php
+++ b/app/admin/form/Brand.php
@@ -65,6 +65,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'name',
'is_sort' => 1,
+ 'width' => 150,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
@@ -86,12 +87,13 @@ public function Run($params = [])
'view_type' => 'images',
'view_key' => 'logo',
'images_height' => 25,
+ 'width' => 100,
],
[
'label' => $lang['url'],
'view_type' => 'module',
'view_key' => 'brand/module/url',
- 'grid_size' => 'lg',
+ 'grid_size' => 'sm',
'search_config' => [
'form_type' => 'input',
'form_name' => 'website_url',
@@ -102,6 +104,7 @@ public function Run($params = [])
'label' => $lang['brand_category_text'],
'view_type' => 'field',
'view_key' => 'brand_category_text',
+ 'width' => 140,
'search_config' => [
'form_type' => 'select',
'form_name' => 'id',
@@ -121,6 +124,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -135,6 +139,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'sort',
'is_sort' => 1,
+ 'width' => 160,
'search_config' => [
'form_type' => 'section',
],
diff --git a/app/admin/form/Customview.php b/app/admin/form/Customview.php
index 08ec7f0c7..055d5d392 100644
--- a/app/admin/form/Customview.php
+++ b/app/admin/form/Customview.php
@@ -59,7 +59,7 @@ public function Run($params = [])
'label' => $lang['info'],
'view_type' => 'module',
'view_key' => 'customview/module/info',
- 'grid_size' => 'lg',
+ 'grid_size' => 'sm',
'is_sort' => 1,
'search_config' => [
'form_type' => 'input',
@@ -75,6 +75,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -91,6 +92,7 @@ public function Run($params = [])
'post_url' => MyUrl('admin/customview/statusupdate'),
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -107,6 +109,7 @@ public function Run($params = [])
'post_url' => MyUrl('admin/customview/statusupdate'),
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -123,6 +126,7 @@ public function Run($params = [])
'post_url' => MyUrl('admin/customview/statusupdate'),
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -137,6 +141,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'access_count',
'is_sort' => 1,
+ 'width' => 160,
'search_config' => [
'form_type' => 'section',
],
diff --git a/app/admin/form/Design.php b/app/admin/form/Design.php
index 0d252b3c8..9ca663fe9 100644
--- a/app/admin/form/Design.php
+++ b/app/admin/form/Design.php
@@ -83,6 +83,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'access_count',
'is_sort' => 1,
+ 'width' => 160,
'search_config' => [
'form_type' => 'section',
],
@@ -95,6 +96,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -111,6 +113,7 @@ public function Run($params = [])
'post_url' => MyUrl('admin/design/statusupdate'),
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -127,6 +130,7 @@ public function Run($params = [])
'post_url' => MyUrl('admin/design/statusupdate'),
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
diff --git a/app/admin/form/Goodsparamstemplate.php b/app/admin/form/Goodsparamstemplate.php
index 3bdb5b922..5bead3f0c 100644
--- a/app/admin/form/Goodsparamstemplate.php
+++ b/app/admin/form/Goodsparamstemplate.php
@@ -80,6 +80,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'category_id',
'view_data' => $this->goods_category_list,
+ 'width' => 150,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -92,6 +93,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'name',
'is_sort' => 1,
+ 'width' => 150,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
@@ -105,6 +107,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -119,6 +122,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'config_count',
'is_sort' => 1,
+ 'width' => 160,
'search_config' => [
'form_type' => 'section',
],
diff --git a/app/admin/form/Goodsspectemplate.php b/app/admin/form/Goodsspectemplate.php
index a7b205889..99864bc05 100644
--- a/app/admin/form/Goodsspectemplate.php
+++ b/app/admin/form/Goodsspectemplate.php
@@ -79,6 +79,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'category_id',
'view_data' => $this->goods_category_list,
+ 'width' => 150,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -91,6 +92,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'name',
'is_sort' => 1,
+ 'width' => 150,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
@@ -104,6 +106,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
diff --git a/app/admin/form/Link.php b/app/admin/form/Link.php
index a0dfdff58..aaf3c8e05 100644
--- a/app/admin/form/Link.php
+++ b/app/admin/form/Link.php
@@ -96,6 +96,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -112,6 +113,7 @@ public function Run($params = [])
'post_url' => MyUrl('admin/link/statusupdate'),
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -126,6 +128,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'sort',
'is_sort' => 1,
+ 'width' => 160,
'search_config' => [
'form_type' => 'section',
],
diff --git a/app/admin/form/Order.php b/app/admin/form/Order.php
index a8cb35e80..257eaa72f 100644
--- a/app/admin/form/Order.php
+++ b/app/admin/form/Order.php
@@ -41,6 +41,7 @@ class Order
public function Run($params = [])
{
$lang = MyLang('order.form_table');
+ $lang_stats = MyLang('order.form_table_stats');
return [
// 基础配置
'base' => [
@@ -433,11 +434,11 @@ public function Run($params = [])
],
'is_page_stats' => 1,
'page_stats_data' => [
- ['name'=>'订单总额', 'field'=>'total_price'],
- ['name'=>'支付总额', 'field'=>'pay_price'],
- ['name'=>'商品总数', 'field'=>'buy_number_count'],
- ['name'=>'退款金额', 'field'=>'refund_price'],
- ['name'=>'退货数量', 'field'=>'returned_quantity'],
+ ['name'=>$lang_stats['total_price'], 'field'=>'total_price'],
+ ['name'=>$lang_stats['pay_price'], 'field'=>'pay_price'],
+ ['name'=>$lang_stats['buy_number_count'], 'field'=>'buy_number_count'],
+ ['name'=>$lang_stats['refund_price'], 'field'=>'refund_price'],
+ ['name'=>$lang_stats['returned_quantity'], 'field'=>'returned_quantity'],
],
'data_params' => [
'is_public' => 0,
diff --git a/app/admin/form/Orderaftersale.php b/app/admin/form/Orderaftersale.php
index 78b383ac3..e491fdec5 100644
--- a/app/admin/form/Orderaftersale.php
+++ b/app/admin/form/Orderaftersale.php
@@ -37,6 +37,7 @@ class OrderAftersale
public function Run($params = [])
{
$lang = MyLang('orderaftersale.form_table');
+ $lang_stats = MyLang('orderaftersale.form_table_stats');
return [
// 基础配置
'base' => [
@@ -279,6 +280,11 @@ public function Run($params = [])
'is_public' => 0,
'user_type' => 'admin',
],
+ 'is_page_stats' => 1,
+ 'page_stats_data' => [
+ ['name'=>$lang_stats['price'], 'field'=>'price'],
+ ['name'=>$lang_stats['number'], 'field'=>'number'],
+ ],
],
];
}
diff --git a/app/admin/form/Quicknav.php b/app/admin/form/Quicknav.php
index 68cfe29b6..36d8fd0a9 100644
--- a/app/admin/form/Quicknav.php
+++ b/app/admin/form/Quicknav.php
@@ -59,6 +59,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'name',
'is_sort' => 1,
+ 'width' => 150,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
@@ -71,6 +72,7 @@ public function Run($params = [])
'view_data_key' => 'name',
'view_data' => MyConst('common_platform_type'),
'is_sort' => 1,
+ 'width' => 165,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -85,6 +87,7 @@ public function Run($params = [])
'view_type' => 'module',
'view_key' => 'quicknav/module/images',
'align' => 'center',
+ 'width' => 70,
],
[
'label' => $lang['event_type'],
@@ -122,6 +125,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -136,6 +140,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'sort',
'is_sort' => 1,
+ 'width' => 160,
'search_config' => [
'form_type' => 'section',
],
diff --git a/app/admin/form/Role.php b/app/admin/form/Role.php
index 278846099..019c34ac3 100644
--- a/app/admin/form/Role.php
+++ b/app/admin/form/Role.php
@@ -61,6 +61,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'name',
'is_sort' => 1,
+ 'width' => 150,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
@@ -74,6 +75,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
diff --git a/app/admin/form/Slide.php b/app/admin/form/Slide.php
index 9865ff069..078cf3fa1 100644
--- a/app/admin/form/Slide.php
+++ b/app/admin/form/Slide.php
@@ -59,6 +59,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'name',
'is_sort' => 1,
+ 'width' => 150,
'search_config' => [
'form_type' => 'input',
'where_type' => 'like',
@@ -83,6 +84,7 @@ public function Run($params = [])
'view_data_key' => 'name',
'view_data' => MyConst('common_platform_type'),
'is_sort' => 1,
+ 'width' => 165,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
@@ -133,6 +135,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
diff --git a/app/admin/form/Warehouse.php b/app/admin/form/Warehouse.php
index 11d67a1aa..a214b1e45 100644
--- a/app/admin/form/Warehouse.php
+++ b/app/admin/form/Warehouse.php
@@ -78,6 +78,7 @@ public function Run($params = [])
'view_type' => 'field',
'view_key' => 'level',
'is_sort' => 1,
+ 'width' => 160,
'search_config' => [
'form_type' => 'section',
],
@@ -90,6 +91,7 @@ public function Run($params = [])
'is_form_su' => 1,
'align' => 'center',
'is_sort' => 1,
+ 'width' => 130,
'search_config' => [
'form_type' => 'select',
'where_type' => 'in',
diff --git a/app/admin/lang/cht.php b/app/admin/lang/cht.php
index b2e00dcaa..ace0fda79 100644
--- a/app/admin/lang/cht.php
+++ b/app/admin/lang/cht.php
@@ -24,7 +24,7 @@
'order_transaction_amount_name' => '訂單成交金額走勢',
'order_trading_trend_name' => '訂單交易走勢',
'goods_hot_name' => '熱賣商品',
- 'goods_hot_tips' => '僅顯示前30條商品',
+ 'goods_hot_tips' => '僅顯示前13條商品',
'payment_name' => '支付方式',
'order_region_name' => '訂單地域分佈',
'order_region_tips' => '僅顯示10條數據',
@@ -807,6 +807,14 @@
'add_time' => '創建時間',
'upd_time' => '更新時間',
],
+ // 动态表格统计字段
+ 'form_table_stats' => [
+ 'total_price' => '訂單總額',
+ 'pay_price' => '支付總額',
+ 'buy_number_count' => '商品總數',
+ 'refund_price' => '退款金額',
+ 'returned_quantity' => '退貨數量',
+ ],
],
// 订单售后
@@ -844,6 +852,11 @@
'add_time' => '創建時間',
'upd_time' => '更新時間',
],
+ // 动态表格统计字段
+ 'form_table_stats' => [
+ 'price' => '退款總額',
+ 'number' => '退貨總數',
+ ],
],
// 支付方式
diff --git a/app/admin/lang/en.php b/app/admin/lang/en.php
index 8305e807f..3d1750776 100644
--- a/app/admin/lang/en.php
+++ b/app/admin/lang/en.php
@@ -24,7 +24,7 @@
'order_transaction_amount_name' => 'Trend of order transaction amount',
'order_trading_trend_name' => 'Order trading trend',
'goods_hot_name' => 'Hot Goods',
- 'goods_hot_tips' => 'Show only the first 30 items',
+ 'goods_hot_tips' => 'Show only the first 13 items',
'payment_name' => 'Payment Method',
'order_region_name' => 'Order geographical distribution',
'order_region_tips' => 'Only 10 pieces of data are displayed',
@@ -822,6 +822,14 @@
'add_time' => 'Creation Time',
'upd_time' => 'Update Time',
],
+ // 动态表格统计字段
+ 'form_table_stats' => [
+ 'total_price' => 'TotalPrice',
+ 'pay_price' => 'PaymentPrice',
+ 'buy_number_count' => 'GoodsNumber',
+ 'refund_price' => 'RefundAmount',
+ 'returned_quantity' => 'RefundNumber',
+ ],
],
// 订单售后
@@ -859,6 +867,11 @@
'add_time' => 'Creation Time',
'upd_time' => 'Update Time',
],
+ // 动态表格统计字段
+ 'form_table_stats' => [
+ 'price' => 'Total refund amount',
+ 'number' => 'Total number of returns',
+ ],
],
// 支付方式
diff --git a/app/admin/lang/spa.php b/app/admin/lang/spa.php
index 045b4c323..ee5c3eca3 100644
--- a/app/admin/lang/spa.php
+++ b/app/admin/lang/spa.php
@@ -24,7 +24,7 @@
'order_transaction_amount_name' => 'Evolución de la facturación de pedidos',
'order_trading_trend_name' => 'Tendencia de las transacciones de pedidos',
'goods_hot_name' => 'Productos de venta caliente',
- 'goods_hot_tips' => 'Solo se muestran los primeros 30 productos',
+ 'goods_hot_tips' => 'Solo se muestran los primeros 13 productos',
'payment_name' => 'Método de pago',
'order_region_name' => 'Distribución geográfica de los pedidos',
'order_region_tips' => 'Solo se muestran 10 datos',
@@ -807,6 +807,14 @@
'add_time' => 'Tiempo de creación',
'upd_time' => 'Tiempo de actualización',
],
+ // 动态表格统计字段
+ 'form_table_stats' => [
+ 'total_price' => 'Total de pedidos',
+ 'pay_price' => 'Total de pagos',
+ 'buy_number_count' => 'Total de productos básicos',
+ 'refund_price' => 'Importe del reembolso',
+ 'returned_quantity' => 'Número de devoluciones',
+ ],
],
// 订单售后
@@ -844,6 +852,11 @@
'add_time' => 'Tiempo de creación',
'upd_time' => 'Tiempo de actualización',
],
+ // 动态表格统计字段
+ 'form_table_stats' => [
+ 'price' => 'Reembolso total',
+ 'number' => 'Número total de devoluciones',
+ ],
],
// 支付方式
diff --git a/app/admin/lang/zh.php b/app/admin/lang/zh.php
index bed747428..7bbee2550 100755
--- a/app/admin/lang/zh.php
+++ b/app/admin/lang/zh.php
@@ -24,7 +24,7 @@
'order_transaction_amount_name' => '订单成交金额',
'order_trading_trend_name' => '订单交易',
'goods_hot_name' => '热销商品',
- 'goods_hot_tips' => '仅显示前30条商品',
+ 'goods_hot_tips' => '仅显示前13条商品',
'payment_name' => '支付方式',
'order_region_name' => '订单地域分布',
'order_region_tips' => '仅显示10条数据',
@@ -808,6 +808,14 @@
'add_time' => '创建时间',
'upd_time' => '更新时间',
],
+ // 动态表格统计字段
+ 'form_table_stats' => [
+ 'total_price' => '订单总额',
+ 'pay_price' => '支付总额',
+ 'buy_number_count' => '商品总数',
+ 'refund_price' => '退款金额',
+ 'returned_quantity' => '退货数量',
+ ],
],
// 订单售后
@@ -845,6 +853,11 @@
'add_time' => '创建时间',
'upd_time' => '更新时间',
],
+ // 动态表格统计字段
+ 'form_table_stats' => [
+ 'price' => '退款总额',
+ 'number' => '退货总数',
+ ],
],
// 支付方式
diff --git a/app/admin/view/default/index/init.html b/app/admin/view/default/index/init.html
index 446a50592..88af02d9e 100755
--- a/app/admin/view/default/index/init.html
+++ b/app/admin/view/default/index/init.html
@@ -526,7 +526,7 @@
{{:MyLang('index.base_item_map_whole_country_title')}}
-
';
@@ -419,6 +419,8 @@ private function PayHtml($pay_data)
// 回调处理
var oceanpaymentCallBack = function(data) {
if(data.msg){
+ $(".pay-button").attr("data-status", 0);
+ console.log("pay reset");
// 处理卡信息错误
alert(data.msg);
}else{
@@ -430,6 +432,8 @@ private function PayHtml($pay_data)
var obj = {};
var response = xml_doc.getElementsByTagName("response")[0];
if(response == undefined) {
+ $(".pay-button").attr("data-status", 0);
+ console.log("pay reset");
alert("xml error");
return false;
}
@@ -439,6 +443,8 @@ private function PayHtml($pay_data)
}
// 是否需要3d验证
if((obj.pay_url || null) != null) {
+ $(".pay-button").attr("data-status", 0);
+ console.log("pay reset");
window.location.href = obj.pay_url;
return false;
}
@@ -453,6 +459,13 @@ private function PayHtml($pay_data)
// 调用支付
function pay() {
+ var status = parseInt($(".pay-button").attr("data-status") || 0);
+ if(status == 1) {
+ console.log("progress");
+ return false;
+ }
+ console.log("pay...");
+ $(".pay-button").attr("data-status", 1);
// Jquery的serialize()方法
var formData = $("#payForm").serializeArray();
var obj = {}
diff --git a/extend/payment/PayPal.php b/extend/payment/PayPal.php
index 6b269dfe8..8463c119d 100644
--- a/extend/payment/PayPal.php
+++ b/extend/payment/PayPal.php
@@ -125,12 +125,22 @@ public function Config()
'is_required' => 0,
'message' => '请填写会员购买WebhookID、配置异步通知地址后得到的id',
],
+ [
+ 'element' => 'input',
+ 'type' => 'text',
+ 'default' => '',
+ 'name' => 'scanpay_webhook_id',
+ 'placeholder' => '扫码收款WebhookID',
+ 'title' => '扫码收款WebhookID',
+ 'is_required' => 0,
+ 'message' => '请填写扫码收款WebhookID、配置异步通知地址后得到的id',
+ ],
[
'element' => 'input',
'type' => 'text',
'default' => '',
'name' => 'app_agreement',
- 'placeholder' => 'APP协议头、例如:shopxochuyin://',
+ 'placeholder' => 'APP协议头、例如:shopxo://',
'title' => 'APP协议头(APP支付才需要配置)',
'is_required' => 0,
'message' => '请填写APP协议头',
@@ -182,7 +192,7 @@ public function Config()
],
[
'element' => 'message',
- 'message' => '1. 订单异步通知地址,将该地址配置到支付后台异步通知
'.__MY_URL__.'payment_default_order_'.strtolower(str_replace(['payment', '\\'], '', get_class($this))).'_notify.php
2. 钱包充值异步通知地址,将该地址配置到支付后台异步通知
'.__MY_URL__.'payment_default_wallet_'.strtolower(str_replace(['payment', '\\'], '', get_class($this))).'_notify.php
3. 会员等级购买异步通知地址,将该地址配置到支付后台异步通知
'.__MY_URL__.'payment_default_membershiplevelvip_'.strtolower(str_replace(['payment', '\\'], '', get_class($this))).'_notify.php
异步通知类型勾选【Payment capture completed】即可',
+ 'message' => '1. 订单异步通知地址,将该地址配置到支付后台异步通知
'.__MY_URL__.'payment_default_order_'.strtolower(str_replace(['payment', '\\'], '', get_class($this))).'_notify.php
2. 钱包充值异步通知地址,将该地址配置到支付后台异步通知
'.__MY_URL__.'payment_default_wallet_'.strtolower(str_replace(['payment', '\\'], '', get_class($this))).'_notify.php
3. 会员等级购买异步通知地址,将该地址配置到支付后台异步通知
'.__MY_URL__.'payment_default_membershiplevelvip_'.strtolower(str_replace(['payment', '\\'], '', get_class($this))).'_notify.php
4. 扫码收款异步通知地址,将该地址配置到支付后台异步通知
'.__MY_URL__.'payment_default_scanpay_'.strtolower(str_replace(['payment', '\\'], '', get_class($this))).'_notify.php
异步通知类型勾选【Payments & Payouts 下面的 Payment capture completed】即可',
],
];
diff --git a/extend/payment/Toutiao.php b/extend/payment/Toutiao.php
index 748cbf8cc..4116658e5 100644
--- a/extend/payment/Toutiao.php
+++ b/extend/payment/Toutiao.php
@@ -10,6 +10,8 @@
// +----------------------------------------------------------------------
namespace payment;
+use app\service\AppMiniUserService;
+
/**
* 头条
* @author Devil
@@ -70,6 +72,17 @@ public function Config()
'is_required' => 0,
'message' => '请填写小程序AppID',
],
+ [
+ 'element' => 'select',
+ 'title' => '支付类型',
+ 'message' => '请选择支付类型',
+ 'name' => 'pay_type',
+ 'is_multiple' => 0,
+ 'element_data' => [
+ ['value'=>0, 'name'=>'担保交易(普通)'],
+ ['value'=>1, 'name'=>'担保交易(企业-通用交易系统)'],
+ ],
+ ],
[
'element' => 'input',
'type' => 'text',
@@ -91,9 +104,54 @@ public function Config()
'is_required' => 0,
'message' => '请填写Token(令牌)',
],
+ [
+ 'element' => 'textarea',
+ 'name' => 'rsa_public',
+ 'placeholder' => '应用公钥',
+ 'title' => '应用公钥',
+ 'is_required' => 0,
+ 'rows' => 6,
+ 'message' => '请填写应用公钥',
+ ],
+ [
+ 'element' => 'textarea',
+ 'name' => 'rsa_private',
+ 'placeholder' => '应用私钥',
+ 'title' => '应用私钥',
+ 'is_required' => 0,
+ 'rows' => 6,
+ 'message' => '请填写应用私钥',
+ ],
+ [
+ 'element' => 'textarea',
+ 'name' => 'out_rsa_public',
+ 'placeholder' => '支付平台公钥',
+ 'title' => '支付平台公钥',
+ 'is_required' => 0,
+ 'rows' => 6,
+ 'message' => '请填写支付平台公钥',
+ ],
+ [
+ 'element' => 'select',
+ 'title' => '交易规则标签组',
+ 'message' => '请选择交易规则标签组',
+ 'name' => 'tag_group_id',
+ 'is_multiple' => 0,
+ 'element_data' => [
+ ['value'=>'tag_group_7272625659887943692', 'name'=>'通信-号卡商品(未制卡全额退/制卡后协商退)'],
+ ['value'=>'tag_group_7272625659887960076', 'name'=>'通信-定制服务(未制作全额退/定制后协商退)'],
+ ['value'=>'tag_group_7272625659887976460', 'name'=>'通信-定制服务(未制作全额退/定制后不可退)'],
+ ['value'=>'tag_group_7272625659887992844', 'name'=>'通信-虚拟充值(不可退)'],
+ ['value'=>'tag_group_7272625659888009228', 'name'=>'咨询-普通咨询(未服务全额退/开始服务后协商退)'],
+ ['value'=>'tag_group_7272625659888025612', 'name'=>'咨询-普通咨询(未服务全额退/开始服务后不可退)'],
+ ['value'=>'tag_group_7297888175123382299', 'name'=>'咨询-代写文书(未服务全额退/开始服务后协商退)'],
+ ['value'=>'tag_group_7272625659888041996', 'name'=>'咨询-内容消费(不可退)'],
+ ['value'=>'tag_group_7272625659888058380', 'name'=>'工具-虚拟服务(不可退)'],
+ ],
+ ],
[
'element' => 'message',
- 'message' => '异步通知地址,将该地址配置到头条小程序后台->支付->担保交易->担保交易设置中
'.__MY_URL__.'payment_default_order_'.strtolower(str_replace(['payment', '\\'], '', get_class($this))).'_notify.php',
+ 'message' => '异步通知地址,将该地址配置到头条小程序后台->支付->担保交易->担保交易设置中
'.__MY_URL__.'payment_default_order_'.strtolower(str_replace(['payment', '\\'], '', get_class($this))).'_notify.php
PS:支付类型 担保交易(企业-通用交易系统)采用(应用公钥、私钥、平台公钥、交易规则标签组)配置项',
],
];
@@ -121,33 +179,130 @@ public function Pay($params = [])
}
// 配置信息
- if(empty($this->config))
+ if(empty($this->config) || empty($this->config['app_id']))
{
return DataReturn('支付缺少配置', -1);
}
- // 处理支付
- $parameter = [
- 'app_id' => $this->config['app_id'],
- 'out_order_no' => $params['order_no'],
- 'total_amount' => (int) (($params['total_price']*1000)/10),
- 'subject' => $params['name'],
- 'body' => $params['site_name'].'-'.$params['name'],
- 'valid_time' => $this->OrderAutoCloseTime(),
- 'notify_url' => $params['notify_url'],
- ];
+ // 支付类型
+ $pay_type = isset($this->config['pay_type']) ? intval($this->config['pay_type']) : 0;
+ switch($pay_type)
+ {
+ // 担保交易-普通版本
+ case 0 :
+ // 配置信息
+ if(empty($this->config['salt']) || empty($this->config['token']))
+ {
+ return DataReturn('支付缺少配置(salt|token)', -1);
+ }
+
+ // 处理支付
+ $parameter = [
+ 'app_id' => $this->config['app_id'],
+ 'out_order_no' => $params['order_no'],
+ 'total_amount' => (int) (($params['total_price']*1000)/10),
+ 'subject' => $params['name'],
+ 'body' => $params['site_name'].'-'.$params['name'],
+ 'valid_time' => $this->OrderAutoCloseTime(),
+ 'notify_url' => $params['notify_url'],
+ ];
+
+ // 签名
+ $parameter['sign'] = $this->GetParamSign($parameter);
+
+ // 请求接口
+ $url = 'https://developer.toutiao.com/api/apps/ecpay/v1/create_order';
+ $ret = $this->HttpRequest($url, $parameter);
+ if($ret['code'] == 0 && !empty($ret['data']['data']))
+ {
+ $ret['data'] = $ret['data']['data'];
+ }
+ return $ret;
+ break;
+
+ // 担保交易-企业-通用交易系统
+ case 1 :
+ // 配置信息
+ if(empty($this->config['rsa_public']) || empty($this->config['rsa_private']) || empty($this->config['out_rsa_public']) || empty($this->config['tag_group_id']))
+ {
+ return DataReturn('支付缺少配置(应用公钥|私钥|平台公钥|交易规则标签组)', -1);
+ }
+
+ // 请求参数
+ $data = json_encode([
+ 'skuList' => [
+ [
+ 'skuId' => $params['order_no'],
+ 'price' => (int) (($params['total_price']*1000)/10),
+ 'quantity' => 1,
+ 'title' => $params['name'],
+ 'imageList' => [AttachmentPathViewHandle(MyC('home_site_logo_square'))],
+ 'type' => 201,
+ 'tagGroupId' => $this->config['tag_group_id'],
+ ]
+ ],
+ 'outOrderNo' => $params['order_no'],
+ 'totalAmount' => (int) (($params['total_price']*1000)/10),
+ 'payExpireSeconds' => $this->OrderAutoCloseTime(),
+ 'payNotifyUrl' => $params['notify_url'],
+ 'orderEntrySchema' => [
+ 'path' => 'pages/index/index',
+ ],
+ ], JSON_UNESCAPED_UNICODE);
+ // 签名
+ $auth = $this->GetByteAuthorization($data);
+ if($auth['code'] != 0)
+ {
+ return $auth;
+ }
+ return DataReturn('success', 0, ['data'=>$data, 'auth'=>$auth['data'], 'pay_type'=>$pay_type]);
+ break;
+ }
+ }
- // 签名
- $parameter['sign'] = $this->GetParamSign($parameter);
- // 请求接口
- $url = 'https://developer.toutiao.com/api/apps/ecpay/v1/create_order';
- $ret = $this->HttpRequest($url, $parameter);
- if($ret['code'] == 0 && !empty($ret['data']['data']))
+ /**
+ * 签名生成
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 1.0.0
+ * @date 2023-12-27
+ * @desc description
+ * @param [string] $data [支付信息json数据]
+ */
+ public function GetByteAuthorization($data) {
+ // 私钥
+ if(stripos($this->config['rsa_private'], '-----') === false)
{
- $ret['data'] = $ret['data']['data'];
+ $private_key_str = "-----BEGIN RSA PRIVATE KEY-----\n";
+ $private_key_str .= wordwrap($this->config['rsa_private'], 64, "\n", true);
+ $private_key_str .= "\n-----END RSA PRIVATE KEY-----";
+ } else {
+ $private_key_str = $this->config['rsa_private'];
}
- return $ret;
+ // 应用公钥版本,每次重新上传公钥后需要更新,可通过「开发管理-开发设置-密钥设置」处获取
+ $key_version = '1';
+ // 请求时间戳
+ $timestamp = time();
+ // 随机字符串
+ $nonce_str = RandomString(10);
+ // 读取私钥
+ $private_key = openssl_pkey_get_private($private_key_str);
+ if(!$private_key)
+ {
+ return DataReturn('私钥无效', -1);
+ }
+ // 生成签名
+ $target_str = "POST\n/requestOrder\n" . $timestamp. "\n" . $nonce_str. "\n" . $data. "\n";
+ openssl_sign($target_str, $sign, $private_key, OPENSSL_ALGO_SHA256);
+ $signature = base64_encode($sign);
+ if($signature === false)
+ {
+ return DataReturn('签名生成失败', -1);
+ }
+ // 构造 byteAuthorization
+ $auth = sprintf("SHA256-RSA2048 appid=%s,nonce_str=%s,timestamp=%s,key_version=%s,signature=%s", $this->config['app_id'], $nonce_str, $timestamp, $key_version, $signature);
+ return DataReturn('success', 0, $auth);
}
/**
@@ -232,7 +387,7 @@ public function Respond($params = [])
}
// 退款请求不处理、直接返回成功
- if($params['type'] == 'refund')
+ if(isset($params['type']) && $params['type'] == 'refund')
{
die($this->SuccessReturn());
}
@@ -243,52 +398,104 @@ public function Respond($params = [])
{
return DataReturn('msg转换json数据为空', -1);
}
- if(empty($data['cp_orderno']))
- {
- return DataReturn('回调订单号为空', -1);
- }
-
- // 查询订单信息
- $parameter = [
- 'app_id' => $this->config['app_id'],
- 'out_order_no' => $data['cp_orderno'],
- ];
-
- // 签名
- $parameter['sign'] = $this->GetParamSign($parameter);
- // 请求接口
- $url = 'https://developer.toutiao.com/api/apps/ecpay/v1/query_order';
- $ret = $this->HttpRequest($url, $parameter);
- if($ret['code'] == 0 && !empty($ret['data']['payment_info']) && !empty($ret['data']['payment_info']['order_status']))
+ // 支付类型
+ $pay_type = isset($this->config['pay_type']) ? intval($this->config['pay_type']) : 0;
+ switch($pay_type)
{
- switch($ret['data']['payment_info']['order_status'])
- {
- // 处理中
- case 'PROCESSING' :
- $ret = DataReturn('处理中', -10);
- break;
-
- // 超时
- case 'TIMEOUT' :
- $ret = DataReturn('超时', -20);
- break;
-
- // 成功
- case 'SUCCESS' :
- $ret = DataReturn('支付成功', 0, $this->ReturnData($data));
- break;
-
- // 默认
- default :
- $ret = DataReturn('支付失败', -100);
- }
+ // 担保交易-普通版本
+ case 0 :
+ // 基础参数
+ if(empty($data['cp_orderno']))
+ {
+ return DataReturn('回调订单号为空', -1);
+ }
+
+ // 查询订单信息
+ $parameter = [
+ 'app_id' => $this->config['app_id'],
+ 'out_order_no' => $data['cp_orderno'],
+ ];
+
+ // 签名
+ $parameter['sign'] = $this->GetParamSign($parameter);
+
+ // 请求接口
+ $url = 'https://developer.toutiao.com/api/apps/ecpay/v1/query_order';
+ $ret = $this->HttpRequest($url, $parameter);
+ if($ret['code'] == 0 && !empty($ret['data']['payment_info']) && !empty($ret['data']['payment_info']['order_status']))
+ {
+ switch($ret['data']['payment_info']['order_status'])
+ {
+ // 处理中
+ case 'PROCESSING' :
+ $ret = DataReturn('处理中', -10);
+ break;
+
+ // 超时
+ case 'TIMEOUT' :
+ $ret = DataReturn('超时', -20);
+ break;
+
+ // 成功
+ case 'SUCCESS' :
+ $ret = DataReturn('支付成功', 0, $this->ReturnData($data));
+ break;
+
+ // 默认
+ default :
+ $ret = DataReturn('支付失败', -100);
+ }
+ }
+ return $ret;
+ break;
+
+ // 担保交易-企业-通用交易系统
+ case 1 :
+ // 基础参数
+ if(empty($data['out_order_no']) || empty($data['order_id']))
+ {
+ return DataReturn('回调订单号或支付单号为空', -1);
+ }
+
+ // access_token
+ $config = [
+ 'appid' => AppMiniUserService::AppMiniConfig('common_app_mini_toutiao_appid'),
+ 'secret' => AppMiniUserService::AppMiniConfig('common_app_mini_toutiao_appsecret'),
+ ];
+ if(empty($config['appid']) || empty($config['secret']))
+ {
+ return DataReturn('头条小程序密钥未配置', -1);
+ }
+ $access_token = (new \base\Toutiao($config))->GetMiniClientToken();
+ if($access_token === false)
+ {
+ return DataReturn('client_token获取失败', -1);
+ }
+ $header = [
+ 'access-token: '.$access_token,
+ 'content-type: application/json',
+ ];
+
+ // 查询订单信息
+ $url = 'https://open.douyin.com/api/trade_basic/v1/developer/order_query/';
+ $parameter = [
+ 'order_id' => $data['order_id'],
+ 'out_order_no' => $data['out_order_no'],
+ ];
+ $ret = $this->HttpRequest($url, $parameter, 30, $header);
+ if($ret['code'] == 0 && !empty($ret['data']['data']) && isset($ret['data']['data']['pay_status']) && $ret['data']['data']['pay_status'] == 'SUCCESS')
+ {
+ $ret = DataReturn('支付成功', 0, $this->ReturnData($ret['data']['data']));
+ }
+ return $ret;
+ break;
}
- return $ret;
+ return DataReturn('支付类型未处理或支付失败('.$pay_type.')', -1);
}
/**
- * [ReturnData 返回数据统一格式]
+ * 返回数据统一格式
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
@@ -298,11 +505,20 @@ public function Respond($params = [])
private function ReturnData($data)
{
// 返回数据固定基础参数
- $data['trade_no'] = isset($data['payment_order_no']) ? $data['payment_order_no'] : ''; // 支付平台 - 订单号
- $data['buyer_user'] = isset($data['seller_uid']) ? $data['seller_uid'] : ''; // 支付平台 - 用户
- $data['out_trade_no'] = $data['cp_orderno']; // 本系统发起支付的 - 订单号
- $data['subject'] = ''; // 本系统发起支付的 - 商品名称
- $data['pay_price'] = $data['total_amount']/100; // 本系统发起支付的 - 总价
+ // 支付平台 - 订单号
+ $data['trade_no'] = isset($data['payment_order_no']) ? $data['payment_order_no'] : (isset($data['order_id']) ? $data['order_id'] : '');
+
+ // 支付平台 - 用户
+ $data['buyer_user'] = isset($data['seller_uid']) ? $data['seller_uid'] : (isset($data['item_order_list']) ? $data['item_order_list'][0]['item_order_id'] : '');
+
+ // 本系统发起支付的 - 订单号
+ $data['out_trade_no'] = isset($data['cp_orderno']) ? $data['cp_orderno'] : (isset($data['out_order_no']) ? $data['out_order_no'] : '');
+
+ // 本系统发起支付的 - 商品名称
+ $data['subject'] = '';
+
+ // 本系统发起支付的 - 总价
+ $data['pay_price'] = $data['total_amount']/100;
return $data;
}
@@ -355,32 +571,94 @@ public function Refund($params = [])
// 退款原因
$refund_reason = empty($params['refund_reason']) ? $params['order_no'].'订单退款'.$params['refund_price'].'元' : $params['refund_reason'];
- // 处理支付
- $parameter = [
- 'app_id' => $this->config['app_id'],
- 'out_order_no' => $params['order_no'],
- 'out_refund_no' => $params['trade_no'],
- 'refund_amount' => (int) (($params['refund_price']*1000)/10),
- 'reason' => $refund_reason,
- ];
-
- // 签名
- $parameter['sign'] = $this->GetParamSign($parameter);
-
- // 请求接口
- $url = 'https://developer.toutiao.com/api/apps/ecpay/v1/create_refund';
- $ret = $this->HttpRequest($url, $parameter);
- if($ret['code'] == 0)
+ // 支付类型
+ $pay_type = isset($this->config['pay_type']) ? intval($this->config['pay_type']) : 0;
+ switch($pay_type)
{
- // 统一返回格式
- $data = [
- 'trade_no' => isset($ret['data']['refund_no']) ? $ret['data']['refund_no'] : '',
- 'refund_price' => $params['refund_price'],
- 'return_params' => $ret['data'],
- ];
- return DataReturn('退款成功', 0, $data);
+ // 担保交易-普通版本
+ case 0 :
+ // 处理退款
+ $parameter = [
+ 'app_id' => $this->config['app_id'],
+ 'out_order_no' => $params['order_no'],
+ 'out_refund_no' => $params['trade_no'],
+ 'refund_amount' => (int) (($params['refund_price']*1000)/10),
+ 'reason' => $refund_reason,
+ ];
+
+ // 签名
+ $parameter['sign'] = $this->GetParamSign($parameter);
+
+ // 请求接口
+ $url = 'https://developer.toutiao.com/api/apps/ecpay/v1/create_refund';
+ $ret = $this->HttpRequest($url, $parameter);
+ if($ret['code'] == 0)
+ {
+ // 统一返回格式
+ $data = [
+ 'trade_no' => isset($ret['data']['refund_no']) ? $ret['data']['refund_no'] : '',
+ 'refund_price' => $params['refund_price'],
+ 'return_params' => $ret['data'],
+ ];
+ return DataReturn('退款成功', 0, $data);
+ }
+ return $ret;
+ break;
+
+ // 担保交易-企业-通用交易系统
+ case 1 :
+ // access_token
+ $config = [
+ 'appid' => AppMiniUserService::AppMiniConfig('common_app_mini_toutiao_appid'),
+ 'secret' => AppMiniUserService::AppMiniConfig('common_app_mini_toutiao_appsecret'),
+ ];
+ if(empty($config['appid']) || empty($config['secret']))
+ {
+ return DataReturn('头条小程序密钥未配置', -1);
+ }
+ $access_token = (new \base\Toutiao($config))->GetMiniClientToken();
+ if($access_token === false)
+ {
+ return DataReturn('client_token获取失败', -1);
+ }
+ $header = [
+ 'access-token: '.$access_token,
+ 'content-type: application/json',
+ ];
+ // 处理退款
+ $parameter = [
+ 'order_id' => $params['trade_no'],
+ 'out_refund_no' => md5(time().GetNumberCode(6)),
+ 'order_entry_schema' => [
+ 'path' => 'pages/user-orderaftersale/user-orderaftersale'
+ ],
+ 'refund_reason' => [
+ ['code' => 999, 'text' => $refund_reason],
+ ],
+ 'refund_total_amount' => (int) (($params['refund_price']*1000)/10),
+ 'item_order_detail' => [
+ [
+ 'item_order_id' => $params['pay_log_data']['buyer_user'],
+ 'refund_amount' => (int) (($params['refund_price']*1000)/10),
+ ]
+ ],
+ ];
+ // 请求接口
+ $url = 'https://open.douyin.com/api/trade_basic/v1/developer/refund_create/';
+ $ret = $this->HttpRequest($url, $parameter, 30, $header);
+ if($ret['code'] == 0 || stripos($ret['msg'], '[22013]') !== false)
+ {
+ // 统一返回格式
+ $data = [
+ 'trade_no' => (!empty($ret['data']['data']) && isset($ret['data']['data']['refund_id'])) ? $ret['data']['data']['refund_id'] : '',
+ 'refund_price' => $params['refund_price'],
+ 'return_params' => $ret['data'],
+ ];
+ return DataReturn('退款成功', 0, $data);
+ }
+ return $ret;
+ break;
}
- return $ret;
}
/**
@@ -453,12 +731,16 @@ public function Settlement($params = [])
* @param [string] $url [请求url]
* @param [array] $data [发送数据]
* @param [int] $second [超时]
+ * @param [array] $header [头信息]
* @return [mixed] [请求返回数据]
*/
- private function HttpRequest($url, $data, $second = 30)
+ private function HttpRequest($url, $data, $second = 30, $header = [])
{
$ch = curl_init();
- $header = ['Content-Type: application/json;charset=utf-8'];
+ if(empty($header))
+ {
+ $header = ['Content-Type: application/json;charset=utf-8'];
+ }
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_HTTPHEADER => $header,
@@ -482,7 +764,8 @@ private function HttpRequest($url, $data, $second = 30)
}
if($res['err_no'] != 0)
{
- return DataReturn($res['err_tips'].'['.$res['err_no'].']', -1);
+ $msg = empty($res['err_tips']) ? (empty($res['err_msg']) ? '操作失败' : $res['err_msg']) : $res['err_tips'];
+ return DataReturn($msg.'['.$res['err_no'].']', -1);
}
return DataReturn('success', 0, $res);
} else {
diff --git a/extend/payment/WalletPay.php b/extend/payment/WalletPay.php
index 15a868089..0968ac424 100644
--- a/extend/payment/WalletPay.php
+++ b/extend/payment/WalletPay.php
@@ -57,7 +57,7 @@ public function Config()
// 基础信息
$base = [
'name' => '钱包支付', // 插件名称
- 'version' => '0.0.4', // 插件版本
+ 'version' => '0.0.5', // 插件版本
'apply_version' => '不限', // 适用系统版本描述
'desc' => '钱包余额支付', // 插件描述(支持html)
'author' => 'Devil', // 开发者
diff --git a/public/static/admin/default/css/index.init.css b/public/static/admin/default/css/index.init.css
index ec46d1265..e189de925 100755
--- a/public/static/admin/default/css/index.init.css
+++ b/public/static/admin/default/css/index.init.css
@@ -150,7 +150,7 @@ body {
.right-operate .echarts-where input {
display: -webkit-inline-box !important;
- width: 15.5rem !important;
+ width: 14rem !important;
color: #888;
height: 2.4rem;
border-color: #f7f7f7;
diff --git a/public/static/admin/default/css/shortcutmenu.css b/public/static/admin/default/css/shortcutmenu.css
index b57df09b3..fffd1d01b 100644
--- a/public/static/admin/default/css/shortcutmenu.css
+++ b/public/static/admin/default/css/shortcutmenu.css
@@ -24,4 +24,7 @@
.shortcut-menu-form {
background: #F5FBFF;
+}
+.shortcut-menu-form .chosen-container .chosen-results {
+ max-height: 18rem;
}
\ No newline at end of file
diff --git a/public/static/admin/default/js/index.init.js b/public/static/admin/default/js/index.init.js
index 47a41d22c..5815d23e1 100644
--- a/public/static/admin/default/js/index.init.js
+++ b/public/static/admin/default/js/index.init.js
@@ -85,7 +85,7 @@ function SystemUpgradeRequestHandle (params) {
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-sale-count').text(data.order_sale_count);
$('.base-order-complete-total').text(data.order_complete_total);
}
@@ -309,7 +309,7 @@ function EchartsGoodsHot (data) {
var chart = echarts.init(document.getElementById('echarts-goods-hot'), 'macarons');
var option = {
title: {
- subtext: window['lang_goods_hot_tips'] || '仅显示前30条商品',
+ subtext: window['lang_goods_hot_tips'] || '仅显示前13条商品',
x: 'center',
bottom: '3%'
},
diff --git a/public/static/common/css/common.css b/public/static/common/css/common.css
index 5fa97f0bd..ac80f84b7 100755
--- a/public/static/common/css/common.css
+++ b/public/static/common/css/common.css
@@ -1485,8 +1485,8 @@ button.colorpicker-submit img {
.am-table-scrollable-horizontal > .am-table > tfoot > tr > td {
padding: 1.2rem;
line-height: 2rem;
- min-width: 27rem;
- max-width: 35rem;
+ min-width: 17rem;
+ max-width: 17rem;
word-break: break-all;
}
.am-table-scrollable-horizontal > .am-table .am-nowrap-initial {
@@ -1498,7 +1498,7 @@ button.colorpicker-submit img {
}
.am-table-scrollable-horizontal > .am-table > thead > tr th {
background: #f8f8f8;
- min-width: 27rem;
+ min-width: 17rem;
font-weight: 500;
color: #333;
position: sticky;
diff --git a/public/static/index/default/css/common.css b/public/static/index/default/css/common.css
index ebf07af0a..1aabf6100 100755
--- a/public/static/index/default/css/common.css
+++ b/public/static/index/default/css/common.css
@@ -524,7 +524,6 @@ ul.am-dropdown-content>li>a:focus {
float: left;
background: transparent;
top: 4rem;
- border-bottom: 0.1rem solid #F5F5F5;
}
.goods-category-s .category-content .all-goods {
@@ -872,7 +871,7 @@ ul.am-dropdown-content>li>a:focus {
.category-content .menu-item {
left: 17.9rem;
- height: 47.1rem;
+ height: 47rem;
}
.category-content .category-list li {
diff --git a/public/static/index/default/css/index.css b/public/static/index/default/css/index.css
index b81555098..9385fa83d 100755
--- a/public/static/index/default/css/index.css
+++ b/public/static/index/default/css/index.css
@@ -117,7 +117,7 @@ ul, li, ol {list-style: none;}
}
@media only screen and (min-width: 1260px) {
/*轮播图布局*/
- .banner .am-slider, .banner .am-slider .am-slides li{height:47.1rem;}
+ .banner .am-slider, .banner .am-slider .am-slides li{height:47rem;}
/*公告布局*/
.banner-mixed { width:22rem; top:-45rem; text-align: left; }