Browse Source

用户的列表的平台id改成名称

jekon 6 years ago
parent
commit
c7eff3d4b0

+ 9 - 1
app/Http/Controllers/Admin/AppUserController.php

@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin;
 
 use App\Http\Requests\AppUserCreateRequest;
 use App\Http\Requests\AppUserUpdateRequest;
+use App\Models\App;
 use App\Models\AppUser;
 use Illuminate\Http\Request;
 use App\Http\Controllers\Controller;
@@ -23,7 +24,14 @@ class AppUserController extends Controller
 
     public function data(Request $request)
     {
-        $res = AppUser::paginate($request->get('limit', 30))->toArray();
+        $model = new AppUser();
+        $res = $model
+            ->select(['ag_app_user.*','appname'])
+            ->leftJoin('ag_app', 'ag_app_user.app_id', '=', 'ag_app.id')
+            ->paginate($request->get('limit', 30))
+            ->toArray();
+        ;
+
         $data = [
             'code' => 0,
             'msg'   => '正在请求中...',

+ 9 - 1
app/Http/Controllers/Admin/PartyUserController.php

@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin;
 
 use App\Http\Requests\PartyUserCreateRequest;
 use App\Http\Requests\PartyUserUpdateRequest;
+use App\Models\AppUser;
 use App\Models\PartyUser;
 use Illuminate\Http\Request;
 use App\Http\Controllers\Controller;
@@ -23,7 +24,14 @@ class PartyUserController extends Controller
 
     public function data(Request $request)
     {
-        $res = PartyUser::paginate($request->get('limit', 30))->toArray();
+        $model = new PartyUser();
+        $res = $model
+            ->select(['ag_party_user.*','ag_party.name as party_name'])
+            ->leftJoin('ag_party', 'ag_party_user.party_id', '=', 'ag_party.id')
+            ->paginate($request->get('limit', 30))
+            ->toArray();
+        ;
+
         $data = [
             'code' => 0,
             'msg'   => '正在请求中...',

+ 1 - 1
resources/views/admin/appUser/index.blade.php

@@ -41,7 +41,7 @@
                     {checkbox: true,fixed: true}
                     ,{field: 'id', title: 'ID', sort: true,width:80}
                     ,{field: 'app_username', title: '平台账号'}
-                    ,{field: 'app_id', title: '所属平台ID'}
+                    ,{field: 'appname', title: '所属平台ID'}
                     ,{field: 'login_time', title: '登陆时间'}
                     ,{field: 'login_ip', title: '登陆ip'}
                     ,{fixed: 'right', title: '操作', align:'center', toolbar: '#options'}

+ 6 - 2
resources/views/admin/party/index.blade.php

@@ -40,7 +40,7 @@
                 ,cols: [[ //表头
                     {checkbox: true,fixed: true}
                     ,{field: 'id', title: 'ID', sort: true,width:80}
-                    ,{field: 'name', title: '第三方名'}
+                    ,{field: 'name', title: '第三方名', event:'aa'}
                     ,{field: 'balance', title: '剩余额度'}
                     ,{field: 'phone', title: '联系电话'}
                     ,{field: 'add_user', title: '添加者'}
@@ -97,7 +97,11 @@
                     layer.msg('请选择删除项',{icon:5})
                 }
             })*/
-        })
+        });
+
+        function aa() {
+            alert(43243);
+        }
     </script>
 @endsection
 

+ 1 - 1
resources/views/admin/partyUser/index.blade.php

@@ -41,7 +41,7 @@
                     {checkbox: true,fixed: true}
                     ,{field: 'id', title: 'ID', sort: true,width:80}
                     ,{field: 'party_username', title: '用户第三方账号'}
-                    ,{field: 'party_id', title: '所属第三方ID'}
+                    ,{field: 'party_name', title: '所属第三方ID'}
                     ,{field: 'login_time', title: '登陆时间'}
                     ,{field: 'login_ip', title: '登陆ip'}
                     ,{fixed: 'right', title: '操作', align:'center', toolbar: '#options'}