修改bug

This commit is contained in:
2020-08-24 08:35:19 +08:00
parent 0230bb0144
commit da9d0d258f
2 changed files with 334 additions and 334 deletions

View File

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

View File

@@ -30,8 +30,8 @@ class Verification extends PingAnInit
//查询卡券信息
$this->query_coupon = (new Query)->setOutletId($this->outletId)
->setCode($this->redemptionCode)
->start();
->setCode($this->redemptionCode)
->start();
if (is_string($this->query_coupon)) {
return $this->query_coupon;
}