Sfoglia il codice sorgente

Merge branch 'master' of ssh://git.9026.com:2212/swdz-WangHaijun/BaoMa

Swdz-WangHaiJun 4 anni fa
parent
commit
f5f7251650
35 ha cambiato i file con 1551 aggiunte e 18 eliminazioni
  1. 20 0
      app/Admin/Actions/backstage/Orders/OrderDetails.php
  2. 1 1
      app/Admin/Actions/backstage/User/MapDepot.php
  3. 1 1
      app/Admin/Actions/backstage/User/Suggests.php
  4. 26 0
      app/Admin/Controllers/Api/ApiController.php
  5. 160 0
      app/Admin/Controllers/BookingOrderController.php
  6. 143 0
      app/Admin/Controllers/ConsultingOrdersController.php
  7. 2 0
      app/Admin/Controllers/DocterTeamController.php
  8. 92 0
      app/Admin/Controllers/IconsDoctorController.php
  9. 93 0
      app/Admin/Controllers/IconsUserController.php
  10. 66 0
      app/Admin/Controllers/MenubarController.php
  11. 64 0
      app/Admin/Controllers/NoticeDoctorController.php
  12. 64 0
      app/Admin/Controllers/NoticeUserController.php
  13. 124 0
      app/Admin/Controllers/OrdersDetailsController.php
  14. 139 0
      app/Admin/Controllers/RechargeOrderController.php
  15. 146 0
      app/Admin/Controllers/ServicePackOrderController.php
  16. 108 0
      app/Admin/Controllers/ServicePacksController.php
  17. 1 0
      app/Admin/Controllers/SignUpController.php
  18. 11 11
      app/Admin/Controllers/UserListController.php
  19. 2 0
      app/Admin/Controllers/UserPatientsController.php
  20. 1 1
      app/Admin/bootstrap.php
  21. 24 0
      app/Admin/routes.php
  22. 1 0
      app/Http/Controllers/Api/V1/UserController.php
  23. 17 0
      app/Models/Icons.php
  24. 11 0
      app/Models/Menubar.php
  25. 1 0
      app/Models/Notice.php
  26. 4 0
      app/Models/ServicePack.php
  27. 4 0
      app/Models/Team.php
  28. 3 0
      app/Models/TeamDocter.php
  29. 3 2
      composer.json
  30. 63 1
      composer.lock
  31. 42 0
      config/admin.php
  32. 1 1
      database/migrations/2020_11_24_065951_add_table_bm_service_apply.php
  33. 39 0
      database/migrations/2020_12_02_020655_create_icons_table.php
  34. 37 0
      database/migrations/2020_12_02_063339_create_notice_table.php
  35. 37 0
      database/migrations/2020_12_02_075125_create_menubar_table.php

+ 20 - 0
app/Admin/Actions/backstage/Orders/OrderDetails.php

xqd
@@ -0,0 +1,20 @@
+<?php
+
+namespace App\Admin\Actions\backstage\Orders;
+
+use Encore\Admin\Actions\RowAction;
+use Illuminate\Database\Eloquent\Model;
+
+class OrderDetails extends RowAction
+{
+    public $name = '订单详情';
+
+    public function handle(Model $model)
+    {
+        // $model ...
+
+        return $this->response()->success('跳转订单详情成功')->redirect('/admin/orders_details?id='.$this->row->id.'');
+
+    }
+
+}

+ 1 - 1
app/Admin/Actions/backstage/User/MapDepot.php

xqd
@@ -12,7 +12,7 @@ class MapDepot extends RowAction
 
     public function form(Model $model)
     {
-        $imgs = OrderPatient::where('patient_id',$model->id)->get('medical_imgs');
+        $imgs = OrderPatient::where('patient_id',$model->patient_id)->get('medical_imgs');
         $all = json_decode($imgs,true);
         $i =1;
         $all1 =  array_column($all,'medical_imgs');

+ 1 - 1
app/Admin/Actions/backstage/User/Suggests.php

xqd
@@ -12,7 +12,7 @@ class Suggests extends RowAction
     public function handle(Model $model)
     {
         // $model ...
-        return $this->response()->success('跳转病例意见单成功')->redirect('/admin/user_suggests?patient_id='.$this->row->id.'');
+        return $this->response()->success('跳转病例意见单成功')->redirect('/admin/user_suggests?patient_id='.$this->row->patient_id.'');
     }
 
 }

+ 26 - 0
app/Admin/Controllers/Api/ApiController.php

xqd
@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Admin\Controllers\Api;
+
+use Encore\Admin\Controllers\AdminController;
+
+class ApiController extends AdminController
+{
+    /**
+     * 后台上传图片
+     * @return string
+     */
+
+    public function upload()
+    {
+        $url = "error|服务器端错误";
+
+        foreach (request()->file() as $file) {
+            $url = "upload/images/".uniqid().rand(9000,100000).'.'.$file->getClientOriginalExtension();
+            file_put_contents($url,file_get_contents($file->getRealPath()));
+        }
+
+        return env('APP_URL').'/'.$url;
+    }
+
+}

+ 160 - 0
app/Admin/Controllers/BookingOrderController.php

