This commit is contained in:
2021-09-01 10:03:19 +08:00
parent 1966d21ed6
commit bdc7525b65

View File

@@ -17,10 +17,10 @@ class CensusController extends AdminController
/** /**
* Index interface. * Index interface.
* @param Content $content * @param Content $content
* @return Content * @return Content
*/ */
public function index(Content $content) public function index(Content $content): Content
{ {
return $content return $content
->header('核销总数据') ->header('核销总数据')
@@ -30,10 +30,10 @@ class CensusController extends AdminController
/** /**
* 今日核销数据 * 今日核销数据
* @param Content $content [description] * @param Content $content [description]
* @return [type] [description] * @return \Encore\Admin\Layout\Content [type] [description]
*/ */
public function today(Content $content) public function today(Content $content): Content
{ {
$this->today = true; $this->today = true;
@@ -43,14 +43,14 @@ class CensusController extends AdminController
->body($this->grid()); ->body($this->grid());
} }
protected function grid() protected function grid(): Grid
{ {
$grid = new Grid(new User); $grid = new Grid(new User);
$grid->model() $grid->model()
->whereHas('identity', function ($q) { ->whereHas('identity', function ($q) {
$q->where('identity_id', 1); $q->where('identity_id', 1);
}); });
$grid->disableCreateButton(); $grid->disableCreateButton();
$grid->disableBatchActions(); $grid->disableBatchActions();
@@ -74,9 +74,10 @@ class CensusController extends AdminController
$rules = ActivityRule::get(); $rules = ActivityRule::get();
foreach ($rules as $rule) { foreach ($rules as $rule) {
$grid->column($rule->title)->display(function () use ($today, $rule) { $grid->column(str_replace('.', '。', $rule->title))
return $this->getCouponCount($rule->code, $today); ->display(function () use ($today, $rule) {
}); return $this->getCouponCount($rule->code, $today);
});
} }
// $grid->column('100元减10元优惠券')->display(function () use ($today) { // $grid->column('100元减10元优惠券')->display(function () use ($today) {
// return $this->getCouponCount('YSD-full100-10', $today); // return $this->getCouponCount('YSD-full100-10', $today);