Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
ShopXO
提交
0e54124b
ShopXO
项目概览
飞鱼0526
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0e54124b
编写于
6月 19, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
支付方式管理优化
上级
036c980b
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
228 addition
and
178 deletion
+228
-178
application/admin/controller/Payment.php
application/admin/controller/Payment.php
+10
-9
application/admin/form/Payment.php
application/admin/form/Payment.php
+104
-0
application/admin/form/Slide.php
application/admin/form/Slide.php
+1
-0
application/admin/view/default/payment/index.html
application/admin/view/default/payment/index.html
+44
-166
application/admin/view/default/payment/module/apply_terminal.html
...ion/admin/view/default/payment/module/apply_terminal.html
+6
-0
application/admin/view/default/payment/module/author.html
application/admin/view/default/payment/module/author.html
+9
-0
application/admin/view/default/payment/module/enable.html
application/admin/view/default/payment/module/enable.html
+3
-0
application/admin/view/default/payment/module/logo.html
application/admin/view/default/payment/module/logo.html
+6
-0
application/admin/view/default/payment/module/open_user.html
application/admin/view/default/payment/module/open_user.html
+3
-0
application/admin/view/default/payment/module/operate.html
application/admin/view/default/payment/module/operate.html
+24
-0
application/service/PaymentService.php
application/service/PaymentService.php
+17
-2
public/static/index/default/css/goods.css
public/static/index/default/css/goods.css
+1
-1
未找到文件。
application/admin/controller/Payment.php
浏览文件 @
0e54124b
...
...
@@ -51,9 +51,10 @@ class Payment extends Common
public
function
Index
()
{
// 插件列表
$this
->
assign
(
'data_list'
,
PaymentService
::
PlugPaymentList
());
$ret
=
PaymentService
::
PlugPaymentList
();
$this
->
assign
(
'data_list'
,
$ret
[
'data'
]);
// 不删除的支付方式
// 不
能
删除的支付方式
$this
->
assign
(
'cannot_deleted_list'
,
PaymentService
::
$cannot_deleted_list
);
// 适用平台
...
...
@@ -75,7 +76,7 @@ class Payment extends Common
public
function
SaveInfo
()
{
// 参数
$params
=
input
()
;
$params
=
$this
->
data_request
;
// 商品信息
if
(
!
empty
(
$params
[
'id'
]))
...
...
@@ -121,7 +122,7 @@ class Payment extends Common
}
// 开始操作
return
PaymentService
::
PaymentUpdate
(
input
()
);
return
PaymentService
::
PaymentUpdate
(
$this
->
data_request
);
}
/**
...
...
@@ -140,7 +141,7 @@ class Payment extends Common
}
// 开始操作
return
PaymentService
::
PaymentStatusUpdate
(
input
()
);
return
PaymentService
::
PaymentStatusUpdate
(
$this
->
data_request
);
}
/**
...
...
@@ -160,7 +161,7 @@ class Payment extends Common
}
// 开始操作
return
PaymentService
::
Install
(
input
()
);
return
PaymentService
::
Install
(
$this
->
data_request
);
}
/**
...
...
@@ -180,7 +181,7 @@ class Payment extends Common
}
// 开始操作
return
PaymentService
::
Uninstall
(
input
()
);
return
PaymentService
::
Uninstall
(
$this
->
data_request
);
}
/**
...
...
@@ -200,7 +201,7 @@ class Payment extends Common
}
// 开始操作
return
PaymentService
::
Delete
(
input
()
);
return
PaymentService
::
Delete
(
$this
->
data_request
);
}
/**
...
...
@@ -220,7 +221,7 @@ class Payment extends Common
}
// 开始操作
return
PaymentService
::
Upload
(
input
()
);
return
PaymentService
::
Upload
(
$this
->
data_request
);
}
}
?>
\ No newline at end of file
application/admin/form/Payment.php
0 → 100644
浏览文件 @
0e54124b
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
app\admin\form
;
/**
* 支付方式动态表格
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-18
* @desc description
*/
class
Payment
{
// 基础条件
public
$condition_base
=
[];
/**
* 入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-18
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Run
(
$params
=
[])
{
return
[
// 基础配置
'base'
=>
[
'key_field'
=>
'payment'
,
'status_field'
=>
'is_enable'
,
],
// 表单配置
'form'
=>
[
[
'label'
=>
'名称'
,
'view_type'
=>
'field'
,
'view_key'
=>
'name'
,
],
[
'label'
=>
'LOGO'
,
'view_type'
=>
'module'
,
'view_key'
=>
'payment/module/logo'
,
],
[
'label'
=>
'插件版本'
,
'view_type'
=>
'field'
,
'view_key'
=>
'version'
,
],
[
'label'
=>
'适用版本'
,
'view_type'
=>
'apply_version'
,
'view_key'
=>
'name'
,
],
[
'label'
=>
'适用终端'
,
'view_type'
=>
'module'
,
'view_key'
=>
'payment/module/apply_terminal'
,
],
[
'label'
=>
'作者'
,
'view_type'
=>
'module'
,
'view_key'
=>
'payment/module/author'
,
],
[
'label'
=>
'描述'
,
'view_type'
=>
'field'
,
'view_key'
=>
'desc'
,
'grid_size'
=>
'lg'
,
],
[
'label'
=>
'是否启用'
,
'view_type'
=>
'module'
,
'view_key'
=>
'payment/module/enable'
,
'align'
=>
'center'
,
],
[
'label'
=>
'用户开放'
,
'view_type'
=>
'module'
,
'view_key'
=>
'payment/module/open_user'
,
'align'
=>
'center'
,
],
[
'label'
=>
'操作'
,
'view_type'
=>
'operate'
,
'view_key'
=>
'payment/module/operate'
,
'align'
=>
'center'
,
'fixed'
=>
'right'
,
],
],
];
}
}
?>
\ No newline at end of file
application/admin/form/Slide.php
浏览文件 @
0e54124b
...
...
@@ -102,6 +102,7 @@ class Slide
'label'
=>
'事件值'
,
'view_type'
=>
'field'
,
'view_key'
=>
'event_value'
,
'grid_size'
=>
'sm'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'like'
,
...
...
application/admin/view/default/payment/index.html
浏览文件 @
0e54124b
{{include file="public/header" /}}
<!-- 继承公共的 form -->
{{extend name="public/module/form" /}}
<!-- right content start -->
<div
class=
"content-right"
>
<div
class=
"content"
>
<!-- operation start -->
<div
class=
"am-g"
>
<a
href=
"javascript:;"
class=
"am-btn am-btn-secondary am-btn-xs am-icon-cloud-upload am-radius"
data-am-modal=
"{target: '#payment-upload-win'}"
>
上传
</a>
<!-- 表单顶部操作栏 -->
{{block name="form_operate_top"}}
<button
type=
"button"
class=
"am-btn am-btn-secondary am-btn-xs am-icon-cloud-upload am-radius"
data-am-modal=
"{target: '#payment-upload-win'}"
>
上传
</button>
<a
class=
"am-margin-left-sm"
href=
"{{$store_payment_url}}"
target=
"_blank"
>
更多支付插件下载
<i
class=
"am-icon-external-link"
></i></a>
</div>
<!-- operation end -->
<!-- list start -->
<div
class=
"am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm am-margin-bottom-sm"
>
<table
class=
"am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap am-table-td-fixed-last"
>
<thead>
<tr>
<th>
名称
</th>
<th>
LOGO
</th>
<th>
适用版本
</th>
<th>
适用终端
</th>
<th>
作者
</th>
<th
class=
"am-grid-lg"
>
描述
</th>
<th
class=
"am-text-center"
>
是否启用
</th>
<th
class=
"am-text-center"
>
用户开放
</th>
<th
class=
"am-text-center"
>
操作
</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr
id=
"data-list-{{$v.payment}}"
{{
if
$
v
['
is_install
']
eq
0}}
class=
"am-disabled"
{{
elseif
$
v
['
is_enable
']
eq
0
/}}
class=
"am-active"
{{/
if
}}
>
<td
class=
"am-text-middle"
>
{{$v.name}}
{{if !empty($v['version'])}}
<p>
<span
class=
"am-badge am-badge-secondary am-radius"
>
v {{$v.version}}
</span>
</p>
{{/if}}
</td>
<td
class=
"am-text-middle"
>
{{if !empty($v['logo'])}}
<a
href=
"{{$v['logo']}}"
target=
"_blank"
>
<img
src=
"{{$v['logo']}}"
class=
"am-radius"
width=
"100"
/>
</a>
{{else /}}
<span
class=
"cr-ddd"
>
暂无LOGO
</span>
{{/if}}
</td>
<td
class=
"am-text-middle"
>
{{if empty($v['apply_version'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.apply_version}}{{/if}}
</td>
<td
class=
"am-text-middle"
>
{{if !empty($v['apply_terminal'])}}
{{foreach $v.apply_terminal as $terminal_k=>$terminal_v}}
{{$common_platform_type[$terminal_v]['name']}}
{{if $terminal_k LT count($v['apply_terminal'])-1}}
<br
/>
{{/if}}
{{/foreach}}
{{else /}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{/if}}
</td>
<td
class=
"am-text-middle"
>
{{if empty($v['author'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}
{{$v.author}}
{{if !empty($v['author_url'])}}
<a
href=
"{{$v.author_url}}"
target=
"_blank"
>
<i
class=
"am-icon-external-link"
></i>
</a>
{{/if}}
{{/if}}
</td>
<td
class=
"am-text-middle am-nowrap-initial"
>
{{if empty($v['desc'])}}
<span
class=
"cr-ddd"
>
未填写
</span>
{{else /}}{{$v.desc|raw}}{{/if}}
</td>
<td
class=
"am-text-middle am-text-center"
>
{{if $v['is_install'] eq 1}}
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if $v['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:MyUrl('admin/payment/StatusUpdate')}}"
data-id=
"{{$v.payment}}"
data-field=
"is_enable"
data-state=
"{{$v['is_enable']}}"
data-is-update-status=
"1"
></a>
{{else /}}
<span
class=
"cr-ddd"
>
未安装
</span>
{{/if}}
</td>
<td
class=
"am-text-middle am-text-center"
>
{{if $v['is_install'] eq 1}}
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if $v['is_open_user'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:MyUrl('admin/payment/StatusUpdate')}}"
data-id=
"{{$v.payment}}"
data-field=
"is_open_user"
data-state=
"{{$v['is_open_user']}}"
></a>
{{else /}}
<span
class=
"cr-ddd"
>
未安装
</span>
{{/if}}
</td>
<td
class=
"am-operate-grid"
>
<div
class=
"am-scrollable-vertical"
>
{{if $v['is_install'] eq 0}}
<button
class=
"am-btn am-btn-success am-btn-xs am-radius am-btn-block submit-ajax"
data-url=
"{{:MyUrl('admin/payment/install')}}"
data-id=
"{{$v.payment}}"
data-view=
"reload"
data-msg=
"安装进行中、确认操作吗?"
>
<i
class=
"am-icon-cubes"
></i>
<span>
安装
</span>
</button>
{{if !in_array($v['payment'], $cannot_deleted_list)}}
<button
class=
"am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete"
data-url=
"{{:MyUrl('admin/payment/delete')}}"
data-id=
"{{$v.payment}}"
>
<i
class=
"am-icon-trash-o"
></i>
<span>
删除
</span>
</button>
{{/if}}
{{else /}}
<a
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-btn-block"
href=
"{{:MyUrl('admin/payment/saveinfo', array('id'=>$v['id']))}}"
>
<i
class=
"am-icon-edit"
></i>
<span>
编辑
</span>
</a>
<button
class=
"am-btn am-btn-warning am-btn-xs am-radius am-btn-block submit-ajax"
data-url=
"{{:MyUrl('admin/payment/uninstall')}}"
data-id=
"{{$v.payment}}"
data-view=
"reload"
data-msg=
"卸载后不可恢复、确认操作吗?"
>
<i
class=
"am-icon-remove"
></i>
<span>
卸载
</span>
</button>
{{/if}}
</div>
</td>
</tr>
{{/foreach}}
{{/if}}
</tbody>
</table>
{{if empty($data_list)}}
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有相关数据
</div>
{{/if}}
</div>
<!-- list end -->
<!-- 父级内容 -->
{__block__}
{{/block}}
<!-- 扩展 -->
{{block name="form_extend"}}
<!-- upload start -->
<div
class=
"am-popup am-radius"
id=
"payment-upload-win"
>
<div
class=
"am-popup-inner"
>
...
...
@@ -162,10 +46,4 @@
</div>
</div>
<!-- upload end -->
</div>
</div>
<!-- right content end -->
<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->
\ No newline at end of file
{{/block}}
\ No newline at end of file
application/admin/view/default/payment/module/apply_terminal.html
0 → 100644
浏览文件 @
0e54124b
<!-- 适配平台 -->
{{if !empty($module_data['apply_terminal']) and is_array($module_data['apply_terminal'])}}
{{foreach $module_data.apply_terminal as $terminal_k=>$terminal_v}}
<p>
{{$common_platform_type[$terminal_v]['name']}}
</p>
{{/foreach}}
{{/if}}
\ No newline at end of file
application/admin/view/default/payment/module/author.html
0 → 100644
浏览文件 @
0e54124b
<!-- 作者 -->
{{if !empty($module_data)}}
<span>
{{$module_data.author}}
</span>
{{if !empty($module_data['author_url'])}}
<a
href=
"{{$module_data.author_url}}"
target=
"_blank"
>
<i
class=
"am-icon-external-link"
></i>
</a>
{{/if}}
{{/if}}
\ No newline at end of file
application/admin/view/default/payment/module/enable.html
0 → 100644
浏览文件 @
0e54124b
{{if !empty($module_data) and isset($module_data['is_install']) and $module_data['is_install'] eq 1}}
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if $module_data['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:MyUrl('admin/payment/statusupdate')}}"
data-id=
"{{$module_data.payment}}"
data-field=
"is_enable"
data-state=
"{{$module_data['is_enable']}}"
data-is-update-status=
"1"
></a>
{{/if}}
\ No newline at end of file
application/admin/view/default/payment/module/logo.html
0 → 100644
浏览文件 @
0e54124b
<!-- logo -->
{{if !empty($module_data) and !empty($module_data['logo'])}}
<a
href=
"{{$module_data['logo']}}"
target=
"_blank"
>
<img
src=
"{{$module_data['logo']}}"
class=
"am-radius"
width=
"50"
height=
"50"
/>
</a>
{{/if}}
\ No newline at end of file
application/admin/view/default/payment/module/open_user.html
0 → 100644
浏览文件 @
0e54124b
{{if !empty($module_data) and isset($module_data['is_install']) and $module_data['is_install'] eq 1}}
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if $module_data['is_open_user'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:MyUrl('admin/payment/statusupdate')}}"
data-id=
"{{$module_data.payment}}"
data-field=
"is_open_user"
data-state=
"{{$module_data['is_open_user']}}"
></a>
{{/if}}
\ No newline at end of file
application/admin/view/default/payment/module/operate.html
0 → 100644
浏览文件 @
0e54124b
<!-- 操作栏 -->
{{if $module_data['is_install'] eq 0}}
<button
type=
"button"
class=
"am-btn am-btn-success am-btn-xs am-radius am-btn-block submit-ajax"
data-url=
"{{:MyUrl('admin/payment/install')}}"
data-id=
"{{$module_data.payment}}"
data-view=
"reload"
data-msg=
"安装进行中、确认操作吗?"
>
<i
class=
"am-icon-cubes"
></i>
<span>
安装
</span>
</button>
{{if !in_array($module_data['payment'], $cannot_deleted_list)}}
<button
type=
"button"
class=
"am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete"
data-url=
"{{:MyUrl('admin/payment/delete')}}"
data-id=
"{{$module_data.payment}}"
>
<i
class=
"am-icon-trash-o"
></i>
<span>
删除
</span>
</button>
{{/if}}
{{else /}}
<a
class=
"am-btn am-btn-secondary am-btn-xs am-radius am-btn-block"
href=
"{{:MyUrl('admin/payment/saveinfo', array('id'=>$module_data['id']))}}"
>
<i
class=
"am-icon-edit"
></i>
<span>
编辑
</span>
</a>
<button
type=
"button"
class=
"am-btn am-btn-warning am-btn-xs am-radius am-btn-block submit-ajax"
data-url=
"{{:MyUrl('admin/payment/uninstall')}}"
data-id=
"{{$module_data.payment}}"
data-view=
"reload"
data-msg=
"卸载后不可恢复、确认操作吗?"
>
<i
class=
"am-icon-remove"
></i>
<span>
卸载
</span>
</button>
{{/if}}
\ No newline at end of file
application/service/PaymentService.php
浏览文件 @
0e54124b
...
...
@@ -77,6 +77,7 @@ class PaymentService
{
if
(
$dh
=
opendir
(
self
::
$payment_dir
))
{
$common_platform_type
=
lang
(
'common_platform_type'
);
while
((
$temp_file
=
readdir
(
$dh
))
!==
false
)
{
if
(
substr
(
$temp_file
,
0
,
1
)
!=
'.'
)
...
...
@@ -99,10 +100,24 @@ class PaymentService
$temp
[
'id'
]
=
$db_config
[
0
][
'id'
];
$temp
[
'name'
]
=
$db_config
[
0
][
'name'
];
$temp
[
'logo'
]
=
$db_config
[
0
][
'logo'
];
$temp
[
'apply_terminal'
]
=
$db_config
[
0
][
'apply_terminal'
];
$temp
[
'config'
]
=
$db_config
[
0
][
'config'
];
$temp
[
'is_enable'
]
=
$db_config
[
0
][
'is_enable'
];
$temp
[
'is_open_user'
]
=
$db_config
[
0
][
'is_open_user'
];
// 支付平台类型
$apply_terminal_names
=
[];
if
(
!
empty
(
$db_config
[
0
][
'apply_terminal'
])
&&
is_array
(
$db_config
[
0
][
'apply_terminal'
]))
{
foreach
(
$common_platform_type
as
$platform_type
)
{
if
(
in_array
(
$platform_type
[
'value'
],
$db_config
[
0
][
'apply_terminal'
]))
{
$apply_terminal_names
[]
=
$platform_type
[
'name'
];
}
}
}
$temp
[
'apply_terminal_names'
]
=
$apply_terminal_names
;
$temp
[
'apply_terminal'
]
=
$db_config
[
0
][
'apply_terminal'
];
}
$data
[]
=
$temp
;
}
...
...
@@ -111,7 +126,7 @@ class PaymentService
closedir
(
$dh
);
}
}
return
$data
;
return
DataReturn
(
'success'
,
0
,
$data
)
;
}
/**
...
...
public/static/index/default/css/goods.css
浏览文件 @
0e54124b
...
...
@@ -82,7 +82,7 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
.score-container
.am-progress
{
width
:
calc
(
100%
-
105px
);
margin-bottom
:
0
;
margin-top
:
18px
;
line-height
:
2rem
;
text-align
:
center
;
}
/*详情*/
.detail-content
img
{
max-width
:
100%
;
}
.detail-content
img
{
max-width
:
100%
;
height
:
auto
;
}
@media
only
screen
and
(
min-width
:
640px
)
{
.theme-span
{
height
:
0px
;
background
:
#fff
;}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录