From f0bd2db048ca8bb8d74731fef6e5f7b77531c510 Mon Sep 17 00:00:00 2001 From: Mike Date: Thu, 6 Aug 2020 15:38:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=8F=E7=90=86=E6=8F=90=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/LanzuMmWithdrawController.php | 9 ++++++--- app/Models/LanzuMmWithdraw.php | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/Admin/Controllers/LanzuMmWithdrawController.php b/app/Admin/Controllers/LanzuMmWithdrawController.php index 8205272..beac81a 100644 --- a/app/Admin/Controllers/LanzuMmWithdrawController.php +++ b/app/Admin/Controllers/LanzuMmWithdrawController.php @@ -3,6 +3,7 @@ namespace App\Admin\Controllers; use App\Admin\Repositories\LanzuMmWithdraw; +use App\Models\LanzuMmWithdraw as MmWithdraw; use Dcat\Admin\Form; use Dcat\Admin\Grid; use Dcat\Admin\Show; @@ -19,11 +20,13 @@ class LanzuMmWithdrawController extends AdminController */ protected function grid() { - return Grid::make(new LanzuMmWithdraw(), function (Grid $grid) { + return Grid::make(new LanzuMmWithdraw(['mmInfo']), function (Grid $grid) { $grid->id->sortable(); - $grid->mm_id('提现'); + //$grid->mm_id('提现'); + $grid->column('mmInfo.name','经理名'); $grid->money; - $grid->status('提现状态'); + $grid->status('提现状态')->using([-1=>'拒绝',0=>'审核中',1=>'通过']) + ->label([-1=>'danger',0=>'default',1=>'success']); $grid->created_at('提现时间'); $grid->filter(function (Grid\Filter $filter) { diff --git a/app/Models/LanzuMmWithdraw.php b/app/Models/LanzuMmWithdraw.php index 30d86c7..85d7ead 100644 --- a/app/Models/LanzuMmWithdraw.php +++ b/app/Models/LanzuMmWithdraw.php @@ -13,4 +13,9 @@ class LanzuMmWithdraw extends Model protected $dateFormat = 'U'; protected $table = 'lanzu_mm_withdraw'; + public function mmInfo() + { + return $this->hasOne('\App\Models\LanzuMpInfo','id','mm_id'); + } + }