Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
______--______
ShopXO
提交
bc2b5758
ShopXO
项目概览
______--______
/
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,发现更多精彩内容 >>
提交
bc2b5758
编写于
4月 30, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
钱包
上级
16983958
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
260 addition
and
44 deletion
+260
-44
application/plugins/view/wallet/wallet/index.html
application/plugins/view/wallet/wallet/index.html
+53
-14
application/plugins/wallet/Hook.php
application/plugins/wallet/Hook.php
+1
-1
application/plugins/wallet/Recharge.php
application/plugins/wallet/Recharge.php
+1
-1
application/plugins/wallet/Wallet.php
application/plugins/wallet/Wallet.php
+11
-11
application/plugins/wallet/install.sql
application/plugins/wallet/install.sql
+1
-1
application/plugins/wallet/service/BaseService.php
application/plugins/wallet/service/BaseService.php
+99
-2
application/plugins/wallet/service/WalletService.php
application/plugins/wallet/service/WalletService.php
+20
-0
config/shopxo.sql
config/shopxo.sql
+65
-14
public/static/plugins/css/wallet/index/wallet.css
public/static/plugins/css/wallet/index/wallet.css
+9
-0
未找到文件。
application/plugins/view/wallet/wallet/index.html
浏览文件 @
bc2b5758
...
...
@@ -31,12 +31,36 @@
<tbody>
<tr>
<td>
<span>
类型:
</span>
<select
name=
"type"
class=
"chosen-select"
data-placeholder=
"操作类型..."
>
<span>
业务:
</span>
<select
name=
"business_type"
class=
"chosen-select"
data-placeholder=
"业务类型..."
>
<option
value=
"-1"
>
业务类型...
</option>
{{if !empty($business_type_list)}}
{{foreach $business_type_list as $v}}
<option
value=
"{{$v.value}}"
{{
if
isset
($
params
['
business_type
'])
and
$
params
['
business_type
']
eq
$
v
['
value
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
{{/if}}
</select>
</td>
<td>
<span>
操作:
</span>
<select
name=
"operation_type"
class=
"chosen-select"
data-placeholder=
"操作类型..."
>
<option
value=
"-1"
>
操作类型...
</option>
{{if !empty($common_integral_log_type_list)}}
{{foreach $common_integral_log_type_list as $v}}
<option
value=
"{{$v.id}}"
{{
if
isset
($
params
['
type
'])
and
$
params
['
type
']
eq
$
v
['
id
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{if !empty($operation_type_list)}}
{{foreach $operation_type_list as $v}}
<option
value=
"{{$v.value}}"
{{
if
isset
($
params
['
operation_type
'])
and
$
params
['
operation_type
']
eq
$
v
['
value
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
{{/if}}
</select>
</td>
</tr>
<tr>
<td>
<span>
金额:
</span>
<select
name=
"money_type"
class=
"chosen-select"
data-placeholder=
"金额类型..."
>
<option
value=
"-1"
>
金额类型...
</option>
{{if !empty($money_type_list)}}
{{foreach $money_type_list as $v}}
<option
value=
"{{$v.value}}"
{{
if
isset
($
params
['
money_type
'])
and
$
params
['
money_type
']
eq
$
v
['
value
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
{{/if}}
</select>
...
...
@@ -55,28 +79,43 @@
<table
class=
"am-table"
>
<thead>
<tr>
<th>
业务类型
</th>
<th>
操作类型
</th>
<th
class=
"am-hide-sm-only"
>
描述
</th>
<th>
原始积分
</th>
<th
>
最新积分
</th>
<th
class=
"am-hide-sm-only"
>
时间
</th>
<th
>
金额类型
</th>
<th>
操作金额(元)
</th>
<th
class=
"am-hide-sm-only"
>
变更说明
</th>
<th
class=
"am-hide-sm-only"
>
创建
时间
</th>
</tr>
</thead>
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr>
<td>
{{$v.type_name}}
</td>
<td>
{{$v.business_type_text}}
</td>
<td>
{{if $v['operation_type'] eq 0}}
<span
class=
"operation-reduce-icon"
>
{{$v.operation_type_text}}
</span>
{{elseif $v['operation_type'] eq 1}}
<span
class=
"operation-increase-icon"
>
{{$v.operation_type_text}}
</span>
{{/if}}
</td>
<td>
{{$v.money_type_text}}
</td>
<td>
{{if $v['operation_type'] eq 0}}
<span
class=
"operation-reduce-icon"
>
-
</span>
{{elseif $v['operation_type'] eq 1}}
<span
class=
"operation-increase-icon"
>
+
</span>
{{/if}}
<span
class=
"money"
>
{{$v.money}}
</span>
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.msg}}
</td>
<td>
{{$v.original_integral}}
</td>
<td>
{{$v.new_integral}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.add_time_time}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.add_time_text}}
</td>
</tr>
{{/foreach}}
{{/if}}
{{if empty($data_list)}}
<tr>
<td
colspan=
"
5
"
>
<td
colspan=
"
6
"
>
<div
class=
"table-no"
><i
class=
"am-icon-warning"
></i>
没有相关数据
</div>
</td>
</tr>
...
...
application/plugins/wallet/Hook.php
浏览文件 @
bc2b5758
...
...
@@ -67,7 +67,7 @@ class Hook extends Controller
$params
[
'data'
][
'property'
][
'item'
][]
=
[
'name'
=>
'我的钱包'
,
'url'
=>
PluginsHomeUrl
(
'wallet'
,
'wallet'
,
'index'
),
'contains'
=>
[
'walletindex'
],
'contains'
=>
[
'walletindex'
,
'rechargeindex'
,
'cashindex'
],
'is_show'
=>
1
,
'icon'
=>
'am-icon-github-alt'
,
];
...
...
application/plugins/wallet/Recharge.php
浏览文件 @
bc2b5758
...
...
@@ -52,7 +52,7 @@ class Recharge extends Common
$number
=
MyC
(
'admin_page_number'
,
10
,
true
);
// 条件
$where
=
BaseService
::
Recharge
List
Where
(
$params
);
$where
=
BaseService
::
RechargeWhere
(
$params
);
// 获取总数
$total
=
BaseService
::
RechargeTotal
(
$where
);
...
...
application/plugins/wallet/Wallet.php
浏览文件 @
bc2b5758
...
...
@@ -11,9 +11,8 @@
namespace
app\plugins\wallet
;
use
app\plugins\wallet\Common
;
use
app\plugins\wallet\BusinessService
;
use
app\service\PluginsService
;
use
app\service\IntegralService
;
use
app\plugins\wallet\service\BaseService
;
use
app\plugins\wallet\service\WalletService
;
/**
* 钱包 - 账户明细
...
...
@@ -48,17 +47,16 @@ class Wallet extends Common
public
function
index
(
$params
=
[])
{
// 参数
$params
=
input
();
$params
[
'user'
]
=
$this
->
user
;
// 分页
$number
=
10
;
$number
=
MyC
(
'admin_page_number'
,
10
,
true
)
;
// 条件
$where
=
IntegralService
::
UserIntegralLogList
Where
(
$params
);
$where
=
BaseService
::
WalletLog
Where
(
$params
);
// 获取总数
$total
=
IntegralService
::
UserIntegral
LogTotal
(
$where
);
$total
=
BaseService
::
Wallet
LogTotal
(
$where
);
// 分页
$page_params
=
array
(
...
...
@@ -66,7 +64,7 @@ class Wallet extends Common
'total'
=>
$total
,
'where'
=>
$params
,
'page'
=>
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
,
'url'
=>
MyUrl
(
'index/userintegral/
index'
),
'url'
=>
PluginsHomeUrl
(
'wallet'
,
'wallet'
,
'
index'
),
);
$page
=
new
\
base\Page
(
$page_params
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
...
...
@@ -77,11 +75,13 @@ class Wallet extends Common
'n'
=>
$number
,
'where'
=>
$where
,
);
$data
=
IntegralService
::
UserIntegral
LogList
(
$data_params
);
$data
=
BaseService
::
Wallet
LogList
(
$data_params
);
$this
->
assign
(
'data_list'
,
$data
[
'data'
]);
// 操作类型
$this
->
assign
(
'common_integral_log_type_list'
,
lang
(
'common_integral_log_type_list'
));
// 静态数据
$this
->
assign
(
'business_type_list'
,
WalletService
::
$business_type_list
);
$this
->
assign
(
'operation_type_list'
,
WalletService
::
$operation_type_list
);
$this
->
assign
(
'money_type_list'
,
WalletService
::
$money_type_list
);
// 参数
$this
->
assign
(
'params'
,
$params
);
...
...
application/plugins/wallet/install.sql
浏览文件 @
bc2b5758
...
...
@@ -38,7 +38,7 @@ CREATE TABLE `s_plugins_wallet_log` (
`wallet_id`
int
(
11
)
unsigned
NOT
NULL
DEFAULT
'0'
COMMENT
'钱包id'
,
`business_type`
tinyint
(
2
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'业务类型(-1未知, 0充值, 1提现, 2消费)'
,
`operation_type`
tinyint
(
2
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'操作类型(-1未知, 0减少, 1增加)'
,
`money_type`
tinyint
(
2
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'
操作
类型(-1未知, 0正常, 1冻结)'
,
`money_type`
tinyint
(
2
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'
金额
类型(-1未知, 0正常, 1冻结)'
,
`money`
decimal
(
10
,
2
)
unsigned
NOT
NULL
DEFAULT
'0.00'
COMMENT
'操作金额'
,
`msg`
char
(
200
)
NOT
NULL
DEFAULT
''
COMMENT
'变更说明'
,
`add_time`
int
(
11
)
unsigned
NOT
NULL
DEFAULT
'0'
COMMENT
'添加时间'
,
...
...
application/plugins/wallet/service/BaseService.php
浏览文件 @
bc2b5758
...
...
@@ -14,6 +14,7 @@ use think\Db;
use
app\service\PluginsService
;
use
app\service\ResourcesService
;
use
app\service\PaymentService
;
use
app\plugins\wallet\service\WalletService
;
/**
* 基础服务层
...
...
@@ -83,7 +84,7 @@ class BaseService
}
/**
* 总数
*
充值列表
总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
...
...
@@ -105,7 +106,7 @@ class BaseService
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
Recharge
List
Where
(
$params
=
[])
public
static
function
RechargeWhere
(
$params
=
[])
{
$where
=
[];
...
...
@@ -383,5 +384,101 @@ class BaseService
}
return
DataReturn
(
'删除失败或资源不存在'
,
-
100
);
}
/**
* 钱包明细列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-04-30T00:13:14+0800
* @param [array] $params [输入参数]
*/
public
static
function
WalletLogList
(
$params
=
[])
{
$where
=
empty
(
$params
[
'where'
])
?
[]
:
$params
[
'where'
];
$m
=
isset
(
$params
[
'm'
])
?
intval
(
$params
[
'm'
])
:
0
;
$n
=
isset
(
$params
[
'n'
])
?
intval
(
$params
[
'n'
])
:
10
;
$field
=
empty
(
$params
[
'field'
])
?
'*'
:
$params
[
'field'
];
$order_by
=
empty
(
$params
[
'order_by'
])
?
'id desc'
:
$params
[
'order_by'
];
// 获取数据列表
$data
=
Db
::
name
(
'PluginsWalletLog'
)
->
field
(
$field
)
->
where
(
$where
)
->
limit
(
$m
,
$n
)
->
order
(
$order_by
)
->
select
();
if
(
!
empty
(
$data
))
{
$business_type_list
=
WalletService
::
$business_type_list
;
$operation_type_list
=
WalletService
::
$operation_type_list
;
$money_type_list
=
WalletService
::
$money_type_list
;
foreach
(
$data
as
&
$v
)
{
// 业务类型
$v
[
'business_type_text'
]
=
(
isset
(
$v
[
'business_type'
])
&&
isset
(
$business_type_list
[
$v
[
'business_type'
]]))
?
$business_type_list
[
$v
[
'business_type'
]][
'name'
]
:
'未知'
;
// 操作类型
$v
[
'operation_type_text'
]
=
(
isset
(
$v
[
'operation_type'
])
&&
isset
(
$operation_type_list
[
$v
[
'operation_type'
]]))
?
$operation_type_list
[
$v
[
'operation_type'
]][
'name'
]
:
'未知'
;
// 金额类型
$v
[
'money_type_text'
]
=
(
isset
(
$v
[
'money_type'
])
&&
isset
(
$money_type_list
[
$v
[
'money_type'
]]))
?
$money_type_list
[
$v
[
'money_type'
]][
'name'
]
:
'未知'
;
// 创建时间
$v
[
'add_time_text'
]
=
empty
(
$v
[
'add_time'
])
?
''
:
date
(
'Y-m-d H:i:s'
,
$v
[
'add_time'
]);
}
}
return
DataReturn
(
'处理成功'
,
0
,
$data
);
}
/**
* 钱包明细总数
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $where [条件]
*/
public
static
function
WalletLogTotal
(
$where
=
[])
{
return
(
int
)
Db
::
name
(
'PluginsWalletLog'
)
->
where
(
$where
)
->
count
();
}
/**
* 钱包明细条件
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-29
* @desc description
* @param [array] $params [输入参数]
*/
public
static
function
WalletLogWhere
(
$params
=
[])
{
$where
=
[];
// 用户id
if
(
!
empty
(
$params
[
'user'
]))
{
$where
[]
=
[
'user_id'
,
'='
,
$params
[
'user'
][
'id'
]];
}
// 业务类型
if
(
isset
(
$params
[
'business_type'
])
&&
$params
[
'business_type'
]
>
-
1
)
{
$where
[]
=
[
'business_type'
,
'='
,
$params
[
'business_type'
]];
}
// 操作类型
if
(
isset
(
$params
[
'operation_type'
])
&&
$params
[
'operation_type'
]
>
-
1
)
{
$where
[]
=
[
'operation_type'
,
'='
,
$params
[
'operation_type'
]];
}
// 金额类型
if
(
isset
(
$params
[
'money_type'
])
&&
$params
[
'money_type'
]
>
-
1
)
{
$where
[]
=
[
'money_type'
,
'='
,
$params
[
'money_type'
]];
}
return
$where
;
}
}
?>
\ No newline at end of file
application/plugins/wallet/service/WalletService.php
浏览文件 @
bc2b5758
...
...
@@ -31,6 +31,26 @@ class WalletService
2
=>
[
'value'
=>
2
,
'name'
=>
'已注销'
],
];
// 业务类型
public
static
$business_type_list
=
[
0
=>
[
'value'
=>
0
,
'name'
=>
'充值'
,
'checked'
=>
true
],
1
=>
[
'value'
=>
1
,
'name'
=>
'提现'
],
2
=>
[
'value'
=>
2
,
'name'
=>
'消费'
],
];
// 操作类型
public
static
$operation_type_list
=
[
0
=>
[
'value'
=>
0
,
'name'
=>
'减少'
,
'checked'
=>
true
],
1
=>
[
'value'
=>
1
,
'name'
=>
'增加'
],
];
// 金额类型
public
static
$money_type_list
=
[
0
=>
[
'value'
=>
0
,
'name'
=>
'正常'
,
'checked'
=>
true
],
1
=>
[
'value'
=>
1
,
'name'
=>
'冻结'
],
];
/**
* 用户钱包
* @author Devil
...
...
config/shopxo.sql
浏览文件 @
bc2b5758
此差异已折叠。
点击以展开。
public/static/plugins/css/wallet/index/wallet.css
浏览文件 @
bc2b5758
/**
* 列表
*/
.user-content-body
.data-list
.operation-reduce-icon
{
color
:
#f00
;
}
.user-content-body
.data-list
.operation-increase-icon
{
color
:
#0a9610
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录