微调
This commit is contained in:
@@ -16,189 +16,196 @@ class HomeController extends Controller
|
||||
public function index(Content $content)
|
||||
{
|
||||
|
||||
return $content
|
||||
->title('数据看版3')
|
||||
->row(function (Row $row) {
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'渠道商',
|
||||
'users',
|
||||
'yellow',
|
||||
'/admin/users?identity[identity_id]=1',
|
||||
User::whereHas('identity', function ($q) {
|
||||
$q->where('identity_id', 1);
|
||||
})->count()
|
||||
));
|
||||
});
|
||||
})
|
||||
->row(function (Row $row) {
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'核销卡券总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
Coupon::whereIn('status', [2, 3])->count()
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'核销成功',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
Coupon::where('status', 2)->count()
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'核销失败',
|
||||
'',
|
||||
'black',
|
||||
'/admin/coupons',
|
||||
Coupon::where('status', 3)->count()
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'资金通道结算',
|
||||
'',
|
||||
'red',
|
||||
'/admin/coupons',
|
||||
Coupon::where('status', 2)->sum('price')
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'应打款金额',
|
||||
'',
|
||||
'green',
|
||||
'/admin/coupons',
|
||||
Coupon::where('status', 2)->sum('profit')
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'已打款金额',
|
||||
'',
|
||||
'green',
|
||||
'/admin/coupons',
|
||||
Coupon::where('status', 2)
|
||||
->where('is_profit', 1)
|
||||
->sum('profit')
|
||||
));
|
||||
});
|
||||
})
|
||||
->row(function (Row $row) {
|
||||
return $content->title('数据看版3')
|
||||
->row(function (Row $row) {
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'渠道商',
|
||||
'users',
|
||||
'yellow',
|
||||
'/admin/users?identity[identity_id]=1',
|
||||
User::whereHas('identity', function ($q) {
|
||||
$q->where('identity_id', 1);
|
||||
})->count()
|
||||
));
|
||||
});
|
||||
})
|
||||
->row(function (Row $row) {
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'核销卡券总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
Coupon::whereIn('status', [2, 3])->count()
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'核销成功',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
Coupon::where('status', 2)->count()
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'核销失败',
|
||||
'',
|
||||
'black',
|
||||
'/admin/coupons',
|
||||
Coupon::where('status', 3)->count()
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'资金通道结算',
|
||||
'',
|
||||
'red',
|
||||
'/admin/coupons',
|
||||
Coupon::where('status', 2)->sum('price')
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'应打款金额',
|
||||
'',
|
||||
'green',
|
||||
'/admin/coupons',
|
||||
Coupon::where('status', 2)->sum('profit')
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) {
|
||||
$column->append(new InfoBox(
|
||||
'已打款金额',
|
||||
'',
|
||||
'green',
|
||||
'/admin/coupons',
|
||||
Coupon::where('status', 2)
|
||||
->where('is_profit', 1)
|
||||
->sum('profit')
|
||||
));
|
||||
});
|
||||
})
|
||||
->row(function (Row $row) {
|
||||
|
||||
$lists = [
|
||||
'ysd10' => Coupon::where('status', 2)
|
||||
->whereDate('created_at', now()->format('Y-m-d'))
|
||||
->where('thirdPartyGoodsId', 'YSD-full100-10')
|
||||
->count(),
|
||||
'ysd25' => Coupon::where('status', 2)
|
||||
->whereDate('created_at', now()->format('Y-m-d'))
|
||||
->where('thirdPartyGoodsId', 'YSD-full100-25')
|
||||
->count(),
|
||||
'ysd50' => Coupon::where('status', 2)
|
||||
->whereDate('created_at', now()->format('Y-m-d'))
|
||||
->where('thirdPartyGoodsId', 'YSD-full100-50')
|
||||
->count(),
|
||||
'ysd100' => Coupon::where('status', 2)
|
||||
->whereDate('created_at', now()->format('Y-m-d'))
|
||||
->where('thirdPartyGoodsId', 'YSD-full200-100')
|
||||
->count(),
|
||||
];
|
||||
$lists = [
|
||||
'ysd10' => Coupon::where('status', 2)
|
||||
->whereDate('created_at', now()->format('Y-m-d'))
|
||||
->where('thirdPartyGoodsId', 'YSD-full100-10')
|
||||
->count(),
|
||||
'ysd25' => Coupon::where('status', 2)
|
||||
->whereDate('created_at', now()->format('Y-m-d'))
|
||||
->where('thirdPartyGoodsId', 'YSD-full100-25')
|
||||
->count(),
|
||||
'ysd50' => Coupon::where('status', 2)
|
||||
->whereDate('created_at', now()->format('Y-m-d'))
|
||||
->where('thirdPartyGoodsId', 'YSD-full100-50')
|
||||
->count(),
|
||||
'ysd100' => Coupon::where('status', 2)
|
||||
->whereDate('created_at', now()->format('Y-m-d'))
|
||||
->where('thirdPartyGoodsId', 'YSD-full200-100')
|
||||
->count(),
|
||||
];
|
||||
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减10元成功今日总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd10']
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减10元成功今日总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd10']
|
||||
));
|
||||
});
|
||||
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减25元成功今日总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd25']
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减25元成功今日总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd25']
|
||||
));
|
||||
});
|
||||
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减50元成功今日总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd50']
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减50元成功今日总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd50']
|
||||
));
|
||||
});
|
||||
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'200元减100元成功今日总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd100']
|
||||
));
|
||||
});
|
||||
})
|
||||
->row(function (Row $row) {
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'200元减100元成功今日总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd100']
|
||||
));
|
||||
});
|
||||
})
|
||||
->row(function (Row $row) {
|
||||
|
||||
$lists = [
|
||||
'ysd10' => Coupon::where('status', 2)->where('thirdPartyGoodsId', 'YSD-full100-10')->count(),
|
||||
'ysd25' => Coupon::where('status', 2)->where('thirdPartyGoodsId', 'YSD-full100-25')->count(),
|
||||
'ysd50' => Coupon::where('status', 2)->where('thirdPartyGoodsId', 'YSD-full100-50')->count(),
|
||||
'ysd100' => Coupon::where('status', 2)->where('thirdPartyGoodsId', 'YSD-full200-100')->count(),
|
||||
];
|
||||
$lists = [
|
||||
'ysd10' => Coupon::where('status', 2)
|
||||
->where('thirdPartyGoodsId', 'YSD-full100-10')
|
||||
->count(),
|
||||
'ysd25' => Coupon::where('status', 2)
|
||||
->where('thirdPartyGoodsId', 'YSD-full100-25')
|
||||
->count(),
|
||||
'ysd50' => Coupon::where('status', 2)
|
||||
->where('thirdPartyGoodsId', 'YSD-full100-50')
|
||||
->count(),
|
||||
'ysd100' => Coupon::where('status', 2)
|
||||
->where('thirdPartyGoodsId', 'YSD-full200-100')
|
||||
->count(),
|
||||
];
|
||||
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减10元成功总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd10']
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减10元成功总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd10']
|
||||
));
|
||||
});
|
||||
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减25元成功总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd25']
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减25元成功总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd25']
|
||||
));
|
||||
});
|
||||
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减50元成功总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd50']
|
||||
));
|
||||
});
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'100元减50元成功总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd50']
|
||||
));
|
||||
});
|
||||
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'200元减100元成功总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd100']
|
||||
));
|
||||
});
|
||||
});
|
||||
$row->column(2, function (Column $column) use ($lists) {
|
||||
$column->append(new InfoBox(
|
||||
'200元减100元成功总数',
|
||||
'',
|
||||
'blue',
|
||||
'/admin/coupons',
|
||||
$lists['ysd100']
|
||||
));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 核销包
|
||||
*/
|
||||
return [
|
||||
'coupon_model' => \App\Models\Coupon::class,
|
||||
'rules' => [
|
||||
@@ -9,7 +12,6 @@ return [
|
||||
'model' => \XuanChen\Coupon\Action\YsdAction::class,
|
||||
],
|
||||
'unionpay' => [
|
||||
// 'pattern' => '/^YSD\d{12}/',
|
||||
'pattern' => '/^66406/',
|
||||
'model' => \XuanChen\Coupon\Action\YsdAction::class,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user