mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-02 20:10:30 +08:00
钱包管理
This commit is contained in:
parent
1b008a1e44
commit
4fd692e3c2
@ -5,7 +5,7 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
{{if !isset($params['is_admin_index']) or $params['is_admin_index'] neq 1}}
|
{{if !isset($params['is_admin_index']) or $params['is_admin_index'] neq 1}}
|
||||||
<legend>
|
<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>
|
<a href="{{:PluginsAdminUrl('wallet', 'admin', 'index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> 返回</a>
|
||||||
</legend>
|
</legend>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -14,7 +14,15 @@
|
|||||||
<!-- form start -->
|
<!-- form start -->
|
||||||
<form class="am-form form-search" action="{{:PluginsAdminUrl('wallet', 'walletadmin', 'index')}}" method="POST">
|
<form class="am-form form-search" action="{{:PluginsAdminUrl('wallet', 'walletadmin', 'index')}}" method="POST">
|
||||||
<div class="am-g form-keyword">
|
<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>
|
<button class="am-btn am-btn-secondary am-radius am-btn-sm" type="submit">查询</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -36,35 +44,13 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{{if !empty($data_list)}}
|
{{if !empty($data_list)}}
|
||||||
{{foreach $data_list as $v}}
|
{{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}}>
|
<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.name}}</td>
|
<td>{{$v.id}}</td>
|
||||||
<td {{if !empty($v['bg_color'])}}style="background-color:{{$v.bg_color}};"{{/if}}>
|
<td>{{$v.normal_money}}</td>
|
||||||
{{if !empty($v['images_url'])}}
|
<td>{{$v.frozen_money}}</td>
|
||||||
<a href="{{$v['images_url']}}" target="_blank">
|
<td>{{$v.give_money}}</td>
|
||||||
<img src="{{$v['images_url']}}" class="am-radius" width="100" />
|
<td>{{$v.status_text}}</td>
|
||||||
</a>
|
<td class="am-hide-sm-only">{{$v.add_time_text}}</td>
|
||||||
{{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>
|
|
||||||
{{if !isset($params['is_admin_index']) or $params['is_admin_index'] neq 1}}
|
{{if !isset($params['is_admin_index']) or $params['is_admin_index'] neq 1}}
|
||||||
<td class="view-operation">
|
<td class="view-operation">
|
||||||
<a href="{{:PluginsAdminUrl('wallet', 'level', 'saveinfo', ['id'=>$v['id']])}}">
|
<a href="{{:PluginsAdminUrl('wallet', 'level', 'saveinfo', ['id'=>$v['id']])}}">
|
||||||
@ -81,6 +67,11 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<!-- list end -->
|
<!-- list end -->
|
||||||
|
|
||||||
|
<!-- 分页 -->
|
||||||
|
{{if !empty($data_list)}}
|
||||||
|
{{$page_html|raw}}
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
namespace app\plugins\wallet;
|
namespace app\plugins\wallet;
|
||||||
|
|
||||||
use think\Controller;
|
use think\Controller;
|
||||||
use app\plugins\wallet\service\BaseService;
|
use app\plugins\wallet\service\WalletService;
|
||||||
use app\service\PluginsService;
|
use app\service\PluginsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,14 +33,41 @@ class Walletadmin extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index($params = [])
|
public function index($params = [])
|
||||||
{
|
{
|
||||||
$ret = PluginsService::PluginsData('wallet', '', false);
|
// 分页
|
||||||
if($ret['code'] == 0)
|
$number = MyC('admin_page_number', 10, true);
|
||||||
{
|
|
||||||
$this->assign('data', $ret['data']);
|
// 条件
|
||||||
return $this->fetch('../../../plugins/view/wallet/walletadmin/index');
|
$where = WalletService::WalletWhere($params);
|
||||||
} else {
|
|
||||||
return $ret['msg'];
|
// 获取总数
|
||||||
}
|
$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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -480,5 +480,6 @@ class BaseService
|
|||||||
|
|
||||||
return $where;
|
return $where;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -49,7 +49,85 @@ class WalletService
|
|||||||
0 => ['value' => 0, 'name' => '正常', 'checked' => true],
|
0 => ['value' => 0, 'name' => '正常', 'checked' => true],
|
||||||
1 => ['value' => 1, 'name' => '冻结'],
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户钱包
|
* 用户钱包
|
||||||
|
@ -405,7 +405,6 @@ ul {margin-top:0;}
|
|||||||
.admin {width:100%;height:100%;display:flex;display:-webkit-flex;padding-top:35px;background:#fff;}
|
.admin {width:100%;height:100%;display:flex;display:-webkit-flex;padding-top:35px;background:#fff;}
|
||||||
.admin .am-g {padding-left:0;padding-right:0;}
|
.admin .am-g {padding-left:0;padding-right:0;}
|
||||||
/*---right Content---*/
|
/*---right Content---*/
|
||||||
.content-right {overflow:auto;flex:1;-webkit-flex:1;}
|
|
||||||
.content-right .content {padding:10px 10px 0 10px;}
|
.content-right .content {padding:10px 10px 0 10px;}
|
||||||
.admin-sidebar-list li a {padding:0.6rem;}
|
.admin-sidebar-list li a {padding:0.6rem;}
|
||||||
.common-left-menu a:hover { background:rgba(118, 119, 120, 0.1); }
|
.common-left-menu a:hover { background:rgba(118, 119, 120, 0.1); }
|
||||||
|
@ -3,11 +3,18 @@
|
|||||||
}
|
}
|
||||||
@media only screen and (min-width: 641px) {
|
@media only screen and (min-width: 641px) {
|
||||||
.form-search .form-keyword input {
|
.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) {
|
@media only screen and (max-width: 641px) {
|
||||||
.form-search .form-keyword input {
|
.form-search .form-search-items {
|
||||||
width: calc(100% - 54px);
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user