Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
d9ecaa7d
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d9ecaa7d
编写于
7月 26, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
支付日志优化
上级
46d7799d
变更
14
展开全部
隐藏空白更改
内联
并排
Showing
14 changed file
with
319 addition
and
79 deletion
+319
-79
application/admin/form/Paylog.php
application/admin/form/Paylog.php
+94
-26
application/admin/view/default/paylog/module/business_list.html
...ation/admin/view/default/paylog/module/business_list.html
+21
-0
application/admin/view/default/paylog/module/payment.html
application/admin/view/default/paylog/module/payment.html
+1
-1
application/admin/view/default/refundlog/module/payment.html
application/admin/view/default/refundlog/module/payment.html
+1
-1
application/admin/view/default/warehouse/module/info.html
application/admin/view/default/warehouse/module/info.html
+2
-2
application/api/controller/Devtest.php
application/api/controller/Devtest.php
+73
-0
application/index/form/Order.php
application/index/form/Order.php
+1
-0
application/index/view/default/order/index.html
application/index/view/default/order/index.html
+1
-1
application/lang/zh-cn.php
application/lang/zh-cn.php
+7
-0
application/service/PayLogService.php
application/service/PayLogService.php
+17
-5
application/service/PaymentService.php
application/service/PaymentService.php
+5
-5
config/shopxo.sql
config/shopxo.sql
+47
-16
public/static/common/js/common.js
public/static/common/js/common.js
+36
-22
public/static/index/default/js/order.js
public/static/index/default/js/order.js
+13
-0
未找到文件。
application/admin/form/Paylog.php
浏览文件 @
d9ecaa7d
...
...
@@ -68,34 +68,69 @@ class Paylog
'form_type'
=>
'select'
,
'form_name'
=>
'payment'
,
'where_type'
=>
'in'
,
'data'
=>
$this
->
PayLogTypeList
(),
'data'
=>
$this
->
PayLog
Payment
TypeList
(),
'data_key'
=>
'id'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'状态'
,
'view_type'
=>
'field'
,
'view_key'
=>
'status'
,
'view_data_key'
=>
'name'
,
'view_data'
=>
lang
(
'common_pay_log_status_list'
),
'search_config'
=>
[
'form_type'
=>
'select'
,
'where_type'
=>
'in'
,
'data'
=>
lang
(
'common_pay_log_status_list'
),
'data_key'
=>
'value'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'业务类型'
,
'view_type'
=>
'field'
,
'view_key'
=>
'business_type'
,
'view_data_key'
=>
'name'
,
'view_data'
=>
lang
(
'common_business_type_list'
),
'search_config'
=>
[
'form_type'
=>
'select'
,
'where_type'
=>
'in'
,
'data'
=>
lang
(
'common_business_type_list'
),
'data_key'
=>
'
id
'
,
'data'
=>
$this
->
PayLogBusinessTypeList
(
),
'data_key'
=>
'
name
'
,
'data_name'
=>
'name'
,
'is_multiple'
=>
1
,
],
],
[
'label'
=>
'业务订单id'
,
'label'
=>
'业务id/单号'
,
'view_type'
=>
'module'
,
'view_key'
=>
'paylog/module/business_list'
,
'width'
=>
300
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'form_name'
=>
'id'
,
'where_type'
=>
'like'
,
'where_type_custom'
=>
'in'
,
'where_handle_custom'
=>
'WhereValueBusinessInfo'
,
],
],
[
'label'
=>
'业务订单金额(元)'
,
'view_type'
=>
'field'
,
'view_key'
=>
'
order_id
'
,
'view_key'
=>
'
total_price
'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'='
,
'form_type'
=>
'section'
,
'is_point'
=>
1
,
],
],
[
'label'
=>
'支付金额(元)'
,
'view_type'
=>
'field'
,
'view_key'
=>
'pay_price'
,
'search_config'
=>
[
'form_type'
=>
'section'
,
'is_point'
=>
1
,
],
],
[
...
...
@@ -104,7 +139,7 @@ class Paylog
'view_key'
=>
'trade_no'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'
like
'
,
'where_type'
=>
'
=
'
,
],
],
[
...
...
@@ -117,39 +152,36 @@ class Paylog
],
],
[
'label'
=>
'
支付金额
'
,
'label'
=>
'
订单名称
'
,
'view_type'
=>
'field'
,
'view_key'
=>
'
pay_price
'
,
'view_key'
=>
'
subject
'
,
'search_config'
=>
[
'form_type'
=>
'
section
'
,
'
is_point'
=>
1
,
'form_type'
=>
'
input
'
,
'
where_type'
=>
'like'
,
],
],
[
'label'
=>
'
订单实际金额
'
,
'label'
=>
'
支付时间
'
,
'view_type'
=>
'field'
,
'view_key'
=>
'
total_pric
e'
,
'view_key'
=>
'
pay_tim
e'
,
'search_config'
=>
[
'form_type'
=>
'section'
,
'is_point'
=>
1
,
'form_type'
=>
'datetime'
,
],
],
[
'label'
=>
'
订单名称
'
,
'label'
=>
'
关闭时间
'
,
'view_type'
=>
'field'
,
'view_key'
=>
'
subject
'
,
'view_key'
=>
'
close_time
'
,
'search_config'
=>
[
'form_type'
=>
'input'
,
'where_type'
=>
'like'
,
'form_type'
=>
'datetime'
,
],
],
[
'label'
=>
'
支付
时间'
,
'label'
=>
'
创建
时间'
,
'view_type'
=>
'field'
,
'view_key'
=>
'add_time
_time
'
,
'view_key'
=>
'add_time'
,
'search_config'
=>
[
'form_type'
=>
'datetime'
,
'form_name'
=>
'add_time'
,
],
],
[
...
...
@@ -194,10 +226,46 @@ class Paylog
* @date 2020-06-26
* @desc description
*/
public
function
PayLogTypeList
()
public
function
PayLog
Payment
TypeList
()
{
$ret
=
PayLogService
::
PayLogTypeList
();
return
empty
(
$ret
[
'data'
])
?
[]
:
$ret
[
'data'
];
}
/**
* 业务类型
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-26
* @desc description
*/
public
function
PayLogBusinessTypeList
()
{
return
Db
::
name
(
'PayLog'
)
->
field
(
'business_type as name'
)
->
group
(
'business_type'
)
->
select
();
}
/**
* 关联业务条件处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-06-30
* @desc description
* @param [string] $value [条件值]
* @param [array] $params [输入参数]
*/
public
function
WhereValueBusinessInfo
(
$value
,
$params
=
[])
{
if
(
!
empty
(
$value
))
{
// 获取支持业务支付 id
$ids
=
Db
::
name
(
'PayLogValue'
)
->
where
(
'business_id|business_no'
,
'='
,
$value
)
->
column
(
'pay_log_id'
);
// 避免空条件造成无效的错觉
return
empty
(
$ids
)
?
[
0
]
:
$ids
;
}
return
$value
;
}
}
?>
\ No newline at end of file
application/admin/view/default/paylog/module/business_list.html
0 → 100644
浏览文件 @
d9ecaa7d
<!-- 关联业务数据 -->
{{if !empty($module_data) and !empty($module_data['business_list']) and is_array($module_data['business_list'])}}
<dl
class=
"dl-content dl-content-dd-only"
>
{{foreach $module_data.business_list as $v}}
<dd>
<div
class=
"am-nbfc"
>
{{if !empty($v['business_id'])}}
<span
class=
"am-icon-circle-thin am-fl"
>
<strong>
{{$v.business_id}}
</strong>
</span>
{{/if}}
{{if !empty($v['business_no'])}}
<span
class=
"am-icon-bookmark-o am-fr"
>
<strong>
{{$v.business_no}}
</strong>
</span>
{{/if}}
</div>
</dd>
{{/foreach}}
</dl>
{{/if}}
\ No newline at end of file
application/admin/view/default/paylog/module/payment.html
浏览文件 @
d9ecaa7d
...
...
@@ -5,7 +5,7 @@
{{/if}}
{{if isset($module_data['payment'])}}
<p>
<span
class=
"am-badge am-radius"
>
{{$module_data.payment}}
</span>
<span
class=
"am-badge am-
badge-secondary-plain am-
radius"
>
{{$module_data.payment}}
</span>
</p>
{{/if}}
{{/if}}
\ No newline at end of file
application/admin/view/default/refundlog/module/payment.html
浏览文件 @
d9ecaa7d
...
...
@@ -5,7 +5,7 @@
{{/if}}
{{if isset($module_data['payment'])}}
<p>
<span
class=
"am-badge am-radius"
>
{{$module_data.payment}}
</span>
<span
class=
"am-badge am-
badge-secondary-plain am-
radius"
>
{{$module_data.payment}}
</span>
</p>
{{/if}}
{{/if}}
\ No newline at end of file
application/admin/view/default/warehouse/module/info.html
浏览文件 @
d9ecaa7d
<!-- 基础信息 -->
{{if !empty($module_data)}}
{{if !empty($module_data['name'])}}
<p>
{{$module_data.name}}{{if isset($module_data['is_default']) and $module_data['is_default'] eq 1}}
<span
class=
"am-badge am-badge-success am-round am-margin-left-xs"
>
默认
</span>
{{/if}}
</p>
<p>
{{$module_data.name}}{{if isset($module_data['is_default']) and $module_data['is_default'] eq 1}}
<span
class=
"am-badge am-badge-success
-plain
am-round am-margin-left-xs"
>
默认
</span>
{{/if}}
</p>
{{/if}}
{{if !empty($module_data['alias'])}}
<p
class=
"am-badge am-badge-secondary am-radius"
>
{{$module_data.alias}}
</p>
<p
class=
"am-badge am-badge-secondary
-plain
am-radius"
>
{{$module_data.alias}}
</p>
{{/if}}
{{/if}}
\ No newline at end of file
application/api/controller/Devtest.php
浏览文件 @
d9ecaa7d
...
...
@@ -130,5 +130,78 @@ class Devtest extends Common
}
echo
'count:'
.
count
(
$result
)
.
', success:'
.
$success
.
', fail:'
.
$fail
;
}
/**
* 支付日志处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-26
* @desc description
*/
public
function
PayLogHandle
()
{
if
(
input
(
'pwd'
)
!=
'shopxo520'
)
{
die
(
'非法访问'
);
}
// 状态
$success
=
0
;
$fail
=
0
;
// 获取日志
$data
=
Db
::
name
(
'PayLog'
)
->
where
([
'is_handle'
=>
0
])
->
limit
(
0
,
500
)
->
select
();
if
(
!
empty
(
$data
))
{
$business_type_list
=
[
0
=>
'默认'
,
1
=>
'订单'
,
2
=>
'充值'
,
3
=>
'提现'
,
];
foreach
(
$data
as
$v
)
{
$upd_data
=
[
'is_handle'
=>
1
,
'business_type'
=>
isset
(
$business_type_list
[
$v
[
'business_type'
]])
?
$business_type_list
[
$v
[
'business_type'
]]
:
$v
[
'business_type'
],
'status'
=>
(
empty
(
$v
[
'pay_price'
])
||
$v
[
'pay_price'
]
<=
0
)
?
0
:
1
,
];
// 未支付则关闭
if
(
empty
(
$v
[
'pay_price'
])
||
$v
[
'pay_price'
]
<=
0
)
{
$upd_data
[
'close_time'
]
=
time
();
}
// 支付时间
if
(
!
empty
(
$v
[
'pay_price'
])
&&
$v
[
'pay_price'
]
>
0
)
{
$upd_data
[
'pay_time'
]
=
time
();
}
// 更新操作
if
(
Db
::
name
(
'PayLog'
)
->
where
([
'is_handle'
=>
0
,
'id'
=>
$v
[
'id'
]])
->
update
(
$upd_data
))
{
// 新增关联数据
if
(
DB
::
name
(
'PayLogValue'
)
->
insert
([
'pay_log_id'
=>
$v
[
'id'
],
'business_id'
=>
$v
[
'order_id'
],
'business_no'
=>
''
,
'add_time'
=>
$v
[
'add_time'
],
]))
{
$success
++
;
}
else
{
$fail
++
;
}
}
else
{
$fail
++
;
}
}
}
echo
'count:'
.
count
(
$data
)
.
', success:'
.
$success
.
', fail:'
.
$fail
;
}
}
?>
\ No newline at end of file
application/index/form/Order.php
浏览文件 @
d9ecaa7d
...
...
@@ -78,6 +78,7 @@ class Order
'not_show_data'
=>
[
0
,
2
,
3
,
4
,
5
,
6
],
'align'
=>
'center'
,
'width'
=>
80
,
'view_key'
=>
'order_form_checkbox_value'
,
],
[
'label'
=>
'基础信息'
,
...
...
application/index/view/default/order/index.html
浏览文件 @
d9ecaa7d
...
...
@@ -3,7 +3,7 @@
<!-- 表单顶部操作栏 -->
{{block name="form_operate_top"}}
<button
type=
"button"
class=
"am-btn am-btn-secondary am-radius am-btn-xs am-icon-paypal"
>
批量支付
</button>
<button
type=
"button"
class=
"am-btn am-btn-secondary am-radius am-btn-xs am-icon-paypal
batch-pay-submit
"
>
批量支付
</button>
<!-- 父级内容 -->
{__block__}
{{/block}}
\ No newline at end of file
application/lang/zh-cn.php
浏览文件 @
d9ecaa7d
...
...
@@ -366,6 +366,13 @@ return array(
2
=>
array
(
'value'
=>
2
,
'name'
=>
'已离职'
),
),
// 支付日志状态
'common_pay_log_status_list'
=>
array
(
0
=>
array
(
'value'
=>
0
,
'name'
=>
'待支付'
,
'checked'
=>
true
),
1
=>
array
(
'value'
=>
1
,
'name'
=>
'已支付'
),
2
=>
array
(
'value'
=>
2
,
'name'
=>
'已关闭'
),
),
// 色彩值
'common_color_list'
=>
array
(
...
...
application/service/PayLogService.php
浏览文件 @
d9ecaa7d
...
...
@@ -93,7 +93,18 @@ class PayLogService
$data
=
Db
::
name
(
'PayLog'
)
->
where
(
$where
)
->
field
(
$field
)
->
limit
(
$m
,
$n
)
->
order
(
$order_by
)
->
select
();
if
(
!
empty
(
$data
))
{
$refundment_list
=
lang
(
'common_business_type_list'
);
// 获取支付业务关联数据
$log_value_list
=
[];
$log_value
=
Db
::
name
(
'PayLogValue'
)
->
field
(
'pay_log_id,business_id,business_no'
)
->
where
([
'pay_log_id'
=>
array_column
(
$data
,
'id'
)])
->
select
();
if
(
!
empty
(
$log_value
))
{
foreach
(
$log_value
as
$lv
)
{
$log_value_list
[
$lv
[
'pay_log_id'
]][]
=
$lv
;
}
}
// 循环处理数据
foreach
(
$data
as
&
$v
)
{
// 用户信息
...
...
@@ -105,12 +116,13 @@ class PayLogService
}
}
//
业务类型
$v
[
'business_
type_text'
]
=
$refundment_list
[
$v
[
'business_type'
]][
'name'
];
//
关联业务数据
$v
[
'business_
list'
]
=
isset
(
$log_value_list
[
$v
[
'id'
]])
?
$log_value_list
[
$v
[
'id'
]]
:
[
];
// 时间
$v
[
'add_time_time'
]
=
date
(
'Y-m-d H:i:s'
,
$v
[
'add_time'
]);
$v
[
'add_time_date'
]
=
date
(
'Y-m-d'
,
$v
[
'add_time'
]);
$v
[
'add_time'
]
=
empty
(
$v
[
'add_time'
])
?
''
:
date
(
'Y-m-d H:i:s'
,
$v
[
'add_time'
]);
$v
[
'pay_time'
]
=
empty
(
$v
[
'pay_time'
])
?
''
:
date
(
'Y-m-d H:i:s'
,
$v
[
'pay_time'
]);
$v
[
'close_time'
]
=
empty
(
$v
[
'close_time'
])
?
''
:
date
(
'Y-m-d H:i:s'
,
$v
[
'close_time'
]);
}
}
return
DataReturn
(
'处理成功'
,
0
,
$data
);
...
...
application/service/PaymentService.php
浏览文件 @
d9ecaa7d
...
...
@@ -252,15 +252,15 @@ class PaymentService
* @version 1.0.0
* @date 2018-09-19
* @desc description
* @param [int
] $order_id [订单id
]
* @param [int]
$payment_id
[支付方式id]
* @param [int
|string] $business_value [业务订单id|单号
]
* @param [int]
$payment_id
[支付方式id]
*/
public
static
function
OrderPaymentName
(
$
order_id
=
0
,
$payment_id
=
0
)
public
static
function
OrderPaymentName
(
$
business_value
=
0
,
$payment_id
=
0
)
{
$name
=
null
;
if
(
!
empty
(
$
order_id
))
if
(
!
empty
(
$
business_value
))
{
$name
=
Db
::
name
(
'PayLog'
)
->
where
([
'order_id'
=>
intval
(
$order_id
)])
->
value
(
'
payment_name'
);
$name
=
Db
::
name
(
'PayLog'
)
->
alias
(
'pl'
)
->
join
([
'__PAY_LOG_VALUE__'
=>
'plv'
],
'pl.id=plv.pay_log_id'
)
->
where
([
'business_id|business_no'
=>
$business_value
])
->
value
(
'pl.
payment_name'
);
if
(
empty
(
$anme
)
&&
!
empty
(
$payment_id
))
{
$name
=
Db
::
name
(
'Payment'
)
->
where
([
'id'
=>
intval
(
$payment_id
)])
->
value
(
'name'
);
...
...
config/shopxo.sql
浏览文件 @
d9ecaa7d
此差异已折叠。
点击以展开。
public/static/common/js/common.js
浏览文件 @
d9ecaa7d
...
...
@@ -1579,7 +1579,7 @@ function MapInit(lng, lat, level, point, is_dragend, mapid)
* @date 2020-02-29
* @desc description
*/
function
TableContainerInit
()
function
Form
TableContainerInit
()
{
if
(
$
(
'
.am-table-scrollable-horizontal
'
).
length
>
0
)
{
...
...
@@ -1630,12 +1630,45 @@ function TableContainerInit()
}
}
/**
* 动态表格选中的值
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2020-07-26
* @desc description
* @param {[string]} form [表单名称]
*/
function
FromTableCheckedValues
(
form
)
{
// 获取复选框选中的值
var
values
=
[];
$
(
'
.am-table-scrollable-horizontal
'
).
find
(
'
input[name="
'
+
form
+
'
"]
'
).
each
(
function
(
key
,
tmp
)
{
if
(
$
(
this
).
is
(
'
:checked
'
))
{
values
.
push
(
tmp
.
value
);
}
});
// 获取单选选中的值
if
(
values
.
length
<=
0
)
{
var
val
=
$
(
'
.am-table-scrollable-horizontal input[name="
'
+
form
+
'
"]:checked
'
).
val
();
if
(
val
!=
undefined
)
{
values
.
push
(
val
);
}
}
return
values
;
}
// 公共数据操作
$
(
function
()
{
// 表格初始化
TableContainerInit
();
Form
TableContainerInit
();
// 表格复选框操作 全选/反选
$
(
'
.form-table-operate-checkbox-submit
'
).
on
(
'
click
'
,
function
()
...
...
@@ -1673,27 +1706,8 @@ $(function()
return
false
;
}
// 获取复选框选中的值
var
values
=
[];
$
(
document
).
find
(
'
input[name="
'
+
form
+
'
"]
'
).
each
(
function
(
key
,
tmp
)
{
if
(
$
(
this
).
is
(
'
:checked
'
))
{
values
.
push
(
tmp
.
value
);
}
});
// 获取单选框的值
if
(
values
.
length
<=
0
)
{
var
val
=
$
(
'
input[name="
'
+
form
+
'
"]:checked
'
).
val
();
if
(
val
!=
undefined
)
{
values
.
push
(
val
);
}
}
// 是否有选择的数据
var
values
=
FromTableCheckedValues
(
form
);
if
(
values
.
length
<=
0
)
{
Prompt
(
'
请先选中数据
'
);
...
...
public/static/index/default/js/order.js
浏览文件 @
d9ecaa7d
...
...
@@ -83,4 +83,17 @@ $(function()
}
}
}
// 批量支付
$
(
'
.batch-pay-submit
'
).
on
(
'
click
'
,
function
()
{
// 是否有选择的数据
var
values
=
FromTableCheckedValues
(
'
order_form_checkbox_value
'
);
console
.
log
(
values
)
if
(
values
.
length
<=
0
)
{
Prompt
(
'
请先选中数据
'
);
return
false
;
}
});
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录