Silent 6 years ago
parent
commit
7df188f390

+ 5 - 3
resources/views/admin/students/courses/index.blade.php

@@ -31,9 +31,11 @@
                                     </div>
                                     </div>
                                 </form>
                                 </form>
                             </div>
                             </div>
-                            <div class="col-sm-8 pull-right">
-                                <a href="{{ $pre_uri . 'create?student_id=' . $student->id }}" class="btn btn-sm btn-primary pull-right">添加{{ $model_name }}</a>
-                            </div>
+                            @if($list->count() == 0)
+                                <div class="col-sm-8 pull-right">
+                                    <a href="{{ $pre_uri . 'create?student_id=' . $student->id }}" class="btn btn-sm btn-primary pull-right">添加{{ $model_name }}</a>
+                                </div>
+                            @endif
                         </div>
                         </div>
                         <table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="sg-main-table">
                         <table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="sg-main-table">
                             <thead>
                             <thead>

+ 5 - 3
resources/views/teacher/students/courses/index.blade.php

@@ -31,9 +31,11 @@
                                     </div>
                                     </div>
                                 </form>
                                 </form>
                             </div>
                             </div>
-                            <div class="col-sm-8 pull-right">
-                                <a href="{{ $pre_uri . 'create?student_id=' . $student->id }}" class="btn btn-sm btn-primary pull-right">添加{{ $model_name }}</a>
-                            </div>
+                            @if($list->count() == 0)
+                                <div class="col-sm-8 pull-right">
+                                    <a href="{{ $pre_uri . 'create?student_id=' . $student->id }}" class="btn btn-sm btn-primary pull-right">添加{{ $model_name }}</a>
+                                </div>
+                            @endif
                         </div>
                         </div>
                         <table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="sg-main-table">
                         <table class="table table-striped table-bordered table-hover dataTables-example dataTable" id="sg-main-table">
                             <thead>
                             <thead>