xqd
@@ -0,0 +1,160 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Order;
+use App\Admin\Actions\backstage\Orders\OrderDetails;
+use Encore\Admin\Controllers\AdminController;
+use App\Admin\Actions\backstage\User\MapDepot;
+use App\Admin\Actions\backstage\User\Suggests;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class BookingOrderController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '预约订单';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Order());
+
+        $grid->model()->wherein('product_type',[3,4,5]);
+
+        //筛选
+
+        $grid->filter(function ($filter){
+            $filter->disableIdFilter();
+            $filter->column(1/3, function ($filter) {
+                $filter->like('user.nickname','用户姓名');
+                $filter->like('docter.name','医生姓名');
+                $filter->like('orderPatient.name','患者姓名');
+            });
+            $filter->column(1/3, function ($filter) {
+                $filter->equal('user_id', '用户id');
+                $filter->equal('docter_id', '医生id');
+            });
+            $filter->column(1/3,function ($filter) {
+                $filter->equal('product_type','预约类型')->select(
+                    [
+                        3=>'门诊预约',
+                        4=>'疫苗接种预约',
+                        5=>'儿保预约'
+                    ]
+                );
+                $filter->equal('order_status','订单状态')->radio(
+                    [
+                        ''=>'不限',
+                        1=>'未支付',
+                        2=>'待接单',
+                        3=>'进行中',
+                        4=>'已完成',
+                        5=>'已取消'
+                    ]
+                );
+            });
+        });
+
+        $grid->actions(function ($actions) {
+            // 去掉删除
+            $actions->disableDelete();
+            // 去掉编辑
+            $actions->disableEdit();
+            // 去掉查看
+            $actions->disableView();
+            $actions->add(new OrderDetails());
+            $actions->add(new MapDepot());
+            $actions->add(new Suggests());
+        });
+
+        $grid->column('id', __('Id'))->sortable();
+        $grid->column('user_id', __('用户id'));
+        $grid->column('user.nickname', __('用户姓名'));
+        $grid->column('docter_id', __('医生id'));
+        $grid->column('docter.name', __('医生姓名'));
+        $grid->column('patient_id', __('患者id'));
+        $grid->column('orderPatient.name', __('患者姓名'));
+        $grid->column('orderPatient.appoint_start_time', __('预约日期'))->display(function ($time){
+            return date('Y-m-d H:i:s',$time);
+        });
+        $grid->column('orderPatient.appoint_end_time', __('就诊日期'))->display(function ($time){
+            return date('Y-m-d H:i:s',$time);
+        });
+        $grid->column('product_type', __('产品类型'))->using([3=>'门诊预约',4=>'疫苗接种预约',5=>'儿保预约']);
+        $grid->column('payment_type', __('支付方式'))->using([1=>'微信支付',2=>'余额支付']);
+        $grid->column('order_status', __('订单状态'))->using([1=>'未支付',2=>'待接单',3=>'进行中',4=>'已完成',5=>'已取消']);
+        $grid->column('payment_status', __('支付状态'))->using([1=>'待付款',2=>'已付款',3=>'退款中',4=>'已退款']);
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(Order::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('user_id', __('User id'));
+        $show->field('docter_id', __('Docter id'));
+        $show->field('patient_id', __('Patient id'));
+        $show->field('organization_id', __('Organization id'));
+        $show->field('order_sn', __('Order sn'));
+        $show->field('payment_type', __('Payment type'));
+        $show->field('product_type', __('Product type'));
+        $show->field('order_status', __('Order status'));
+        $show->field('payment_status', __('Payment status'));
+        $show->field('total_amount', __('Total amount'));
+        $show->field('payment_amount', __('Payment amount'));
+        $show->field('discount_amount', __('Discount amount'));
+        $show->field('payment_time', __('Payment time'));
+        $show->field('created_at', __('Created at'));
+        $show->field('updated_at', __('Updated at'));
+        $show->field('outtime', __('Outtime'));
+        $show->field('receiving_time', __('Receiving time'));
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Order());
+
+        $form->number('user_id', __('User id'));
+        $form->number('docter_id', __('Docter id'));
+        $form->number('patient_id', __('Patient id'));
+        $form->number('organization_id', __('Organization id'));
+        $form->text('order_sn', __('Order sn'));
+        $form->switch('payment_type', __('Payment type'))->default(1);
+        $form->switch('product_type', __('Product type'))->default(1);
+        $form->switch('order_status', __('Order status'))->default(1);
+        $form->switch('payment_status', __('Payment status'))->default(1);
+        $form->number('total_amount', __('Total amount'));
+        $form->number('payment_amount', __('Payment amount'));
+        $form->number('discount_amount', __('Discount amount'));
+        $form->number('payment_time', __('Payment time'));
+        $form->number('outtime', __('Outtime'));
+        $form->number('receiving_time', __('Receiving time'));
+
+        return $form;
+    }
+}

+ 143 - 0
app/Admin/Controllers/ConsultingOrdersController.php

xqd
@@ -0,0 +1,143 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Admin\Actions\backstage\Orders\OrderDetails;
+use App\Admin\Actions\backstage\User\MapDepot;
+use App\Admin\Actions\backstage\User\Suggests;
+use App\Models\Order;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class ConsultingOrdersController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '咨询订单';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Order());
+        $grid->model()->wherein('product_type',[1,2]);
+        //筛选
+        $grid->filter(function ($filter){
+            $filter->disableIdFilter();
+            $filter->column(1/2, function ($filter) {
+                $filter->like('user.nickname','用户姓名');
+                $filter->like('docter.name','医生姓名');
+                $filter->like('orderPatient.name','患者姓名');
+            });
+            $filter->column(1/2, function ($filter) {
+                $filter->equal('user_id', '用户id');
+                $filter->equal('docter_id', '医生id');
+                $filter->equal('order_status','订单状态')->radio(
+                    [
+                        ''=>'不限',
+                        1=>'未支付',
+                        2=>'待接单',
+                        3=>'进行中',
+                        4=>'已完成',
+                        5=>'已取消'
+                    ]
+                );
+            });
+        });
+        //操作
+        $grid->actions(function ($actions) {
+            // 去掉删除
+            $actions->disableDelete();
+            // 去掉编辑
+            $actions->disableEdit();
+            // 去掉查看
+            $actions->disableView();
+            $actions->add(new OrderDetails());
+            $actions->add(new MapDepot());
+            $actions->add(new Suggests());
+
+        });
+        $grid->column('id', __('Id'))->sortable();
+        $grid->column('user_id', __('用户id'));
+        $grid->column('user.nickname', __('用户姓名'));
+        $grid->column('docter_id', __('医生id'));
+        $grid->column('docter.name', __('医生姓名'));
+        $grid->column('patient_id', __('患者id'));
+        $grid->column('orderPatient.name', __('患者姓名'));
+        $grid->column('orderPatient.symptoms', __('患者描述'));
+        $grid->column('product_type', __('产品类型'))->using([1=>'电话咨询',2=>'图文咨询']);
+        $grid->column('payment_type', __('支付方式'))->using([1=>'微信支付',2=>'余额支付']);
+        $grid->column('order_status', __('订单状态'))->using([1=>'未支付',2=>'待接单',3=>'进行中',4=>'已完成',5=>'已取消']);
+        $grid->column('payment_status', __('支付状态'))->using([1=>'待付款',2=>'已付款',3=>'退款中',4=>'已退款']);
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(Order::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('user_id', __('User id'));
+        $show->field('docter_id', __('Docter id'));
+        $show->field('patient_id', __('Patient id'));
+        $show->field('organization_id', __('Organization id'));
+        $show->field('order_sn', __('Order sn'));
+        $show->field('payment_type', __('Payment type'));
+        $show->field('product_type', __('Product type'));
+        $show->field('order_status', __('Order status'));
+        $show->field('payment_status', __('Payment status'));
+        $show->field('total_amount', __('Total amount'));
+        $show->field('payment_amount', __('Payment amount'));
+        $show->field('discount_amount', __('Discount amount'));
+        $show->field('payment_time', __('Payment time'));
+        $show->field('created_at', __('Created at'));
+        $show->field('updated_at', __('Updated at'));
+        $show->field('outtime', __('Outtime'));
+        $show->field('receiving_time', __('Receiving time'));
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Order());
+
+        $form->number('user_id', __('User id'));
+        $form->number('docter_id', __('Docter id'));
+        $form->number('patient_id', __('Patient id'));
+        $form->number('organization_id', __('Organization id'));
+        $form->text('order_sn', __('Order sn'));
+        $form->switch('payment_type', __('Payment type'))->default(1);
+        $form->switch('product_type', __('Product type'))->default(1);
+        $form->switch('order_status', __('Order status'))->default(1);
+        $form->switch('payment_status', __('Payment status'))->default(1);
+        $form->number('total_amount', __('Total amount'));
+        $form->number('payment_amount', __('Payment amount'));
+        $form->number('discount_amount', __('Discount amount'));
+        $form->number('payment_time', __('Payment time'));
+        $form->number('outtime', __('Outtime'));
+        $form->number('receiving_time', __('Receiving time'));
+
+        return $form;
+    }
+}

+ 2 - 0
app/Admin/Controllers/DocterTeamController.php

xqd
@@ -38,6 +38,8 @@ class DocterTeamController extends AdminController
         $grid->column('docter_id', __('医生id'));
         $grid->column('docter.name', __('医生姓名'));
         $grid->column('team_id', __('团队id'));
+        $grid->column('team.name', __('团队名称'));
+        $grid->column('team.introduction', __('团队简介'));
         $grid->column('created_at', __('创建时间'));
         $grid->column('updated_at', __('更新时间'));
 

+ 92 - 0
app/Admin/Controllers/IconsDoctorController.php

xqd
@@ -0,0 +1,92 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Icons;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class IconsDoctorController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '图标管理——医生端';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Icons());
+
+        $grid->model()->where('type_cl','2');
+        $grid->column('id', __('Id'));
+        $grid->column('name', __('功能图标名称'));
+        $grid->column('image', __('图片'))->image('','50','50');
+        $grid->column('url', __('点击链接'));
+        $grid->column('type', __('类别'))->using([1=>'首页']);
+        $grid->column('laval', __('顺序'));
+        $status = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $grid->column('status', __('状态'))->switch($status);
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(Icons::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('name', __('功能图标名称'));
+        $show->field('image', __('图片'))->image();
+        $show->field('url', __('点击链接'));
+        $show->field('type', __('类别'));
+        $show->field('laval', __('顺序'));
+        $show->field('status', __('状态'));
+        $show->field('created_at', __('创建时间'));
+        $show->field('updated_at', __('更新时间'));
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Icons());
+
+        $form->text('name', __('名称'))->rules('required' ,['required'=>'请填写名称!']);
+        $form->image('image', __('图片'))->rules('required' ,['required'=>'请选择图片!']);
+        $form->text('url', __('点击地址'))->rules('required',['requried'=>'请填写点击地址']);
+        $form->hidden('type', __('分类'))->options(Icons::$_post_type)->default(2);
+        $form->number('laval', __('顺序'));
+        $status = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $form->switch('status', __('Status'))->states($status);
+
+        return $form;
+    }
+}

+ 93 - 0
app/Admin/Controllers/IconsUserController.php

xqd
@@ -0,0 +1,93 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Icons;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class IconsUserController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '图标管理——用户端';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Icons());
+
+        $grid->model()->where('type_cl','1');
+        $grid->column('id', __('Id'));
+        $grid->column('name', __('功能图标名称'));
+        $grid->column('image', __('图片'))->image('','50','50');
+        $grid->column('url', __('点击链接'));
+        $grid->column('type', __('类别'))->using([1=>'首页',2=>'文章中心',3=>'个人中心']);
+        $grid->column('laval', __('顺序'));
+        $status = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $grid->column('status', __('状态'))->switch($status);
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(Icons::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('name', __('功能图标名称'));
+        $show->field('image', __('图片'))->image();
+        $show->field('url', __('点击链接'));
+        $show->field('type', __('类别'));
+        $show->field('laval', __('顺序'));
+        $show->field('status', __('状态'));
+        $show->field('created_at', __('创建时间'));
+        $show->field('updated_at', __('更新时间'));
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Icons());
+
+        $form->text('name', __('名称'))->rules('required' ,['required'=>'请填写名称!']);
+        $form->image('image', __('图片'))->rules('required' ,['required'=>'请选择图片!']);
+        $form->text('url', __('点击地址'))->rules('required',['requried'=>'请填写点击地址']);
+        $form->hidden('type_cl')->default(1);
+        $form->select('type', __('分类'))->options(Icons::$_post_type)->default(1);
+        $form->number('laval', __('顺序'));
+        $status = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $form->switch('status', __('Status'))->states($status);
+
+        return $form;
+    }
+}

+ 66 - 0
app/Admin/Controllers/MenubarController.php

xqd
@@ -0,0 +1,66 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Menubar;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class MenubarController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = 'Menubar';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Menubar());
+
+        $grid->column('id', __('Id'));
+        $grid->column('name', __('名称'));
+        $grid->column('image', __('默认图片'))->image('','50','50');
+        $grid->column('image_at', __('点击图片'))->image('','50','50');
+        $grid->column('url', __('链接'));
+        $status = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $grid->column('status', __('状态'))->switch($status);
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+
+        return $grid;
+    }
+
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Menubar());
+
+        $form->text('name', __('名称'));
+        $form->image('image', __('默认图片'));
+        $form->image('image_at', __('Image at'));
+        $form->text('url', __('Url'));
+        $status = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $form->switch('status', __('状态'))->states($status);
+        return $form;
+    }
+}

+ 64 - 0
app/Admin/Controllers/NoticeDoctorController.php

xqd
@@ -0,0 +1,64 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Notice;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class NoticeDoctorController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '公告->用户';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Notice());
+
+        $grid->model()->where('type','2');
+        $grid->column('id', __('Id'));
+        $grid->column('title', __('标题'));
+        $grid->column('content', __('内容'));
+        $grid->column('url', __('链接'));
+        $status = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $grid->column('status', __('状态'))->switch($status);
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+
+        return $grid;
+    }
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Notice());
+
+        $form->text('title', __('标题'))->rules('required|min:3|max:255',['required'=>'请填写标题','min'=>'标题字符不能少于3个','max'=>'标题长度过长']);
+        $form->editor('content', __('内容'))->rules('required' ,['required'=>'请填写内容!']);
+        $form->url('url', __('链接'))->rules('required',['required'=>'请填写链接']);
+        $form->hidden('type', __('分类'))->default('2');
+        $status = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $form->switch('status', __('状态'))->states($status);
+        return $form;
+    }
+}

+ 64 - 0
app/Admin/Controllers/NoticeUserController.php

xqd
@@ -0,0 +1,64 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Notice;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class NoticeUserController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '公告->用户';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Notice());
+
+        $grid->model()->where('type','2');
+        $grid->column('id', __('Id'));
+        $grid->column('title', __('标题'));
+        $grid->column('content', __('内容'));
+        $grid->column('url', __('链接'));
+        $status = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $grid->column('status', __('状态'))->switch($status);
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+
+        return $grid;
+    }
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Notice());
+
+        $form->text('title', __('标题'))->rules('required|min:3|max:255',['required'=>'请填写标题','min'=>'标题字符不能少于3个','max'=>'标题长度过长']);
+        $form->editor('content', __('内容'))->rules('required' ,['required'=>'请填写内容!']);
+        $form->url('url', __('链接'))->rules('required',['required'=>'请填写链接']);
+        $form->hidden('type', __('分类'))->default('1');
+        $status = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $form->switch('status', __('状态'))->states($status);
+        return $form;
+    }
+}

+ 124 - 0
app/Admin/Controllers/OrdersDetailsController.php

xqd
@@ -0,0 +1,124 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Order;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class OrdersDetailsController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '订单详情';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Order());
+        $grid->disableActions();
+        $grid->column('id', __('Id'));
+        $grid->column('product_type', __('产品类型'))->using([
+            1=>'电话咨询',
+            2=>'图文咨询',
+            3=>'门诊预约',
+            4=>'疫苗接种预约',
+            5=>'儿保预约',
+            6=>'服务包',
+            7=>'充值订单'
+        ]);
+        $grid->column('payment_type', __('支付方式'))->using([1=>'微信支付',2=>'余额支付']);
+        $grid->column('order_status', __('订单状态'))->using([1=>'未支付',2=>'待接单',3=>'进行中',4=>'已完成',5=>'已取消']);
+        $grid->column('payment_status', __('支付状态'))->using([1=>'待付款',2=>'已付款',3=>'退款中',4=>'已退款']);
+        $grid->column('payment_time', __('支付时间'))->display(function ($time){
+            return date('Y-m-d H:i:s',$time);
+        });
+        $grid->column('receiving_time', __('接单时间'))->display(function ($time){
+            return date('Y-m-d H:i:s',$time);
+        });
+        $grid->column('end_time', __('订单完成时间'))->display(function ($time){
+            return date('Y-m-d H:i:s',$time);
+        });
+        $grid->column('total_amount', __('订单总金额'))->display(function ($money){
+            return $money/100;
+        });
+        $grid->column('payment_amount', __('用户实际支付的金额'))->display(function ($money){
+            return $money/100;
+        });
+        $grid->column('discount_amount', __('折扣金额'))->display(function ($money){
+            return $money/100;
+        });
+
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(Order::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('user_id', __('User id'));
+        $show->field('docter_id', __('Docter id'));
+        $show->field('patient_id', __('Patient id'));
+        $show->field('organization_id', __('Organization id'));
+        $show->field('order_sn', __('Order sn'));
+        $show->field('payment_type', __('Payment type'));
+        $show->field('product_type', __('Product type'));
+        $show->field('order_status', __('Order status'));
+        $show->field('payment_status', __('Payment status'));
+        $show->field('total_amount', __('Total amount'));
+        $show->field('payment_amount', __('Payment amount'));
+        $show->field('discount_amount', __('Discount amount'));
+        $show->field('payment_time', __('Payment time'));
+        $show->field('created_at', __('Created at'));
+        $show->field('updated_at', __('Updated at'));
+        $show->field('outtime', __('Outtime'));
+        $show->field('receiving_time', __('Receiving time'));
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Order());
+
+        $form->number('user_id', __('User id'));
+        $form->number('docter_id', __('Docter id'));
+        $form->number('patient_id', __('Patient id'));
+        $form->number('organization_id', __('Organization id'));
+        $form->text('order_sn', __('Order sn'));
+        $form->switch('payment_type', __('Payment type'))->default(1);
+        $form->switch('product_type', __('Product type'))->default(1);
+        $form->switch('order_status', __('Order status'))->default(1);
+        $form->switch('payment_status', __('Payment status'))->default(1);
+        $form->number('total_amount', __('Total amount'));
+        $form->number('payment_amount', __('Payment amount'));
+        $form->number('discount_amount', __('Discount amount'));
+        $form->number('payment_time', __('Payment time'));
+        $form->number('outtime', __('Outtime'));
+        $form->number('receiving_time', __('Receiving time'));
+
+        return $form;
+    }
+}

+ 139 - 0
app/Admin/Controllers/RechargeOrderController.php

xqd
@@ -0,0 +1,139 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Order;
+use App\Admin\Actions\backstage\Orders\OrderDetails;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class RechargeOrderController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '充值订单';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Order());
+
+        $grid->model()->wherein('product_type',[7]);
+
+        //筛选
+
+        $grid->filter(function ($filter){
+            $filter->disableIdFilter();
+                $filter->like('user.nickname','用户姓名');
+                $filter->equal('user_id', '用户id');
+                $filter->equal('order_status','订单状态')->radio(
+                    [
+                        ''=>'不限',
+                        1=>'未支付',
+                        2=>'待接单',
+                        3=>'进行中',
+                        4=>'已完成',
+                        5=>'已取消'
+                    ]
+                );
+            });
+
+        $grid->actions(function ($actions) {
+            // 去掉删除
+            $actions->disableDelete();
+            // 去掉编辑
+            $actions->disableEdit();
+            // 去掉查看
+            $actions->disableView();
+            $actions->add(new OrderDetails());
+        });
+
+        $grid->column('id', __('Id'))->sortable();
+        $grid->column('user_id', __('用户id'));
+        $grid->column('user.nickname', __('用户姓名'));
+        $grid->column('product_type', __('产品类型'))->using([7=>'充值订单']);
+        $grid->column('payment_type', __('支付方式'))->using([1=>'微信支付',2=>'余额支付']);
+        $grid->column('total_amount', __('订单总金额'))->display(function ($money){
+            return $money/100;
+        });
+        $grid->column('payment_amount', __('用户实际支付的金额'))->display(function ($money){
+            return $money/100;
+        });
+        $grid->column('discount_amount', __('折扣金额'))->display(function ($money){
+            return $money/100;
+        });
+        $grid->column('order_status', __('订单状态'))->using([1=>'未支付',2=>'待接单',3=>'进行中',4=>'已完成',5=>'已取消']);
+        $grid->column('payment_status', __('支付状态'))->using([1=>'待付款',2=>'已付款',3=>'退款中',4=>'已退款']);
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(Order::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('user_id', __('User id'));
+        $show->field('docter_id', __('Docter id'));
+        $show->field('patient_id', __('Patient id'));
+        $show->field('organization_id', __('Organization id'));
+        $show->field('order_sn', __('Order sn'));
+        $show->field('payment_type', __('Payment type'));
+        $show->field('product_type', __('Product type'));
+        $show->field('order_status', __('Order status'));
+        $show->field('payment_status', __('Payment status'));
+        $show->field('total_amount', __('Total amount'));
+        $show->field('payment_amount', __('Payment amount'));
+        $show->field('discount_amount', __('Discount amount'));
+        $show->field('payment_time', __('Payment time'));
+        $show->field('created_at', __('Created at'));
+        $show->field('updated_at', __('Updated at'));
+        $show->field('outtime', __('Outtime'));
+        $show->field('receiving_time', __('Receiving time'));
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Order());
+
+        $form->number('user_id', __('User id'));
+        $form->number('docter_id', __('Docter id'));
+        $form->number('patient_id', __('Patient id'));
+        $form->number('organization_id', __('Organization id'));
+        $form->text('order_sn', __('Order sn'));
+        $form->switch('payment_type', __('Payment type'))->default(1);
+        $form->switch('product_type', __('Product type'))->default(1);
+        $form->switch('order_status', __('Order status'))->default(1);
+        $form->switch('payment_status', __('Payment status'))->default(1);
+        $form->number('total_amount', __('Total amount'));
+        $form->number('payment_amount', __('Payment amount'));
+        $form->number('discount_amount', __('Discount amount'));
+        $form->number('payment_time', __('Payment time'));
+        $form->number('outtime', __('Outtime'));
+        $form->number('receiving_time', __('Receiving time'));
+
+        return $form;
+    }
+}

+ 146 - 0
app/Admin/Controllers/ServicePackOrderController.php

xqd
@@ -0,0 +1,146 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Order;
+use App\Admin\Actions\backstage\Orders\OrderDetails;
+use Encore\Admin\Controllers\AdminController;
+use App\Admin\Actions\backstage\User\MapDepot;
+use App\Admin\Actions\backstage\User\Suggests;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class ServicePackOrderController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '服务包订单';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Order());
+        $grid->model()->wherein('product_type',[6]);
+        //筛选
+        $grid->filter(function ($filter){
+            $filter->disableIdFilter();
+            $filter->column(1/2, function ($filter) {
+                $filter->like('user.nickname','用户姓名');
+                $filter->like('docter.name','医生姓名');
+                $filter->like('orderPatient.name','患者姓名');
+            });
+            $filter->column(1/2, function ($filter) {
+                $filter->equal('user_id', '用户id');
+                $filter->equal('docter_id', '医生id');
+                $filter->equal('order_status','订单状态')->radio(
+                    [
+                        ''=>'不限',
+                        1=>'未支付',
+                        2=>'待接单',
+                        3=>'进行中',
+                        4=>'已完成',
+                        5=>'已取消'
+                    ]
+                );
+            });
+        });
+        //操作
+        $grid->actions(function ($actions) {
+            // 去掉删除
+            $actions->disableDelete();
+            // 去掉编辑
+            $actions->disableEdit();
+            // 去掉查看
+            $actions->disableView();
+            $actions->add(new OrderDetails());
+            $actions->add(new MapDepot());
+            $actions->add(new Suggests());
+        });
+        $grid->column('id', __('Id'))->sortable();
+        $grid->column('user_id', __('用户id'));
+        $grid->column('user.nickname', __('用户姓名'));
+        $grid->column('docter_id', __('医生id'));
+        $grid->column('docter.name', __('医生姓名'));
+        $grid->column('patient_id', __('患者id'));
+        $grid->column('orderPatient.name', __('患者姓名'));
+        $grid->column('orderPack.service_pack_id', __('服务包id'));
+        $grid->column('orderPack.pack_name', __('服务包名称'));
+        $grid->column('orderPack.pack_price', __('服务包价格'))->display(function ($money){
+            return $money/100;
+        });
+        $grid->column('product_type', __('产品类型'))->using([6=>'服务包订单']);
+        $grid->column('payment_type', __('支付方式'))->using([1=>'微信支付',2=>'余额支付']);
+        $grid->column('order_status', __('订单状态'))->using([1=>'未支付',2=>'待接单',3=>'进行中',4=>'已完成',5=>'已取消']);
+        $grid->column('payment_status', __('支付状态'))->using([1=>'待付款',2=>'已付款',3=>'退款中',4=>'已退款']);
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(Order::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('user_id', __('User id'));
+        $show->field('docter_id', __('Docter id'));
+        $show->field('patient_id', __('Patient id'));
+        $show->field('organization_id', __('Organization id'));
+        $show->field('order_sn', __('Order sn'));
+        $show->field('payment_type', __('Payment type'));
+        $show->field('product_type', __('Product type'));
+        $show->field('order_status', __('Order status'));
+        $show->field('payment_status', __('Payment status'));
+        $show->field('total_amount', __('Total amount'));
+        $show->field('payment_amount', __('Payment amount'));
+        $show->field('discount_amount', __('Discount amount'));
+        $show->field('payment_time', __('Payment time'));
+        $show->field('created_at', __('Created at'));
+        $show->field('updated_at', __('Updated at'));
+        $show->field('outtime', __('Outtime'));
+        $show->field('receiving_time', __('Receiving time'));
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Order());
+
+        $form->number('user_id', __('User id'));
+        $form->number('docter_id', __('Docter id'));
+        $form->number('patient_id', __('Patient id'));
+        $form->number('organization_id', __('Organization id'));
+        $form->text('order_sn', __('Order sn'));
+        $form->switch('payment_type', __('Payment type'))->default(1);
+        $form->switch('product_type', __('Product type'))->default(1);
+        $form->switch('order_status', __('Order status'))->default(1);
+        $form->switch('payment_status', __('Payment status'))->default(1);
+        $form->number('total_amount', __('Total amount'));
+        $form->number('payment_amount', __('Payment amount'));
+        $form->number('discount_amount', __('Discount amount'));
+        $form->number('payment_time', __('Payment time'));
+        $form->number('outtime', __('Outtime'));
+        $form->number('receiving_time', __('Receiving time'));
+
+        return $form;
+    }
+}

+ 108 - 0
app/Admin/Controllers/ServicePacksController.php

xqd
@@ -0,0 +1,108 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\ServicePack;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class ServicePacksController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = 'ServicePack';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+        protected function grid()
+    {
+        $grid = new Grid(new ServicePack());
+
+        $grid->disableActions();
+        $grid->column('id', __('Id'));
+        $grid->column('name', __('服务包名称'));
+        $grid->column('intro', __('简介'));
+        $grid->column('desc', __('详细内容'))->limit(100);
+        $grid->column('label','服务类型')->display(function (){
+            $tag = [1 => '图文',2 => '电话',3 => '门诊',4 => '计免',5 => '儿保'];
+            $data = $this -> label;
+            if($data){
+                for ($i=0;$i<count($data);$i++){
+                    $str = $tag[$data[$i]];
+                    $label[$i]= $str;
+                }
+                return $label;
+                    }
+            return 0;
+        })->label('info');
+        $grid->column('price', __('价格'));
+        $grid->column('team_id', __('团队名称'));
+        $grid->column('image','图片')->image('','50','50');
+        $grid->column('phone_minutes', __('电话次数(分钟)'));
+        $grid->column('chat_num', __('图文次数'));
+        $grid->column('appoint_num', __('门诊次数'));
+        $grid->column('vaccine_limit_amount', __('计免次数'));
+        $grid->column('nurses_limit_amount', __('儿保次数'));
+        $grid->column('effective_days', __('服务时长'));
+        $grid->column('insurance_policy', __('保单名称'));
+        $grid->column('insurance_img_url', __('保单图片链接'));
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+
+        return $grid;
+    }
+        /**
+         * Make a form builder.
+         *
+         * @return Form
+         */
+        protected function form()
+    {
+        $form = new Form(new ServicePack());
+
+        $form->text('name', __('服务包名称'))->rules('required' ,['required'=>'请填写名称!']);
+        $form->image('image','图片')->rules('required' ,['required'=>'请选择图片!']);
+        $form->text('intro', __('简介'))->rules('required' ,['required'=>'请填写简介!']);;
+        $form->editor('desc', __('详情内容'))->rules('required' ,['required'=>'请填写内容!']);;
+        $form->number('price', __('价钱'))->default(0);
+        $form->text('team_id', __('团队ID'));
+        //$form->multipleSelect('label','服务类型')->options([1 => '图文',2 => '电话',3 => '门诊',4 => '计免',5 => '儿保']);
+        $form->checkbox('label','服务类型')
+            ->options([
+                1 => '图文',
+                2 => '电话',
+                3 => '门诊',
+                4 => '计免',
+                5 => '儿保'
+            ])->when('has',1,function (Form $form){
+                $form->number('chat_num', __('图文次数'))->default(0);
+            })->when('has',2,function (Form $form){
+                $form->number('phone_minutes', __('电话次数(分钟)'))->default(0);
+            })->when('has',3,function (Form $form){
+                $form->number('appoint_num', __('门诊次数'))->default(0);
+            })->when('has',4,function (Form $form){
+                $form->number('vaccine_limit_amount', __('计免次数'))->default(0);
+            })->when('has',5,function (Form $form){
+                $form->number('nurses_limit_amount', __('儿保次数'))->default(0);
+            });
+
+//        $form->number('phone_minutes', __('电话次数(分钟)'))->default(0);
+//        $form->number('chat_num', __('图文次数'))->default(0);
+//        $form->number('appoint_num', __('门诊次数'))->default(0);
+//        $form->number('vaccine_limit_amount', __('计免次数'))->default(0);
+//        $form->number('nurses_limit_amount', __('儿保次数'))->default(0);
+        $form->text('effective_days', __('服务时长(秒)'))->default(0);
+        $form->text('insurance_policy', __('保单名称'))->rules('required' ,['required'=>'请填写保单名称!']);;
+        $form->text('insurance_img_url', __('保单图片链接'))->rules('required' ,['required'=>'请填写保单图片链接!']);;
+
+        return $form;
+    }
+}

+ 1 - 0
app/Admin/Controllers/SignUpController.php

