DocterController.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. namespace App\Admin\Controllers;
  3. use App\Models\Docter;
  4. use Encore\Admin\Controllers\AdminController;
  5. use Encore\Admin\Form;
  6. use Encore\Admin\Grid;
  7. use Encore\Admin\Show;
  8. class DocterController extends AdminController
  9. {
  10. /**
  11. * Title for current resource.
  12. *
  13. * @var string
  14. */
  15. protected $title = '医生';
  16. /**
  17. * Make a grid builder.
  18. *
  19. * @return Grid
  20. */
  21. protected function grid()
  22. {
  23. $grid = new Grid(new Docter());
  24. $grid->column('id', __('Id'));
  25. $grid->column('type', __('Type'));
  26. $grid->column('name', __('Name'));
  27. $grid->column('phone', __('Phone'));
  28. $grid->column('sex', __('Sex'));
  29. $grid->column('birthday', __('Birthday'));
  30. $grid->column('avatar', __('Avatar'));
  31. $grid->column('status', __('Status'));
  32. $grid->column('label', __('Label'));
  33. $grid->column('sign', __('Sign'));
  34. $grid->column('intro', __('Intro'));
  35. $grid->column('office_id', __('Office id'));
  36. $grid->column('qualification_id', __('Qualification id'));
  37. $grid->column('score', __('Score'));
  38. $grid->column('service_persons', __('Service persons'));
  39. $grid->column('eva_num', __('Eva num'));
  40. $grid->column('service_days', __('Service days'));
  41. $grid->column('phone_minutes', __('Phone minutes'));
  42. $grid->column('chat_price', __('Chat price'));
  43. $grid->column('phone_price', __('Phone price'));
  44. $grid->column('appoint_price', __('Appoint price'));
  45. $grid->column('is_chat', __('Is chat'));
  46. $grid->column('is_phone', __('Is phone'));
  47. $grid->column('is_appoint', __('Is appoint'));
  48. $grid->column('latitude', __('Latitude'));
  49. $grid->column('longitude', __('Longitude'));
  50. $grid->column('created_at', __('Created at'));
  51. $grid->column('updated_at', __('Updated at'));
  52. $grid->column('user_id', __('User id'));
  53. $grid->column('password', __('Password'));
  54. $grid->column('is_then', __('Is then'));
  55. $grid->column('practice', __('Practice'));
  56. $grid->column('card_photo', __('Card photo'));
  57. $grid->column('is_quail', __('Is quail'));
  58. $grid->column('card_id', __('Card id'));
  59. $grid->column('receiving_time', __('Receiving time'));
  60. return $grid;
  61. }
  62. /**
  63. * Make a show builder.
  64. *
  65. * @param mixed $id
  66. * @return Show
  67. */
  68. protected function detail($id)
  69. {
  70. $show = new Show(Docter::findOrFail($id));
  71. $show->field('id', __('Id'));
  72. $show->field('type', __('Type'));
  73. $show->field('name', __('Name'));
  74. $show->field('phone', __('Phone'));
  75. $show->field('sex', __('Sex'));
  76. $show->field('birthday', __('Birthday'));
  77. $show->field('avatar', __('Avatar'));
  78. $show->field('status', __('Status'));
  79. $show->field('label', __('Label'));
  80. $show->field('sign', __('Sign'));
  81. $show->field('intro', __('Intro'));
  82. $show->field('office_id', __('Office id'));
  83. $show->field('qualification_id', __('Qualification id'));
  84. $show->field('score', __('Score'));
  85. $show->field('service_persons', __('Service persons'));
  86. $show->field('eva_num', __('Eva num'));
  87. $show->field('service_days', __('Service days'));
  88. $show->field('phone_minutes', __('Phone minutes'));
  89. $show->field('chat_price', __('Chat price'));
  90. $show->field('phone_price', __('Phone price'));
  91. $show->field('appoint_price', __('Appoint price'));
  92. $show->field('is_chat', __('Is chat'));
  93. $show->field('is_phone', __('Is phone'));
  94. $show->field('is_appoint', __('Is appoint'));
  95. $show->field('latitude', __('Latitude'));
  96. $show->field('longitude', __('Longitude'));
  97. $show->field('created_at', __('Created at'));
  98. $show->field('updated_at', __('Updated at'));
  99. $show->field('user_id', __('User id'));
  100. $show->field('password', __('Password'));
  101. $show->field('is_then', __('Is then'));
  102. $show->field('practice', __('Practice'));
  103. $show->field('card_photo', __('Card photo'));
  104. $show->field('is_quail', __('Is quail'));
  105. $show->field('card_id', __('Card id'));
  106. $show->field('receiving_time', __('Receiving time'));
  107. return $show;
  108. }
  109. /**
  110. * Make a form builder.
  111. *
  112. * @return Form
  113. */
  114. protected function form()
  115. {
  116. $form = new Form(new Docter());
  117. $form->switch('type', __('Type'));
  118. $form->text('name', __('Name'));
  119. $form->mobile('phone', __('Phone'));
  120. $form->switch('sex', __('Sex'));
  121. $form->text('birthday', __('Birthday'));
  122. $form->image('avatar', __('Avatar'));
  123. $form->switch('status', __('Status'))->default(1);
  124. $form->text('label', __('Label'));
  125. $form->text('sign', __('Sign'));
  126. $form->text('intro', __('Intro'));
  127. $form->number('office_id', __('Office id'));
  128. $form->number('qualification_id', __('Qualification id'));
  129. $form->decimal('score', __('Score'))->default(0.0);
  130. $form->number('service_persons', __('Service persons'));
  131. $form->number('eva_num', __('Eva num'));
  132. $form->number('service_days', __('Service days'));
  133. $form->number('phone_minutes', __('Phone minutes'));
  134. $form->number('chat_price', __('Chat price'));
  135. $form->number('phone_price', __('Phone price'));
  136. $form->number('appoint_price', __('Appoint price'));
  137. $form->switch('is_chat', __('Is chat'))->default(1);
  138. $form->switch('is_phone', __('Is phone'))->default(1);
  139. $form->switch('is_appoint', __('Is appoint'))->default(1);
  140. $form->decimal('latitude', __('Latitude'))->default(0.0000000);
  141. $form->decimal('longitude', __('Longitude'))->default(0.0000000);
  142. $form->number('user_id', __('User id'));
  143. $form->password('password', __('Password'));
  144. $form->number('is_then', __('Is then'));
  145. $form->text('practice', __('Practice'));
  146. $form->text('card_photo', __('Card photo'));
  147. $form->text('is_quail', __('Is quail'));
  148. $form->text('card_id', __('Card id'));
  149. $form->number('receiving_time', __('Receiving time'));
  150. return $form;
  151. }
  152. }