master
parent
32d84b65fc
commit
5a7eecf663
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use App\Admin;
|
||||
|
||||
class AskSubmit extends SoftDeletesModel
|
||||
{
|
||||
protected $table = "ask_submits";
|
||||
protected $casts = ['content'=>'json'];
|
||||
|
||||
public function admin()
|
||||
{
|
||||
return $this->hasOne(Admin::class,'id','admin_id');
|
||||
}
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->hasOne(Project::class,'id','project_id');
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAskSubmit extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('ask_submits', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer("admin_id")->nullable();
|
||||
$table->integer("project_id")->nullable();
|
||||
$table->json("content")->nullable();
|
||||
$table->integer("score")->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('ask_submits');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
@extends("admin.layouts.layout")
|
||||
|
||||
@section("content")
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<a class="btn btn-primary" href="{{url($urlPrefix.'/create')}}">
|
||||
@lang("icons.action_create") @lang('actions.create'){{$modelName}}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered" id="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
{{$modelName}}
|
||||
</th>
|
||||
<th>护士长</th>
|
||||
<th>医院</th>
|
||||
<th>详情</th>
|
||||
<th>总分</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($data as $row)
|
||||
<tr data-id="{{$row->id}}">
|
||||
<td>
|
||||
{{ $row->admin->name }}
|
||||
</td>
|
||||
<td>{{ $row->project->name }}</td>
|
||||
<td>{{ $row->score }}</td>
|
||||
<td>{{ $row->score }}</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-info"
|
||||
href="{{url("{$urlPrefix}/beds/{$row['id']}")}}"><i class="mdi mdi-bed-empty"></i> 床位管理</a>
|
||||
<a class="btn btn-sm btn-info"
|
||||
href="{{url("{$urlPrefix}/ask_submit/{$row['id']}")}}"><i class="mdi mdi-bed-empty"></i> 满意度调查</a>
|
||||
<a class="btn btn-sm btn-primary"
|
||||
href="{{url("{$urlPrefix}/edit?id={$row['id']}")}}">@lang("icons.action_edit") @lang("actions.edit")</a>
|
||||
<a class="btn btn-sm btn-danger btn-delete" data-id="{{$row['id']}}"
|
||||
href="javascript:;">@lang("icons.action_delete") @lang("actions.delete")</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@include("public._pages")
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include("public._delete")
|
||||
@endsection
|
||||
|
||||
@push("footer")
|
||||
<script>
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
Loading…
Reference in new issue