修改
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Admin\Controllers\Activity;
|
namespace App\Admin\Controllers\Activity;
|
||||||
|
|
||||||
use App\Admin\Renderable\Activity\Grants;
|
|
||||||
use App\Models\Activity;
|
use App\Models\Activity;
|
||||||
use App\Models\ActivityGrant;
|
use App\Models\ActivityGrant;
|
||||||
use App\Models\ActivityRule;
|
use App\Models\ActivityRule;
|
||||||
@@ -87,6 +86,7 @@ class IndexController extends AdminController
|
|||||||
$query->where('identity_id', 1);
|
$query->where('identity_id', 1);
|
||||||
})->get()->pluck('nickname', 'id');
|
})->get()->pluck('nickname', 'id');
|
||||||
|
|
||||||
|
$filter->equal('user_id', '渠道')->select($users);
|
||||||
});
|
});
|
||||||
|
|
||||||
$filter->column(1 / 2, function ($filter) {
|
$filter->column(1 / 2, function ($filter) {
|
||||||
@@ -100,6 +100,10 @@ class IndexController extends AdminController
|
|||||||
$grid->column('title', '活动名称');
|
$grid->column('title', '活动名称');
|
||||||
$grid->column('code', '活动编号');
|
$grid->column('code', '活动编号');
|
||||||
$grid->column('rule.code', '卡券规则');
|
$grid->column('rule.code', '卡券规则');
|
||||||
|
$grid->column('所属')->display(function () {
|
||||||
|
return $this->user_id ? $this->user->nickname : '系统';
|
||||||
|
});
|
||||||
|
|
||||||
$grid->column('类型')->display(function () {
|
$grid->column('类型')->display(function () {
|
||||||
return $this->type_text;
|
return $this->type_text;
|
||||||
});
|
});
|
||||||
@@ -107,20 +111,6 @@ class IndexController extends AdminController
|
|||||||
$grid->column('days', '延期(天)');
|
$grid->column('days', '延期(天)');
|
||||||
$grid->column('rule.full', '满足金额');
|
$grid->column('rule.full', '满足金额');
|
||||||
$grid->column('rule.take', '扣除金额');
|
$grid->column('rule.take', '扣除金额');
|
||||||
$grid->column('发券')
|
|
||||||
->display(function () {
|
|
||||||
return $this->grants->pluck('user_nickname');
|
|
||||||
})
|
|
||||||
->label()
|
|
||||||
->hide();
|
|
||||||
|
|
||||||
$grid->column('核券')
|
|
||||||
->display(function () {
|
|
||||||
return $this->verifications->pluck('user_nickname');
|
|
||||||
})
|
|
||||||
->label()
|
|
||||||
->hide();
|
|
||||||
|
|
||||||
$grid->column('开始时间')->display(function () {
|
$grid->column('开始时间')->display(function () {
|
||||||
return $this->type == Activity::TYPE_SCOPE ? $this->start_at->format('Y-m-d') : '---';
|
return $this->type == Activity::TYPE_SCOPE ? $this->start_at->format('Y-m-d') : '---';
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ use Encore\Admin\Grid;
|
|||||||
class IndexController extends AdminController
|
class IndexController extends AdminController
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $title = '渠道打款处理';
|
protected $title = '平安渠道打款处理';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notes:
|
* Notes:
|
||||||
@@ -59,6 +59,7 @@ class IndexController extends AdminController
|
|||||||
->whereHas('identity', function ($query) {
|
->whereHas('identity', function ($query) {
|
||||||
$query->where('identity_id', 1);
|
$query->where('identity_id', 1);
|
||||||
})
|
})
|
||||||
|
->where('type', 'pingan')
|
||||||
->get()
|
->get()
|
||||||
->pluck('nickname', 'id');
|
->pluck('nickname', 'id');
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,12 @@ class LogController extends AdminController
|
|||||||
$grid->filter(function ($filter) {
|
$grid->filter(function ($filter) {
|
||||||
$filter->column(1 / 2, function ($filter) {
|
$filter->column(1 / 2, function ($filter) {
|
||||||
$filter->between('paid_at', '打款时间')->datetime();
|
$filter->between('paid_at', '打款时间')->datetime();
|
||||||
$users = User::whereHas('identity', function ($query) {
|
$users = User::query()
|
||||||
|
->whereHas('identity', function ($query) {
|
||||||
$query->where('identity_id', 1);
|
$query->where('identity_id', 1);
|
||||||
})->get()->pluck('nickname', 'id');
|
})
|
||||||
|
->get()
|
||||||
|
->pluck('nickname', 'id');
|
||||||
$filter->equal('user_id', '渠道')->select($users);
|
$filter->equal('user_id', '渠道')->select($users);
|
||||||
});
|
});
|
||||||
$filter->column(1 / 2, function ($filter) {
|
$filter->column(1 / 2, function ($filter) {
|
||||||
|
|||||||
@@ -17,32 +17,40 @@ class HomeController extends Controller
|
|||||||
{
|
{
|
||||||
|
|
||||||
return $content
|
return $content
|
||||||
->title('数据看版1')
|
->title('数据看版2')
|
||||||
->row(function (Row $row) {
|
->row(function (Row $row) {
|
||||||
$row->column(2, function (Column $column) {
|
$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()));
|
$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(function (Row $row) {
|
||||||
$row->column(2, function (Column $column) {
|
$row->column(2, function (Column $column) {
|
||||||
$column->append(new InfoBox('核销卡券总数', '', 'blue', '/admin/coupons', Coupon::whereIn('status', [2, 3])->count()));
|
$column->append(new InfoBox('核销卡券总数', '', 'blue', '/admin/coupons', Coupon::whereIn('status', [2, 3])
|
||||||
|
->count()));
|
||||||
});
|
});
|
||||||
|
|
||||||
$row->column(2, function (Column $column) {
|
$row->column(2, function (Column $column) {
|
||||||
$column->append(new InfoBox('核销成功', '', 'blue', '/admin/coupons', Coupon::where('status', 2)->count()));
|
$column->append(new InfoBox('核销成功', '', 'blue', '/admin/coupons', Coupon::where('status', 2)
|
||||||
|
->count()));
|
||||||
});
|
});
|
||||||
$row->column(2, function (Column $column) {
|
$row->column(2, function (Column $column) {
|
||||||
$column->append(new InfoBox('核销失败', '', 'black', '/admin/coupons', Coupon::where('status', 3)->count()));
|
$column->append(new InfoBox('核销失败', '', 'black', '/admin/coupons', Coupon::where('status', 3)
|
||||||
|
->count()));
|
||||||
});
|
});
|
||||||
$row->column(2, function (Column $column) {
|
$row->column(2, function (Column $column) {
|
||||||
$column->append(new InfoBox('资金通道结算', '', 'red', '/admin/coupons', Coupon::where('status', 2)->sum('price')));
|
$column->append(new InfoBox('资金通道结算', '', 'red', '/admin/coupons', Coupon::where('status', 2)
|
||||||
|
->sum('price')));
|
||||||
});
|
});
|
||||||
$row->column(2, function (Column $column) {
|
$row->column(2, function (Column $column) {
|
||||||
$column->append(new InfoBox('应打款金额', '', 'green', '/admin/coupons', Coupon::where('status', 2)->sum('profit')));
|
$column->append(new InfoBox('应打款金额', '', 'green', '/admin/coupons', Coupon::where('status', 2)
|
||||||
|
->sum('profit')));
|
||||||
});
|
});
|
||||||
$row->column(2, function (Column $column) {
|
$row->column(2, function (Column $column) {
|
||||||
$column->append(new InfoBox('已打款金额', '', 'green', '/admin/coupons', Coupon::where('status', 2)->where('is_profit', 1)->sum('profit')));
|
$column->append(new InfoBox('已打款金额', '', 'green', '/admin/coupons', Coupon::where('status', 2)
|
||||||
|
->where('is_profit', 1)
|
||||||
|
->sum('profit')));
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
->row(function (Row $row) {
|
->row(function (Row $row) {
|
||||||
|
|||||||
Reference in New Issue
Block a user