添加:交易市场增加惩罚信息
This commit is contained in:
parent
e0cfed9ca1
commit
7c1c10c7b0
|
|
@ -302,6 +302,13 @@ class Futures extends BaseModel{
|
||||||
'violation_num' => Db::raw('violation_num+1'),
|
'violation_num' => Db::raw('violation_num+1'),
|
||||||
'total_violation_num' => Db::raw('total_violation_num+1'),
|
'total_violation_num' => Db::raw('total_violation_num+1'),
|
||||||
]);
|
]);
|
||||||
|
Db::name('futures_user_violation_records')
|
||||||
|
->insert([
|
||||||
|
'site_id' => $date['site_id'],
|
||||||
|
'member_id' => $date['member_id'],
|
||||||
|
'futures_id' => $id,
|
||||||
|
'created_time' => time(),
|
||||||
|
]);
|
||||||
// 判断:如果当前次数已经到达限制 进行惩罚操作
|
// 判断:如果当前次数已经到达限制 进行惩罚操作
|
||||||
$futuresUserInfo = Db::name('futures_user')
|
$futuresUserInfo = Db::name('futures_user')
|
||||||
->field('violation_num,site_id,punish_time')
|
->field('violation_num,site_id,punish_time')
|
||||||
|
|
|
||||||
|
|
@ -232,4 +232,45 @@ class User extends BaseModel{
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Common: 获取违规记录
|
||||||
|
* Author: wu-hui
|
||||||
|
* Time: 2023/03/23 13:46
|
||||||
|
* @return array
|
||||||
|
* @throws \think\db\exception\DbException
|
||||||
|
*/
|
||||||
|
public function violationRecords(){
|
||||||
|
// 参数获取
|
||||||
|
$page = input('page',1);
|
||||||
|
$pageSize = input('page_size',PAGE_LIST_ROWS);
|
||||||
|
$memberId = input('member_id');
|
||||||
|
// 条件生成
|
||||||
|
$where = [
|
||||||
|
['site_id','=',$this->site_id],
|
||||||
|
['member_id','=',$memberId]
|
||||||
|
];
|
||||||
|
// 列表获取
|
||||||
|
$field = [
|
||||||
|
'id',
|
||||||
|
'created_time'
|
||||||
|
];
|
||||||
|
$result = Db::name('futures_user_violation_records')
|
||||||
|
->field($field)
|
||||||
|
->where($where)
|
||||||
|
->order(['id'=>'DESC'])
|
||||||
|
->paginate(['list_rows' => $pageSize,'page' => $page]);
|
||||||
|
if($result) {
|
||||||
|
$result = $result->toArray();
|
||||||
|
$list = [
|
||||||
|
'count' => $result['total'],
|
||||||
|
'list' => $result['data'],
|
||||||
|
'page_count' => $result['last_page'],
|
||||||
|
];
|
||||||
|
return $this->success($list);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -50,8 +50,13 @@ class User extends BaseShop{
|
||||||
$this->assign('member_id',input('member_id',0));
|
$this->assign('member_id',input('member_id',0));
|
||||||
return $this->fetch('user/send_goods');
|
return $this->fetch('user/send_goods');
|
||||||
}
|
}
|
||||||
|
// 违规记录
|
||||||
|
public function violationRecords(){
|
||||||
|
if(request()->isAjax()) return (new userModel($this->site_id))->violationRecords();
|
||||||
|
|
||||||
|
$this->assign('member_id',input('member_id',0));
|
||||||
|
return $this->fetch('user/record');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -57,6 +57,9 @@
|
||||||
<a class="layui-btn" lay-event="sendGoods">赠送商品</a>
|
<a class="layui-btn" lay-event="sendGoods">赠送商品</a>
|
||||||
{{# } }}
|
{{# } }}
|
||||||
|
|
||||||
|
{{# if(d.total_violation_num > 0){ }}
|
||||||
|
<a class="layui-btn" lay-event="violationRecords">违规记录</a>
|
||||||
|
{{# } }}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -182,5 +185,17 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 违规记录
|
||||||
|
function violationRecords(data){
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: '违规记录',
|
||||||
|
skin: 'layer-tips-class',
|
||||||
|
area: ['80%','90%'],
|
||||||
|
content: ns.url("futures://shop/user/violationRecords", { member_id: data.member_id }),
|
||||||
|
end: function(){}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
{extend name="app/shop/view/base.html"/}
|
||||||
|
{block name="resources"}
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
{/block}
|
||||||
|
|
||||||
|
{block name="body"}
|
||||||
|
<!-- 列表 -->
|
||||||
|
<table id="listContent" lay-filter="listContent"></table>
|
||||||
|
{/block}
|
||||||
|
|
||||||
|
{block name="script"}
|
||||||
|
<script>
|
||||||
|
var _thisIndex,table, form,member_id = "{$member_id}";
|
||||||
|
$(function () {
|
||||||
|
// 基本参数
|
||||||
|
_thisIndex = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||||
|
// 表单内容
|
||||||
|
layui.use(['form'], function () {
|
||||||
|
form = layui.form;
|
||||||
|
form.render();
|
||||||
|
// 内容获取
|
||||||
|
table = new Table({
|
||||||
|
elem: '#listContent',
|
||||||
|
url: ns.url("futures://shop/user/violationRecords"),
|
||||||
|
where:{ member_id: member_id },
|
||||||
|
cols: [[
|
||||||
|
{align: 'center', field: 'id', title: 'ID', width: '5%', unresize: 'false'},
|
||||||
|
{
|
||||||
|
title: '违规时间', align: 'center', unresize: 'area', templet: function (d) {
|
||||||
|
return d.created_time > 0 ? ns.time_to_date(d.created_time) : '--';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{/block}
|
||||||
|
|
@ -345,9 +345,8 @@ class Member extends BaseShop
|
||||||
|
|
||||||
$member_model = new MemberModel();
|
$member_model = new MemberModel();
|
||||||
$member_info = $member_model->getMemberInfo([ [ 'site_id', '=', $this->site_id ], [ 'member_id', '=', $member_id ] ]);
|
$member_info = $member_model->getMemberInfo([ [ 'site_id', '=', $this->site_id ], [ 'member_id', '=', $member_id ] ]);
|
||||||
|
|
||||||
if (empty($member_info[ 'data' ])) $this->error('未获取到会员数据', addon_url('shop/member/memberlist'));
|
if (empty($member_info[ 'data' ])) $this->error('未获取到会员数据', addon_url('shop/member/memberlist'));
|
||||||
|
$member_info['data']['diamond'] = (float)model('fenxiao')->getValue([['member_id','=',$member_id]],'diamond');
|
||||||
$this->assign('member_info', $member_info);
|
$this->assign('member_info', $member_info);
|
||||||
|
|
||||||
//会员等级
|
//会员等级
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,10 @@
|
||||||
<span id="member_growth">{$member_info.data.growth}</span>
|
<span id="member_growth">{$member_info.data.growth}</span>
|
||||||
<i class="layui-icon text-color" style="margin-left: 5px;" data-num="{$member_info.data.growth}" onclick="saveGrowth(this)"> </i>
|
<i class="layui-icon text-color" style="margin-left: 5px;" data-num="{$member_info.data.growth}" onclick="saveGrowth(this)"> </i>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="data-item">
|
||||||
|
<span>钻石:</span>
|
||||||
|
<span>{:moneyFormat($member_info.data.diamond)}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue