From bdc7525b656687322f0c5fe882d702de55bf8d85 Mon Sep 17 00:00:00 2001 From: xuanchen <122383162@qq.com> Date: Wed, 1 Sep 2021 10:03:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Finance/CensusController.php | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/Admin/Controllers/Finance/CensusController.php b/app/Admin/Controllers/Finance/CensusController.php index 4cca85c..54fed32 100644 --- a/app/Admin/Controllers/Finance/CensusController.php +++ b/app/Admin/Controllers/Finance/CensusController.php @@ -17,10 +17,10 @@ class CensusController extends AdminController /** * Index interface. - * @param Content $content + * @param Content $content * @return Content */ - public function index(Content $content) + public function index(Content $content): Content { return $content ->header('核销总数据') @@ -30,10 +30,10 @@ class CensusController extends AdminController /** * 今日核销数据 - * @param Content $content [description] - * @return [type] [description] + * @param Content $content [description] + * @return \Encore\Admin\Layout\Content [type] [description] */ - public function today(Content $content) + public function today(Content $content): Content { $this->today = true; @@ -43,14 +43,14 @@ class CensusController extends AdminController ->body($this->grid()); } - protected function grid() + protected function grid(): Grid { $grid = new Grid(new User); $grid->model() - ->whereHas('identity', function ($q) { - $q->where('identity_id', 1); - }); + ->whereHas('identity', function ($q) { + $q->where('identity_id', 1); + }); $grid->disableCreateButton(); $grid->disableBatchActions(); @@ -74,9 +74,10 @@ class CensusController extends AdminController $rules = ActivityRule::get(); foreach ($rules as $rule) { - $grid->column($rule->title)->display(function () use ($today, $rule) { - return $this->getCouponCount($rule->code, $today); - }); + $grid->column(str_replace('.', '。', $rule->title)) + ->display(function () use ($today, $rule) { + return $this->getCouponCount($rule->code, $today); + }); } // $grid->column('100元减10元优惠券')->display(function () use ($today) { // return $this->getCouponCount('YSD-full100-10', $today);