xqd
@@ -25,6 +25,7 @@ class SignUpController extends AdminController
     protected function grid()
     {
         $grid = new Grid(new DocterOrganization());
+        $grid->disableActions();
         $docter_id = \request('docter_id');
         $grid->filter(function ($filter){
             $filter->disableIdFilter();

+ 11 - 11
app/Admin/Controllers/UserListController.php

xqd
@@ -31,17 +31,17 @@ class UserListController extends AdminController
     {
         $grid = new Grid(new User());
         $grid->actions(function ($actions) {
-            // 去掉删除
-            $actions->disableDelete();
-            // 去掉编辑
-            $actions->disableEdit();
-            // 去掉查看
-            $actions->disableView();
-            $actions->add(new archives());
-            $actions->add(new BalanceLog());
-            $actions->add(new BlackList());
-            $actions->add(new coupons());
-        });
+        // 去掉删除
+        $actions->disableDelete();
+        // 去掉编辑
+        $actions->disableEdit();
+        // 去掉查看
+        $actions->disableView();
+        $actions->add(new archives());
+        $actions->add(new BalanceLog());
+        $actions->add(new BlackList());
+        $actions->add(new coupons());
+    });
         //筛选
         $grid->filter(function ($filter){
             $filter->disableIdFilter();

+ 2 - 0
app/Admin/Controllers/UserPatientsController.php

xqd
@@ -33,6 +33,8 @@ class UserPatientsController extends AdminController
         $grid->filter(function ($filter){
             $filter->disableIdFilter();
             $filter->equal('user_id','用户id');
+            $filter->equal('id','患者id');
+            $filter->like('name','患者姓名');
         });
         $grid->actions(function ($actions) {
             // 去掉删除

+ 1 - 1
app/Admin/bootstrap.php

xqd
@@ -18,4 +18,4 @@
  *
  */
 
-Encore\Admin\Form::forget(['map', 'editor']);
+//Encore\Admin\Form::forget(['map', 'editor']);

+ 24 - 0
app/Admin/routes.php

xqd xqd xqd
@@ -13,11 +13,13 @@ Route::group([
     $router->get('/', 'HomeController@index')->name('home');
     $router->get('/api/getCity', 'ApiController@getCity');
     $router->get('/api/getArea', 'ApiController@getArea');
+    $router->post('/img_upload', 'Api\ApiController@upload');
     $router->resource('/cdms_user', CdmsController::class);
     $router->resource('/organizations', OrganizationController::class);
     $router->resource('/docters', DocterController::class);
     $router->resource('/docters_approve', ApproveController::class);
     $router->resource('banners', BannerController::class);
+    //服务包海报
     $router->resource('servebanners', ServebannerController::class);
     //文章管理
     $router->resource('articles', ArticleController::class);
@@ -41,6 +43,16 @@ Route::group([
     //门诊咨询认证
     $router->resource('outpatient_service_cc',OutpatientServiceCCController::class);
     $router->resource('outpatient_service',OutpatientServiceController::class);
+    //图标DIV
+    $router->resource('icons_user', IconsUserController::class);
+    $router->resource('icons_doctor', IconsDoctorController::class);
+    //公告管理->用户&医生
+    $router->resource('notices_user', NoticeUserController::class);
+    $router->resource('notices_doctor', NoticeDoctorController::class);
+    //小程序->用户端->底部菜单
+    $router->resource('menubars', MenubarController::class);
+
+    $router->resource('service_packs', ServicePacksController::class);
 
     $router->resource('/setting', 'Config\ConfigController');
     $router->get('/setting_form', 'Config\FormController@form');
@@ -61,5 +73,17 @@ Route::group([
     $router->resource('sign_up', SignUpController::class);
     //医生管理->团队管理
     $router->resource('docter_team', DocterTeamController::class);
+    //订单管理->咨询订单
+    $router->resource('consulting_orders', ConsultingOrdersController::class);
+    //订单管理->咨询/预约/服务包订单->订单详情
+    $router->resource('orders_details', OrdersDetailsController::class);
+    //订单管理->预约订单
+    $router->resource('booking_order', BookingOrderController::class);
+    //订单管理->服务包管理
+    $router->resource('service_pack_order', ServicePackOrderController::class);
+    //订单管理->充值订单
+    $router->resource('recharge_order', RechargeOrderController::class);
+    //优惠券管理->优惠券列表
+    $router->resource('coupons', CouponManagement\CouponManagementController::class);
 });
 

+ 1 - 0
app/Http/Controllers/Api/V1/UserController.php

xqd
@@ -22,6 +22,7 @@ class UserController extends AuthController
     {
         $user = $this->user;
 
+        $user['is_set_pay_password'] = !empty($user['pay_password']) ? 1 : 0;
         unset($user['session_key'], $user['pay_password']);
 
         $user['coupon_num'] = UserCoupon::where('user_id', $user['id'])->where('status', 1)->where('expire_time', '>', time())->count();

+ 17 - 0
app/Models/Icons.php

xqd
@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Icons extends Model
+{
+    //
+    protected $table = 'icons';
+
+    public static $_post_type = [
+        1 => '首页',
+        2 => '文章中心',
+        3 => '个人中心'
+    ];
+}

+ 11 - 0
app/Models/Menubar.php

xqd
@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Menubar extends Model
+{
+    //
+    protected $table = 'menubar';
+}

+ 1 - 0
app/Models/Notice.php

xqd
@@ -7,4 +7,5 @@ use Illuminate\Database\Eloquent\Model;
 class Notice extends Model
 {
     //
+    protected $table = 'notices';
 }

+ 4 - 0
app/Models/ServicePack.php

xqd
@@ -10,6 +10,10 @@ namespace App\Models;
 
 class ServicePack extends BaseModel
 {
+    protected $table = 'service_packs';
+    protected $casts = [
+        'label' => 'json',
+    ];
     public function team()
     {
         return $this->belongsTo(Team::class);

+ 4 - 0
app/Models/Team.php

xqd
@@ -10,6 +10,10 @@ namespace App\Models;
 
 class Team extends BaseModel
 {
+    public function TeamDocter()
+    {
+        return $this->belongsTo(TeamDocter::class,'team_id','id');
+    }
     public function docter()
     {
         return $this->belongsToMany(Docter::class, 'team_docters');

+ 3 - 0
app/Models/TeamDocter.php

xqd
@@ -10,6 +10,9 @@ namespace App\Models;
 
 class TeamDocter extends BaseModel
 {
+    public function team(){
+        return $this->hasOne(Team::class,'id','team_id');
+    }
     public function DocterOrganization(){
         return $this->belongsTo(DocterOrganization::class);
     }

+ 3 - 2
composer.json

xqd
@@ -11,12 +11,13 @@
         "php": "^7.2",
         "encore/laravel-admin": "1.*",
         "fideloper/proxy": "^4.0",
+        "jxlwqq/wang-editor2": "^1.0",
         "laravel-admin-ext/multitenancy": "^2.1",
         "laravel/framework": "^6.0",
         "laravel/tinker": "^1.0",
+        "maatwebsite/excel": "^3.1",
         "overtrue/wechat": "^4.0",
-        "sven/artisan-view": "^3.3",
-        "maatwebsite/excel": "^3.1"
+        "sven/artisan-view": "^3.3"
     },
     "require-dev": {
         "filp/whoops": "^2.0",

+ 63 - 1
composer.lock

xqd xqd
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "418bc0dda52cb02116262b36b99e5be4",
+    "content-hash": "fc6e57f3eeb15c03a65075f447c88400",
     "packages": [
         {
             "name": "dnoegel/php-xdg-base-dir",
@@ -1097,6 +1097,68 @@
             "abandoned": "php-parallel-lint/php-console-highlighter",
             "time": "2018-09-29T18:48:56+00:00"
         },
+        {
+            "name": "jxlwqq/wang-editor2",
+            "version": "1.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/laravel-admin-extensions/wangEditor2.git",
+                "reference": "46622fe683c076718e6bee1e5bb9b8ad842fd0cd"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/laravel-admin-extensions/wangEditor2/zipball/46622fe683c076718e6bee1e5bb9b8ad842fd0cd",
+                "reference": "46622fe683c076718e6bee1e5bb9b8ad842fd0cd",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "encore/laravel-admin": "~1.6",
+                "php": ">=7.0.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~6.0"
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "Jxlwqq\\WangEditor2\\WangEditor2ServiceProvider"
+                    ]
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Jxlwqq\\WangEditor2\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "jxlwqq",
+                    "email": "jxlwqq@gmail.com"
+                }
+            ],
+            "description": "wang-editor2 for laravel-admin",
+            "homepage": "https://github.com/jxlwqq/wangEditor2",
+            "keywords": [
+                "extension",
+                "laravel-admin"
+            ],
+            "support": {
+                "issues": "https://github.com/jxlwqq/wangEditor2/issues",
+                "source": "https://github.com/jxlwqq/wangEditor2/tree/master"
+            },
+            "time": "2018-12-04T04:15:44+00:00"
+        },
         {
             "name": "laravel-admin-ext/multitenancy",
             "version": "v2.1.7",

+ 42 - 0
config/admin.php

xqd
@@ -430,6 +430,48 @@ return [
         ],
         'multitenancy' => [
             'tenancy' => config_path('tenancy.php'),
+        ],
+        'wang-editor2' => [
+            // 如果要关掉这个扩展,设置为false
+            'enable' => true,
+            // 编辑器的配置
+            'config' => [
+                'uploadImgFileName' => 'up_image', //这个应该wangEditor的上传方法名字,不要乱改
+                'uploadImgUrl' => '/admin/upload', //注意这里是上传的路由地址
+                'menus' => [
+                    'source',
+                    '|',
+                    'bold',
+                    'underline',
+                    'italic',
+                    'strikethrough',
+                    'eraser',
+                    'forecolor',
+                    'bgcolor',
+                    '|',
+                    'quote',
+                    'fontfamily',
+                    'fontsize',
+                    'head',
+                    'unorderlist',
+                    'orderlist',
+                    'alignleft',
+                    'aligncenter',
+                    'alignright',
+                    '|',
+                    'link',
+                    'unlink',
+                    'table',
+                    '|',
+                    'img',
+                    'video',
+                    'insertcode',
+                    '|',
+                    'undo',
+                    'redo',
+                    'fullscreen'
+                ],
+            ]
         ]
     ],
 ];

+ 1 - 1
database/migrations/2020_11_24_065951_add_table_bm_service_apply.php

xqd
@@ -30,6 +30,6 @@ class AddTableBmServiceApply extends Migration
      */
     public function down()
     {
-        Schema::drop('service_apply');
+        Schema::drop('service_applys');
     }
 }

+ 39 - 0
database/migrations/2020_12_02_020655_create_icons_table.php

xqd
@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateIconsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('icons', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->string('name')->comment('功能图标名称');
+            $table->string('image')->comment('图片');
+            $table->string('url')->comment('点击链接');
+            $table->integer('type')->comment('类型 1.首页 2.文章中心 3.个人中心');
+            $table->integer('type_cl')->comment('分类2 1.用户端 2.客户端');
+            $table->integer('laval')->comment('排序');
+            $table->integer('status')->comment('状态 0.禁用 1.启用')->nullable(false)->unsigned();
+            $table->dateTime('created_at')->comment('创建时间');
+            $table->dateTime('updated_at')->comment('更新时间');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('icons');
+    }
+}

+ 37 - 0
database/migrations/2020_12_02_063339_create_notice_table.php

xqd
@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateNoticeTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('notices', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->string('title')->comment('公告标题');
+            $table->text('content')->comment('公告内容');
+            $table->string('url')->comment('公告链接');
+            $table->integer('type')->comment('类型 1.用户端 2.医生端');
+            $table->integer('status')->comment('状态 0.禁用 1.启用')->nullable(false)->unsigned();
+            $table->dateTime('created_at')->comment('创建时间');
+            $table->dateTime('updated_at')->comment('更新时间');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('notices');
+    }
+}

+ 37 - 0
database/migrations/2020_12_02_075125_create_menubar_table.php

xqd
@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateMenubarTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('menubar', function (Blueprint $table) {
+            $table->bigIncrements('id');
+            $table->string('name')->comment('名称');
+            $table->text('image')->comment('默认图片');
+            $table->text('image_at')->comment('点击后的图片');
+            $table->string('url')->comment('链接');
+            $table->integer('status')->comment('状态 0.禁用 1.启用')->nullable(false)->unsigned();
+            $table->dateTime('created_at')->comment('创建时间');
+            $table->dateTime('updated_at')->comment('更新时间');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('menubar');
+    }
+}