Ver Fonte

优化用户显示

xiansin há 4 anos atrás
pai
commit
1beb32fe1a
1 ficheiros alterados com 7 adições e 6 exclusões
  1. 7 6
      app/Admin/Controllers/UserController.php

+ 7 - 6
app/Admin/Controllers/UserController.php

xqd
@@ -51,16 +51,17 @@ class UserController extends AdminController
     protected function detail($id)
     {
         return Show::make($id, new User(), function (Show $show) {
+            $show->model()->with('parent');
             $show->field('id');
             $show->field('nickname');
-            $show->field('openid');
-            $show->field('heade_img');
-            $show->field('parenid');
+            $show->field('head_img','头像')->image();
+            $show->parent_id()->as(function ($parent_id) {
+                return $this->parent?$this->parent->nickname:'无';
+            });
             $show->field('phone_num');
             $show->field('income');
-            $show->field('is_vip');
-            $show->field('share_qrcode');
-            $show->field('scene_code');
+            $show->field('is_vip')->using([0=>'否',1=>'是']);
+            $show->field('share_qrcode','推广码')->image();
             $show->field('become_vip_at');
             $show->field('become_child_at');
             $show->field('created_at');