Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
______--______
ShopXO
提交
4fd692e3
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,发现更多精彩内容 >>
提交
4fd692e3
编写于
5月 05, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
钱包管理
上级
1b008a1e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
148 addition
and
45 deletion
+148
-45
application/plugins/view/wallet/walletadmin/index.html
application/plugins/view/wallet/walletadmin/index.html
+22
-31
application/plugins/wallet/Walletadmin.php
application/plugins/wallet/Walletadmin.php
+36
-9
application/plugins/wallet/service/BaseService.php
application/plugins/wallet/service/BaseService.php
+1
-0
application/plugins/wallet/service/WalletService.php
application/plugins/wallet/service/WalletService.php
+79
-1
public/static/admin/default/css/common.css
public/static/admin/default/css/common.css
+0
-1
public/static/plugins/css/wallet/admin/walletadmin.css
public/static/plugins/css/wallet/admin/walletadmin.css
+10
-3
未找到文件。
application/plugins/view/wallet/walletadmin/index.html
浏览文件 @
4fd692e3
...
...
@@ -5,7 +5,7 @@
<div
class=
"content"
>
{{if !isset($params['is_admin_index']) or $params['is_admin_index'] neq 1}}
<legend>
<span
class=
"fs-16"
>
钱包
插件
</span>
<span
class=
"fs-16"
>
钱包
</span>
<a
href=
"{{:PluginsAdminUrl('wallet', 'admin', 'index')}}"
class=
"fr fs-14 m-t-5 am-icon-mail-reply"
>
返回
</a>
</legend>
{{/if}}
...
...
@@ -14,7 +14,15 @@
<!-- form start -->
<form
class=
"am-form form-search"
action=
"{{:PluginsAdminUrl('wallet', 'walletadmin', 'index')}}"
method=
"POST"
>
<div
class=
"am-g form-keyword"
>
<input
type=
"text"
class=
"am-form-field am-radius"
name=
"keywords"
placeholder=
"用户名/电话/邮箱"
{{
if
!
empty
($
params
['
keywords
'])}}
value=
"{{$params.keywords}}"
{{/
if
}}
/>
<input
type=
"text"
class=
"am-form-field am-radius form-search-items"
name=
"keywords"
placeholder=
"用户名/电话/邮箱"
{{
if
!
empty
($
params
['
keywords
'])}}
value=
"{{$params.keywords}}"
{{/
if
}}
/>
<select
name=
"status"
class=
"chosen-select form-search-items"
data-placeholder=
"状态..."
>
<option
value=
"-1"
>
状态...
</option>
{{if !empty($wallet_status_list)}}
{{foreach $wallet_status_list as $v}}
<option
value=
"{{$v.value}}"
{{
if
isset
($
params
['
status
'])
and
$
params
['
status
']
eq
$
v
['
value
']}}
selected
{{/
if
}}
>
{{$v.name}}
</option>
{{/foreach}}
{{/if}}
</select>
<button
class=
"am-btn am-btn-secondary am-radius am-btn-sm"
type=
"submit"
>
查询
</button>
</div>
</form>
...
...
@@ -36,35 +44,13 @@
<tbody>
{{if !empty($data_list)}}
{{foreach $data_list as $v}}
<tr
id=
"data-list-{{$v.id}}"
{{
if
isset
($
v
['
is_enable
'])
and
$
v
['
is_enable
']
eq
0}}
class=
"am-active"
{{/
if
}}
>
<td>
{{$v.name}}
</td>
<td
{{
if
!
empty
($
v
['
bg_color
'])}}
style=
"background-color:{{$v.bg_color}};"
{{/
if
}}
>
{{if !empty($v['images_url'])}}
<a
href=
"{{$v['images_url']}}"
target=
"_blank"
>
<img
src=
"{{$v['images_url']}}"
class=
"am-radius"
width=
"100"
/>
</a>
{{else /}}
<span
class=
"cr-ccc"
>
暂无图片
</span>
{{/if}}
</td>
<td>
{{$v.rules_min}}~{{$v.rules_max}}
</td>
<td>
满减:{{if $v['order_price'] gt 0 and $v['full_reduction_price'] gt 0}}
满{{$v.order_price}}元 减{{$v.full_reduction_price}}元
{{else /}}
<span
class=
"cr-ccc"
>
无满减
</span>
{{/if}}
<br
/>
折扣:{{if $v['discount_rate']}}
{{$v.discount_rate}}折
{{else /}}
<span
class=
"cr-ccc"
>
无折扣
</span>
{{/if}}
</td>
<td
class=
"am-hide-sm-only"
>
<a
href=
"javascript:;"
class=
"am-icon-btn am-icon-check submit-state {{if isset($v['is_enable']) and $v['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}"
data-url=
"{{:PluginsAdminUrl('wallet', 'level', 'statusupdate')}}"
data-id=
"{{$v.id}}"
data-state=
"{{if isset($v['is_enable'])}}{{$v['is_enable']}}{{/if}}"
data-field=
"is_enable"
data-is-update-status=
"1"
></a>
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.operation_time_time}}
</td>
<tr
id=
"data-list-{{$v.id}}"
{{
if
isset
($
v
['
status
'])
and
$
v
['
status
']
neq
0}}{{
if
$
v
['
status
']
eq
1}}
class=
"am-danger"
{{
elseif
$
v
['
status
']
eq
2}}
class=
"am-active"
{{
else
/}}
class=
"am-warning"
{{/
if
}}{{/
if
}}
>
<td>
{{$v.id}}
</td>
<td>
{{$v.normal_money}}
</td>
<td>
{{$v.frozen_money}}
</td>
<td>
{{$v.give_money}}
</td>
<td>
{{$v.status_text}}
</td>
<td
class=
"am-hide-sm-only"
>
{{$v.add_time_text}}
</td>
{{if !isset($params['is_admin_index']) or $params['is_admin_index'] neq 1}}
<td
class=
"view-operation"
>
<a
href=
"{{:PluginsAdminUrl('wallet', 'level', 'saveinfo', ['id'=>$v['id']])}}"
>
...
...
@@ -81,6 +67,11 @@
</tbody>
</table>
<!-- list end -->
<!-- 分页 -->
{{if !empty($data_list)}}
{{$page_html|raw}}
{{/if}}
</div>
</div>
</div>
...
...
application/plugins/wallet/Walletadmin.php
浏览文件 @
4fd692e3
...
...
@@ -11,7 +11,7 @@
namespace
app\plugins\wallet
;
use
think\Controller
;
use
app\plugins\wallet\service\
Base
Service
;
use
app\plugins\wallet\service\
Wallet
Service
;
use
app\service\PluginsService
;
/**
...
...
@@ -33,14 +33,41 @@ class Walletadmin extends Controller
*/
public
function
index
(
$params
=
[])
{
$ret
=
PluginsService
::
PluginsData
(
'wallet'
,
''
,
false
);
if
(
$ret
[
'code'
]
==
0
)
{
$this
->
assign
(
'data'
,
$ret
[
'data'
]);
return
$this
->
fetch
(
'../../../plugins/view/wallet/walletadmin/index'
);
}
else
{
return
$ret
[
'msg'
];
}
// 分页
$number
=
MyC
(
'admin_page_number'
,
10
,
true
);
// 条件
$where
=
WalletService
::
WalletWhere
(
$params
);
// 获取总数
$total
=
WalletService
::
WalletTotal
(
$where
);
// 分页
$page_params
=
array
(
'number'
=>
$number
,
'total'
=>
$total
,
'where'
=>
$params
,
'page'
=>
isset
(
$params
[
'page'
])
?
intval
(
$params
[
'page'
])
:
1
,
'url'
=>
PluginsHomeUrl
(
'wallet'
,
'wallet'
,
'index'
),
);
$page
=
new
\
base\Page
(
$page_params
);
$this
->
assign
(
'page_html'
,
$page
->
GetPageHtml
());
// 获取列表
$data_params
=
array
(
'm'
=>
$page
->
GetPageStarNumber
(),
'n'
=>
$number
,
'where'
=>
$where
,
);
$data
=
WalletService
::
WalletList
(
$data_params
);
$this
->
assign
(
'data_list'
,
$data
[
'data'
]);
// 静态数据
$this
->
assign
(
'wallet_status_list'
,
WalletService
::
$wallet_status_list
);
// 参数
$this
->
assign
(
'params'
,
$params
);
return
$this
->
fetch
(
'../../../plugins/view/wallet/walletadmin/index'
);
}
}
?>
\ No newline at end of file
application/plugins/wallet/service/BaseService.php
浏览文件 @
4fd692e3
...
...
@@ -480,5 +480,6 @@ class BaseService
return
$where
;
}
}
?>
\ No newline at end of file
application/plugins/wallet/service/WalletService.php
浏览文件 @
4fd692e3
...
...
@@ -49,7 +49,85 @@ class WalletService
0
=>
[
'value'
=>
0
,
'name'
=>
'正常'
,
'checked'
=>
true
],
1
=>
[
'value'
=>
1
,
'name'
=>
'冻结'
],
];
/**
* 钱包列表
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-04-30T00:13:14+0800
* @param [array] $params [输入参数]
*/
public
static
function
WalletList
(
$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
(
'PluginsWallet'
)
->
field
(
$field
)
->
where
(
$where
)
->
limit
(
$m
,
$n
)
->
order
(
$order_by
)
->
select
();
if
(
!
empty
(
$data
))
{
$wallet_status_list
=
WalletService
::
$wallet_status_list
;
foreach
(
$data
as
&
$v
)
{
// 状态
$v
[
'status_text'
]
=
(
isset
(
$v
[
'status'
])
&&
isset
(
$wallet_status_list
[
$v
[
'status'
]]))
?
$wallet_status_list
[
$v
[
'status'
]][
'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
WalletTotal
(
$where
=
[])
{
return
(
int
)
Db
::
name
(
'PluginsWallet'
)
->
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
WalletWhere
(
$params
=
[])
{
$where
=
[];
// 用户
if
(
!
empty
(
$params
[
'keywords'
]))
{
$user_ids
=
Db
::
name
(
'User'
)
->
where
(
'username|mobile|email'
,
'like'
,
'%'
.
$params
[
'keywords'
]
.
'%'
)
->
column
(
'id'
);
if
(
!
empty
(
$user_ids
))
{
$where
[]
=
[
'user_id'
,
'in'
,
$user_ids
];
}
}
// 状态
if
(
isset
(
$params
[
'status'
])
&&
$params
[
'status'
]
>
-
1
)
{
$where
[]
=
[
'status'
,
'='
,
$params
[
'status'
]];
}
return
$where
;
}
/**
* 用户钱包
...
...
public/static/admin/default/css/common.css
浏览文件 @
4fd692e3
...
...
@@ -405,7 +405,6 @@ ul {margin-top:0;}
.admin
{
width
:
100%
;
height
:
100%
;
display
:
flex
;
display
:
-webkit-flex
;
padding-top
:
35px
;
background
:
#fff
;}
.admin
.am-g
{
padding-left
:
0
;
padding-right
:
0
;}
/*---right Content---*/
.content-right
{
overflow
:
auto
;
flex
:
1
;
-webkit-flex
:
1
;}
.content-right
.content
{
padding
:
10px
10px
0
10px
;}
.admin-sidebar-list
li
a
{
padding
:
0.6rem
;}
.common-left-menu
a
:hover
{
background
:
rgba
(
118
,
119
,
120
,
0.1
);
}
...
...
public/static/plugins/css/wallet/admin/walletadmin.css
浏览文件 @
4fd692e3
...
...
@@ -3,11 +3,18 @@
}
@media
only
screen
and
(
min-width
:
641px
)
{
.form-search
.form-keyword
input
{
width
:
50%
;
width
:
260px
;
}
.form-search
.chosen-container
,
.form-search
select
{
width
:
150px
!important
;
display
:
-webkit-inline-box
;
}
.form-search
.chosen-container-single
.chosen-single
{
width
:
100%
;
}
}
@media
only
screen
and
(
max-width
:
641px
)
{
.form-search
.form-
keyword
input
{
width
:
calc
(
100%
-
54px
)
;
.form-search
.form-
search-items
{
margin-bottom
:
10px
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录