微调
This commit is contained in:
@@ -13,7 +13,7 @@ class CouponController extends AdminController
|
||||
|
||||
protected $title = '卡券列表管理';
|
||||
|
||||
protected function grid()
|
||||
protected function grid(): Grid
|
||||
{
|
||||
$grid = new Grid(new ActivityCoupon);
|
||||
$grid->model()->with(['outlet'])->latest();
|
||||
@@ -25,9 +25,6 @@ class CouponController extends AdminController
|
||||
$filter->equal('status', '状态')->select(ActivityCoupon::STATUS);
|
||||
$filter->between('used_at', '核销时间')->datetime();
|
||||
|
||||
$users = User::whereHas('identity', function ($query) {
|
||||
$query->where('identity_id', 1);
|
||||
})->get()->pluck('nickname', 'id');
|
||||
|
||||
$filter->where(function ($query) {
|
||||
$query->whereHas('outlet', function ($query) {
|
||||
@@ -52,12 +49,12 @@ class CouponController extends AdminController
|
||||
}, '优惠政策', 'rule_code')->select(ActivityRule::where('status', 1)->pluck('title', 'code'));
|
||||
|
||||
$users = User::query()
|
||||
->whereHas('identity', function ($query) {
|
||||
$query->where('identity_id', 1);
|
||||
})
|
||||
->get()
|
||||
->pluck('nickname', 'id');
|
||||
|
||||
->whereHas('identity', function ($query) {
|
||||
$query->where('identity_id', 1);
|
||||
})
|
||||
->get()
|
||||
->pluck('nickname', 'id');
|
||||
|
||||
$filter->where(function ($query) {
|
||||
$query->whereHas('outlet', function ($query) {
|
||||
$query->whereHas('parent', function ($query) {
|
||||
@@ -81,12 +78,12 @@ class CouponController extends AdminController
|
||||
|
||||
$grid->column('code', '卡券编号');
|
||||
$grid->column('status', '状态')
|
||||
->using(ActivityCoupon::STATUS)
|
||||
->label([
|
||||
1 => 'default',
|
||||
2 => 'warning',
|
||||
3 => 'info',
|
||||
]);
|
||||
->using(ActivityCoupon::STATUS)
|
||||
->label([
|
||||
1 => 'default',
|
||||
2 => 'warning',
|
||||
3 => 'info',
|
||||
]);
|
||||
|
||||
$grid->column('used_at', '核销时间');
|
||||
$grid->column('created_at', '创建时间');
|
||||
@@ -98,10 +95,10 @@ class CouponController extends AdminController
|
||||
return strip_tags($value);
|
||||
});
|
||||
$export->column('mobile', function ($value, $original) {
|
||||
return $value . "\t";
|
||||
return $value."\t";
|
||||
});
|
||||
|
||||
$export->filename($this->title . date("YmdHis"));
|
||||
$export->filename($this->title.date("YmdHis"));
|
||||
});
|
||||
|
||||
return $grid;
|
||||
|
||||
Reference in New Issue
Block a user