修改bug
This commit is contained in:
@@ -36,12 +36,12 @@ class IndexController extends AdminController
|
|||||||
]);
|
]);
|
||||||
$filter->between('created_at', '核销时间')->datetime();
|
$filter->between('created_at', '核销时间')->datetime();
|
||||||
$users = User::query()
|
$users = User::query()
|
||||||
->whereHas('identity', function ($query) {
|
->whereHas('identity', function ($query) {
|
||||||
$query->where('identity_id', 1);
|
$query->where('identity_id', 1);
|
||||||
})
|
})
|
||||||
->where('type', 'pingan')
|
->where('type', 'pingan')
|
||||||
->get()
|
->get()
|
||||||
->pluck('nickname', 'id');
|
->pluck('nickname', 'id');
|
||||||
$filter->equal('user_id', '渠道')->select($users);
|
$filter->equal('user_id', '渠道')->select($users);
|
||||||
$filter->equal('thirdPartyGoodsId', '优惠政策')->select(ActivityRule::pluck('title', 'code'));
|
$filter->equal('thirdPartyGoodsId', '优惠政策')->select(ActivityRule::pluck('title', 'code'));
|
||||||
});
|
});
|
||||||
@@ -64,11 +64,11 @@ class IndexController extends AdminController
|
|||||||
return $this->user->nickname;
|
return $this->user->nickname;
|
||||||
});
|
});
|
||||||
$grid->column('type', '类型')
|
$grid->column('type', '类型')
|
||||||
->using(Coupon::TYPES)
|
->using(Coupon::TYPES)
|
||||||
->label([
|
->label([
|
||||||
'1' => 'info',
|
'1' => 'info',
|
||||||
'2' => 'success',
|
'2' => 'success',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$grid->column('网点名称/编号')->display(function () {
|
$grid->column('网点名称/编号')->display(function () {
|
||||||
return $this->outlet ? $this->outlet->nickname : $this->outletId;
|
return $this->outlet ? $this->outlet->nickname : $this->outletId;
|
||||||
@@ -118,13 +118,13 @@ class IndexController extends AdminController
|
|||||||
$pass = collect($pass);
|
$pass = collect($pass);
|
||||||
|
|
||||||
return '<label class="label label-success">全部:' . $all->count() . '张</label> '
|
return '<label class="label label-success">全部:' . $all->count() . '张</label> '
|
||||||
. '<label class="label label-success">成功:' . $pass->count() . '张</label> '
|
. '<label class="label label-success">成功:' . $pass->count() . '张</label> '
|
||||||
. '<label class="label label-success">失败:' . $all->where('status', 3)
|
. '<label class="label label-success">失败:' . $all->where('status', 3)
|
||||||
->count() . '张</label> '
|
->count() . '张</label> '
|
||||||
. '<label class="label label-success">核销金额:' . $pass->sum('price') . '元</label> '
|
. '<label class="label label-success">核销金额:' . $pass->sum('price') . '元</label> '
|
||||||
. '<label class="label label-success">资金通道结算:' . $pass->sum('profit') . '元</label> '
|
. '<label class="label label-success">资金通道结算:' . $pass->sum('profit') . '元</label> '
|
||||||
. '<label class="label label-success">打款金额:' . $pass->where('is_profit', 1)
|
. '<label class="label label-success">打款金额:' . $pass->where('is_profit', 1)
|
||||||
->sum('profit') . '元</label> ';
|
->sum('profit') . '元</label> ';
|
||||||
});
|
});
|
||||||
$grid->disableExport(false);
|
$grid->disableExport(false);
|
||||||
|
|
||||||
@@ -162,30 +162,30 @@ class IndexController extends AdminController
|
|||||||
$form->decimal('recommend', '推荐人佣金')->required()->default(0);
|
$form->decimal('recommend', '推荐人佣金')->required()->default(0);
|
||||||
$form->number('hots', '热度/亲密度')->required()->default('1');
|
$form->number('hots', '热度/亲密度')->required()->default('1');
|
||||||
$form->text('times', '显示时间')
|
$form->text('times', '显示时间')
|
||||||
->default('200')
|
->default('200')
|
||||||
->required()
|
->required()
|
||||||
->help('礼物显示时间,毫秒');
|
->help('礼物显示时间,毫秒');
|
||||||
|
|
||||||
$form->textarea('description', '礼物说明');
|
$form->textarea('description', '礼物说明');
|
||||||
|
|
||||||
$form->image('cover', '封面')
|
$form->image('cover', '封面')
|
||||||
->rules(function ($form) {
|
->rules(function ($form) {
|
||||||
if ($form->model()->cover != '') {
|
if ($form->model()->cover != '') {
|
||||||
return 'nullable|image';
|
return 'nullable|image';
|
||||||
} else {
|
} else {
|
||||||
return 'required';
|
return 'required';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->move('images/' . date('Y/m/d'))
|
->move('images/' . date('Y/m/d'))
|
||||||
->removable()
|
->removable()
|
||||||
->uniqueName();
|
->uniqueName();
|
||||||
|
|
||||||
$form->switch('status', '状态')->default(1);
|
$form->switch('status', '状态')->default(1);
|
||||||
$form->decimal('sort', '排序')->default(0)->help('序号越大越靠前');
|
$form->decimal('sort', '排序')->default(0)->help('序号越大越靠前');
|
||||||
|
|
||||||
$form->saving(function ($form) {
|
$form->saving(function ($form) {
|
||||||
$sum = (int) $form->pv + (int) $form->bonus + (int) $form->recommend;
|
$sum = (int)$form->pv + (int)$form->bonus + (int)$form->recommend;
|
||||||
if ((int) $sum > $form->price) {
|
if ((int)$sum > $form->price) {
|
||||||
admin_warning('配置错误', 'PV+佣金+推荐人佣金不能超过礼物价值');
|
admin_warning('配置错误', 'PV+佣金+推荐人佣金不能超过礼物价值');
|
||||||
throw new \Exception('配置错误,PV+佣金+推荐人佣金不能超过礼物价值');
|
throw new \Exception('配置错误,PV+佣金+推荐人佣金不能超过礼物价值');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ class Verification extends PingAnInit
|
|||||||
|
|
||||||
//查询卡券信息
|
//查询卡券信息
|
||||||
$this->query_coupon = (new Query)->setOutletId($this->outletId)
|
$this->query_coupon = (new Query)->setOutletId($this->outletId)
|
||||||
->setCode($this->redemptionCode)
|
->setCode($this->redemptionCode)
|
||||||
->start();
|
->start();
|
||||||
if (is_string($this->query_coupon)) {
|
if (is_string($this->query_coupon)) {
|
||||||
return $this->query_coupon;
|
return $this->query_coupon;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user