setter
parent
671fdaaf95
commit
049a98a0a9
|
@ -607,23 +607,22 @@ class Coupon extends Base
|
|||
//付款成功才提交!!!!!伪装成功
|
||||
if( isset($result['payment_no']) ){
|
||||
$redpackData['pay_time'] = date("Y-m-d H:i:s",$time);
|
||||
|
||||
Redpack::create($redpackData);
|
||||
Db::commit();
|
||||
return $this->json(
|
||||
0,
|
||||
"优惠券签到使用成功,您获得{$consumerMoney}元红包,已存入您的零钱",
|
||||
[
|
||||
"redpack" =>$consumerMoney
|
||||
"redpack" =>$consumerMoney,
|
||||
"user_coupon_id" =>$couponId,
|
||||
]);
|
||||
}
|
||||
//否则失败 记录失败原因
|
||||
Log::info("企业发起付款失败:" . json_encode($result,JSON_UNESCAPED_UNICODE));
|
||||
|
||||
|
||||
//默认回滚
|
||||
Db::rollback();
|
||||
|
||||
//失败也要写入红包记录
|
||||
Redpack::create($redpackData);
|
||||
|
||||
return $this->json(5003, "验证失败,发放红包失败");
|
||||
}
|
||||
Db::commit();
|
||||
|
|
|
@ -37,9 +37,7 @@ class Consumer extends Base
|
|||
if (!empty($keyword)) {
|
||||
$whereMap[] = ['nick_name', 'like', "%$keyword%"];
|
||||
}
|
||||
$list = $repo->findList($whereMap, [], $page, $size, function ($q) {
|
||||
return $q->with("tag");
|
||||
}, $orders);
|
||||
$list = $repo->findList($whereMap, [], $page, $size, null, $orders);
|
||||
$list["list"]->each(function ($item) {
|
||||
//优惠券领取总数
|
||||
$item->coupon_total_count = Coupon::where(["consumer_code" => $item->user_code])->count("id");
|
||||
|
|
|
@ -58,7 +58,7 @@ class BillRepository extends Repository
|
|||
->when(!empty($endTime), function ($q) use ($endTime) {
|
||||
$q->whereTime("a.create_time", "<=", $endTime);
|
||||
})
|
||||
->field("a.*,b.business_name,c.nick_name,c.avatar_url,d.name as coupon_main_name,d.deduction_money");
|
||||
->field("a.*,a.coupon_id as user_coupon_id,b.business_name,c.nick_name,c.avatar_url,d.name as coupon_main_name,d.deduction_money");
|
||||
|
||||
$failData ['total'] = $rep->count();
|
||||
$failData ['list'] = $rep
|
||||
|
@ -198,6 +198,7 @@ class BillRepository extends Repository
|
|||
"a.money",
|
||||
"a.balance",
|
||||
"a.create_time",
|
||||
"a.coupon_id as user_coupon_id",
|
||||
"b.nick_name",
|
||||
"b.avatar_url",
|
||||
"e.name as coupon_main_name",
|
||||
|
|
|
@ -42,11 +42,11 @@ class CouponRepository extends Repository
|
|||
return Coupon::findList(["coupon_id" => $id], ["*"], $page, $size, function ($q) use ($keyword) {
|
||||
if (!empty($keyword)) {
|
||||
return $q::hasWhere('account', function ($q) use ($keyword) {
|
||||
$q->where('nick_name', 'like', "%" . $keyword . "%")->field("nick_name,avatar_url,user_code");
|
||||
$q->where('nick_name', 'like', "%" . $keyword . "%")->field("nick_name,avatar_url,user_code,mobile");
|
||||
});
|
||||
} else {
|
||||
return $q->with(["account" => function ($query) {
|
||||
$query->field("nick_name,avatar_url,user_code");
|
||||
$query->field("nick_name,avatar_url,user_code,mobile");
|
||||
}]);
|
||||
}
|
||||
}, ["id" => "desc"]);
|
||||
|
|
|
@ -12,7 +12,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect',"laydate"]
|
|||
if ($('.location-index-page').length > 0) {
|
||||
miniTab.listen();
|
||||
var exportDataTitle=
|
||||
["用户昵称","商家昵称","优惠券名称","持有比例(渠道商:平台:消费者)","金额","时间"]
|
||||
["用户昵称","核销编码","商家昵称","优惠券名称","持有比例(渠道商:平台:消费者)","金额","时间"]
|
||||
;
|
||||
var exportData =[];
|
||||
// 渲染表格
|
||||
|
@ -49,6 +49,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect',"laydate"]
|
|||
cols: [[
|
||||
{type: 'checkbox'},
|
||||
{field: "nick_name",title: '用户昵称'},
|
||||
{field: "user_coupon_id",title: '核销编码'},
|
||||
{field: "business_name", title: '商家名称'},
|
||||
{field: "coupon_main_name", title: '优惠券名称'},
|
||||
{templet:"#row-commission", title: '持有比例(渠道商:平台:消费者)'},
|
||||
|
@ -62,6 +63,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect',"laydate"]
|
|||
res.data.forEach(function (d,index) {
|
||||
rdata[index] = [
|
||||
d.nick_name ,
|
||||
d.user_coupon_id ,
|
||||
d.business_name ,
|
||||
d.coupon_main_name ,
|
||||
("比例:"+d.commission_agency +":"+ d.commission_admin+ ":"+ d.commission_consumer +
|
||||
|
|
|
@ -13,7 +13,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect',"laydate"]
|
|||
miniTab.listen();
|
||||
var exportDataTitle=
|
||||
[
|
||||
"消费者昵称","扣款优惠券名称",
|
||||
"消费者昵称","核销编码","扣款优惠券名称",
|
||||
"所属商家名称","商家所属平台商",
|
||||
"扣款总额","当前余额",
|
||||
"消费者红包","平台商佣金",
|
||||
|
@ -57,6 +57,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect',"laydate"]
|
|||
cols: [[
|
||||
{type: 'checkbox'},
|
||||
{ field:"nick_name",title: '消费者昵称'},
|
||||
{ field:"user_coupon_id",title: '核销编码'},
|
||||
{templet: "#row-avatar_url",field:"avatar_url",title: '消费者头像'},
|
||||
{field:"coupon_main_name",title: '扣款优惠券名称'},
|
||||
|
||||
|
@ -79,6 +80,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect',"laydate"]
|
|||
res.data.forEach(function (d,index) {
|
||||
rdata[index] = [
|
||||
d.nick_name ,
|
||||
d.user_coupon_id ,
|
||||
d.coupon_main_name ,
|
||||
d.business_name ,
|
||||
d.agency_business_name ,
|
||||
|
|
|
@ -43,7 +43,8 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function
|
|||
{field: 'id' , width: 80, title: 'ID'},
|
||||
{templet: '#row-cover', title: '头像', style: 'height: 90px;'},
|
||||
{field: 'nick_name', title: '昵称'},
|
||||
{templet: '#row-gender', title: '性别'},
|
||||
//{templet: '#row-gender', title: '性别'},
|
||||
{field: 'mobile', title: '授权手机号'},
|
||||
{field: 'coupon_total_count', title: '优惠券领取数'},
|
||||
{field: 'coupon_used_count', title: '优惠券使用数'},
|
||||
{field: 'coupon_not_use_count', title: '优惠券未使用数'},
|
||||
|
@ -51,13 +52,13 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function
|
|||
{field: 'login_time', title: '最近登录'},
|
||||
|
||||
|
||||
{templet:function(d){
|
||||
if( d.tag != undefined && d.tag.name != null){
|
||||
return d.tag.name
|
||||
}
|
||||
return '';
|
||||
},title: '用户标签'},
|
||||
{templet: '#row-operate', minWidth: 350, field: 'right', align: 'center', title: '操作', }
|
||||
// {templet:function(d){
|
||||
// if( d.tag != undefined && d.tag.name != null){
|
||||
// return d.tag.name
|
||||
// }
|
||||
// return '';
|
||||
// },title: '用户标签'},
|
||||
{templet: '#row-operate', align: 'center', title: '操作', }
|
||||
]],
|
||||
done: function () {
|
||||
Tools.setInsTb(insTb);
|
||||
|
|
|
@ -44,8 +44,14 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function
|
|||
}
|
||||
return d.consumer_name;
|
||||
}, title: '昵称'},
|
||||
|
||||
{templet:function(d){
|
||||
if(d.account!=undefined&&d.account){
|
||||
return d.account.mobile;
|
||||
}
|
||||
return '';
|
||||
}, title: '授权手机号'},
|
||||
{field: 'received_time', title: '领取时间'},
|
||||
{templet: '#row-received_map', title: '领取位置'},
|
||||
|
||||
|
||||
{templet: '#row-state', title: '状态'},
|
||||
|
|
|
@ -149,9 +149,9 @@
|
|||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">白名单</label>
|
||||
<div class="layui-input-inline " style="width: 450px">
|
||||
<textarea name="item[white_list]" class="layui-textarea"></textarea>
|
||||
<textarea name="item[white_list]" rows="20" placeholder="1800000000-张三" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">填写后只有白名单能领取 一排填写一个 如:手机号-姓名</div>
|
||||
<div class="layui-form-mid layui-word-aux">填写后只有白名单能领取 一排填写一个 如:手机号-姓名 或者安格式粘贴到输入框中</div>
|
||||
</div>
|
||||
|
||||
<!-- <fieldset class="layui-elem-field layui-field-title site-title layui-hide">-->
|
||||
|
|
|
@ -150,13 +150,11 @@
|
|||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">白名单</label>
|
||||
<div class="layui-input-inline " style="width: 450px">
|
||||
<textarea name="item[white_list]" class="layui-textarea">{$item['white_list']}</textarea>
|
||||
<textarea name="item[white_list]" rows="20" class="layui-textarea">{$item['white_list']}</textarea>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">填写后只有白名单能领取 一排填写一个 如:手机号-姓名</div>
|
||||
<div class="layui-form-mid layui-word-aux">填写后只有白名单能领取 一排填写一个 如:手机号-姓名 或者安格式粘贴到输入框中</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <fieldset class="layui-elem-field layui-field-title site-title layui-hide">-->
|
||||
<!-- <fieldset class="layui-elem-field layui-field-title site-title layui-hide">-->
|
||||
<!-- <legend><a >处罚规则</a></legend>-->
|
||||
<!-- </fieldset>-->
|
||||
|
||||
|
|
|
@ -143,15 +143,15 @@
|
|||
</script>
|
||||
|
||||
|
||||
<!-- 领取位置 -->
|
||||
<script type="text/html" id="row-received_map">
|
||||
<a href="" target="_blank">点击查看</a>
|
||||
</script>
|
||||
<!-- 签到位置 -->
|
||||
<script type="text/html" id="row-sign_map">
|
||||
<a href="" target="_blank">点击查看</a>
|
||||
</script>
|
||||
|
||||
<!-- 领取位置 -->
|
||||
<script type="text/html" id="row-received_map">
|
||||
<a onclick="getAddress({{d.lat}},{{d.lng}},this)" target="_blank">点击查看</a>
|
||||
</script>
|
||||
<!-- toolbar -->
|
||||
<script type="text/html" id="toolbar-tpl">
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm" data-table-refresh lay-event="refresh"><i class="fa fa-refresh"></i></a>
|
||||
|
@ -164,4 +164,6 @@
|
|||
</div>
|
||||
</script>
|
||||
|
||||
<script src="__MANAGER__/js/coupon/info.js?v={:mt_rand()}"></script>
|
||||
<script src="__MANAGER__/js/coupon/info.js?v={:mt_rand()}"></script>
|
||||
<script src="__STATIC__/js/jquery-3.3.1.js?v={:mt_rand()}"></script>
|
||||
<script src="__MANAGER__/js/get_addredss.js?v={:mt_rand()}"></script>
|
Loading…
Reference in New Issue