Browse Source

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

zilong 4 years ago
parent
commit
beca09d985

+ 81 - 71
app/Admin/Actions/backstage/Coupon/AllCouponBatchGrant.php

xqd
@@ -7,108 +7,118 @@ use App\Models\CouponType;
 use App\Models\UserCoupon;
 use Encore\Admin\Actions\BatchAction;
 use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Http\Request;
 
 class AllCouponBatchGrant extends BatchAction
 {
     public $name = '后台所有优惠券批量发放';
 
-    public function handle(Collection $collection)
+    public function handle(Collection $collection,Request $request)
     {
         //计算总共要发放多少个用户
         $user_arr = $collection->toArray();
         $user_num = count($user_arr);
+        //每种优惠券要发放几张
+        $coupon_num = $request->get('num');
+        //单种优惠券一共要发放几张
+        $all_num = $user_num*$coupon_num;
         //获取所有类型为后台发放的优惠券
         $allcoupon = Coupon::where('position_type',2)->get();
         $coupon_arr = $allcoupon->toArray();
         //判断优惠券数量是否充足
         foreach ($coupon_arr as $value)
         {
-            if ($value['num'] < $user_num)
+            if ($value['num'] < $all_num)
             {
                 return $this->response()->error('优惠券'.$value['name'].'的数量不足')->refresh();
             }
         }
 
-        foreach ($coupon_arr as $coupon)
+        for ($i = 0;$i<$coupon_num;$i++)
         {
-            //拿到基础数据
-            //获取过期类型是指定几天过期
-            if ($coupon['expire_type'] == 1){
-                $effective_days = $coupon['effective_days'];
-                $str_time = '+'.$effective_days.'day';
-                $expire_time_num = strtotime($str_time);
-                $arr = [
-                    'user_id' => 0,
-                    'coupon_id'=>$coupon['id'],
-                    'name' => $coupon['name'],
-                    'title' => $coupon['title'],
-                    'desc' => $coupon['desc'],
-                    'rules' => $coupon['rules'],
-                    'icon' => $coupon['icon'],
-                    'type' => $coupon['type'],
-                    'usable_type' => $coupon['usable_type'],
-                    'money' => $coupon['money'],
-                    'discount' => $coupon['discount'],
-                    'min_consume_amount' => $coupon['min_consume_amount'],
-                    'max_reduce_amount' => $coupon['max_reduce_amount'],
-                    'expire_type' => $coupon['expire_type'],
-                    'effective_days' => $coupon['effective_days'],
-                    'expire_time' => $expire_time_num,
-//                'coupons_num'=>0
-                ];
-            }else if ($coupon->expire_type == 2){
-                //设置有效期的基础数据
-                $arr = [
-                    'user_id' => 0,
-                    'coupon_id'=>$coupon['id'],
-                    'name' => $coupon['name'],
-                    'title' => $coupon['title'],
-                    'desc' => $coupon['desc'],
-                    'rules' => $coupon['rules'],
-                    'icon' => $coupon['icon'],
-                    'type' => $coupon['type'],
-                    'usable_type' => $coupon['usable_type'],
-                    'money' => $coupon['money'],
-                    'discount' => $coupon['discount'],
-                    'min_consume_amount' => $coupon['min_consume_amount'],
-                    'max_reduce_amount' => $coupon['max_reduce_amount'],
-                    'expire_type' => $coupon['expire_type'],
-                    'start_time' => $coupon['start_time'],
-                    'end_time' => $coupon['end_time'],
-//                'coupons_num'=>0
-                ];
-            }
-
-            //如果是部分产品可用,才有类型数组
-            if ($coupon['usable_type'] == 2)
-            //获取类型数组
+            foreach ($coupon_arr as $coupon)
             {
-                $type = CouponType::where('coupon_id',$coupon['id'])->where('user_coupon_id',0)->pluck('product_type');
-            }
-            foreach ($collection as $model) {
-                //插入到用户优惠券中
-                $arr['user_id'] = $model->id;
-                //获取到插入之后的id
-                $insert_id = UserCoupon::create($arr)->id;
-                //如果是部分产品可用,则要插入可用类型到优惠券可用类型表
+                //拿到基础数据
+                //获取过期类型是指定几天过期
+                if ($coupon['expire_type'] == 1){
+                    $effective_days = $coupon['effective_days'];
+                    $str_time = '+'.$effective_days.'day';
+                    $expire_time_num = strtotime($str_time);
+                    $arr = [
+                        'user_id' => 0,
+                        'coupon_id'=>$coupon['id'],
+                        'name' => $coupon['name'],
+                        'title' => $coupon['title'],
+                        'desc' => $coupon['desc'],
+                        'rules' => $coupon['rules'],
+                        'icon' => $coupon['icon'],
+                        'type' => $coupon['type'],
+                        'usable_type' => $coupon['usable_type'],
+                        'money' => $coupon['money'],
+                        'discount' => $coupon['discount'],
+                        'min_consume_amount' => $coupon['min_consume_amount'],
+                        'max_reduce_amount' => $coupon['max_reduce_amount'],
+                        'expire_type' => $coupon['expire_type'],
+                        'effective_days' => $coupon['effective_days'],
+                        'expire_time' => $expire_time_num,
+                    ];
+                }else if ($coupon->expire_type == 2){
+                    //设置有效期的基础数据
+                    $arr = [
+                        'user_id' => 0,
+                        'coupon_id'=>$coupon['id'],
+                        'name' => $coupon['name'],
+                        'title' => $coupon['title'],
+                        'desc' => $coupon['desc'],
+                        'rules' => $coupon['rules'],
+                        'icon' => $coupon['icon'],
+                        'type' => $coupon['type'],
+                        'usable_type' => $coupon['usable_type'],
+                        'money' => $coupon['money'],
+                        'discount' => $coupon['discount'],
+                        'min_consume_amount' => $coupon['min_consume_amount'],
+                        'max_reduce_amount' => $coupon['max_reduce_amount'],
+                        'expire_type' => $coupon['expire_type'],
+                        'start_time' => $coupon['start_time'],
+                        'end_time' => $coupon['end_time'],
+                    ];
+                }
+
+                //如果是部分产品可用,才有类型数组
                 if ($coupon['usable_type'] == 2)
+                    //获取类型数组
                 {
-                    foreach ($type as $value)
+                    $type = CouponType::where('coupon_id',$coupon['id'])->where('user_coupon_id',0)->pluck('product_type');
+                }
+                foreach ($collection as $model) {
+                    //插入到用户优惠券中
+                    $arr['user_id'] = $model->id;
+                    //获取到插入之后的id
+                    $insert_id = UserCoupon::create($arr)->id;
+                    //如果是部分产品可用,则要插入可用类型到优惠券可用类型表
+                    if ($coupon['usable_type'] == 2)
                     {
-                        $coupon_type_arr = [
-                            'coupon_id' => 0,
-                            'user_coupon_id' =>$insert_id,
-                            'product_type' =>$value
-                        ];
-                        CouponType::create($coupon_type_arr);
+                        foreach ($type as $value)
+                        {
+                            $coupon_type_arr = [
+                                'coupon_id' => 0,
+                                'user_coupon_id' =>$insert_id,
+                                'product_type' =>$value
+                            ];
+                            CouponType::create($coupon_type_arr);
+                        }
                     }
+                    $coupon = Coupon::where('id',$coupon['id'])->first();
+                    Coupon::where('id',$coupon['id'])->update(['num'=>$coupon['num']-1]);
                 }
-                $coupon = Coupon::where('id',$coupon['id'])->first();
-                Coupon::where('id',$coupon['id'])->update(['num'=>$coupon['num']-1]);
             }
         }
         return $this->response()->success('优惠券发放成功')->refresh();
 
     }
+    public function form()
+    {
+        $this->text('num', '优惠券数量')->help('点击提交后请耐心等待,请勿再次点击提交按钮,以免造成多次发放');
+    }
 
 }

+ 73 - 66
app/Admin/Actions/backstage/Coupon/CouponBatchGrant.php

xqd xqd
@@ -16,83 +16,89 @@ class CouponBatchGrant extends BatchAction
     public function handle(Collection $collection,Request $request)
     {
         $coupon_id = request('id');
+        //优惠券数量
+        $coupon_num = request('num');
         $user_arr = $collection->toArray();
+        //用户数量
         $user_num = count($user_arr);
         $coupon = Coupon::where('id',$coupon_id)->first();
-        if ($coupon->num < $user_num)
+        $all_num = $coupon_num*$user_num;
+        //判断优惠券是否充足 优惠券数量*用户数量
+        if ($coupon->num < $all_num)
         {
-            return $this->response()->error('优惠券数量不足')->refresh();
+            return $this->response()->error('优惠券'.Coupon::where('id',$coupon_id)->value('name').'数量不足')->refresh();
         }
-        //获取过期类型是指定几天过期
-        if ($coupon->expire_type == 1){
-            $effective_days = $coupon->effective_days;
-            $str_time = '+'.$effective_days.'day';
-            $expire_time_num = strtotime($str_time);
-            $arr = [
-                'user_id' => 0,
-                'coupon_id'=>$coupon_id,
-                'name' => $coupon->name,
-                'title' => $coupon->title,
-                'desc' => $coupon->desc,
-                'rules' => $coupon->rules,
-                'icon' => $coupon->icon,
-                'type' => $coupon->type,
-                'usable_type' => $coupon->usable_type,
-                'money' => $coupon->money,
-                'discount' => $coupon->discount,
-                'min_consume_amount' => $coupon->min_consume_amount,
-                'max_reduce_amount' => $coupon->max_reduce_amount,
-                'expire_type' => $coupon->expire_type,
-                'effective_days' => $coupon->effective_days,
-                'expire_time' => $expire_time_num,
-//                'coupons_num'=>0
-            ];
-        }else if ($coupon->expire_type == 2){
-            $arr = [
-                'user_id' => 0,
-                'coupon_id'=>$coupon_id,
-                'name' => $coupon->name,
-                'title' => $coupon->title,
-                'desc' => $coupon->desc,
-                'rules' => $coupon->rules,
-                'icon' => $coupon->icon,
-                'type' => $coupon->type,
-                'usable_type' => $coupon->usable_type,
-                'money' => $coupon->money,
-                'discount' => $coupon->discount,
-                'min_consume_amount' => $coupon->min_consume_amount,
-                'max_reduce_amount' => $coupon->max_reduce_amount,
-                'expire_type' => $coupon->expire_type,
-                'start_time' => $coupon->start_time,
-                'end_time' => $coupon->end_time,
-//                'coupons_num'=>0
-            ];
-        }
-        if ($coupon->usable_type == 2)
+        for ($i = 0;$i<$coupon_num;$i++)
         {
-            //拿到类型数组
-            $type = CouponType::where('coupon_id',$coupon_id)->where('user_coupon_id',0)->pluck('product_type');
-        }
-
-        foreach ($collection as $model) {
-            //插入到用户优惠券中
-            $arr['user_id'] = $model->id;
-            //获取到插入之后的id
-            $insert_id = UserCoupon::create($arr)->id;
+            //获取过期类型是指定几天过期
+            if ($coupon->expire_type == 1){
+                $effective_days = $coupon->effective_days;
+                $str_time = '+'.$effective_days.'day';
+                $expire_time_num = strtotime($str_time);
+                $arr = [
+                    'user_id' => 0,
+                    'coupon_id'=>$coupon_id,
+                    'name' => $coupon->name,
+                    'title' => $coupon->title,
+                    'desc' => $coupon->desc,
+                    'rules' => $coupon->rules,
+                    'icon' => $coupon->icon,
+                    'type' => $coupon->type,
+                    'usable_type' => $coupon->usable_type,
+                    'money' => $coupon->money,
+                    'discount' => $coupon->discount,
+                    'min_consume_amount' => $coupon->min_consume_amount,
+                    'max_reduce_amount' => $coupon->max_reduce_amount,
+                    'expire_type' => $coupon->expire_type,
+                    'effective_days' => $coupon->effective_days,
+                    'expire_time' => $expire_time_num,
+                ];
+            }else if ($coupon->expire_type == 2){
+                $arr = [
+                    'user_id' => 0,
+                    'coupon_id'=>$coupon_id,
+                    'name' => $coupon->name,
+                    'title' => $coupon->title,
+                    'desc' => $coupon->desc,
+                    'rules' => $coupon->rules,
+                    'icon' => $coupon->icon,
+                    'type' => $coupon->type,
+                    'usable_type' => $coupon->usable_type,
+                    'money' => $coupon->money,
+                    'discount' => $coupon->discount,
+                    'min_consume_amount' => $coupon->min_consume_amount,
+                    'max_reduce_amount' => $coupon->max_reduce_amount,
+                    'expire_type' => $coupon->expire_type,
+                    'start_time' => $coupon->start_time,
+                    'end_time' => $coupon->end_time,
+                ];
+            }
             if ($coupon->usable_type == 2)
             {
-                foreach ($type as $value)
+                //拿到类型数组
+                $type = CouponType::where('coupon_id',$coupon_id)->where('user_coupon_id',0)->pluck('product_type');
+            }
+
+            foreach ($collection as $model) {
+                //插入到用户优惠券中
+                $arr['user_id'] = $model->id;
+                //获取到插入之后的id
+                $insert_id = UserCoupon::create($arr)->id;
+                if ($coupon->usable_type == 2)
                 {
-                    $coupon_type_arr = [
-                        'coupon_id' => 0,
-                        'user_coupon_id' =>$insert_id,
-                        'product_type' =>$value
-                    ];
-                    CouponType::create($coupon_type_arr);
+                    foreach ($type as $value)
+                    {
+                        $coupon_type_arr = [
+                            'coupon_id' => 0,
+                            'user_coupon_id' =>$insert_id,
+                            'product_type' =>$value
+                        ];
+                        CouponType::create($coupon_type_arr);
+                    }
                 }
+                $coupon = Coupon::where('id',$coupon_id)->first();
+                Coupon::where('id',$coupon_id)->update(['num'=>$coupon->num-1]);
             }
-            $coupon = Coupon::where('id',$coupon_id)->first();
-            Coupon::where('id',$coupon_id)->update(['num'=>$coupon->num-1]);
         }
         return $this->response()->success('优惠券发放成功')->refresh();
     }
@@ -101,5 +107,6 @@ class CouponBatchGrant extends BatchAction
     {
         $name = Coupon::where('position_type',2)->pluck('name','id');
         $this->select('id', '优惠券名称')->options($name);
+        $this->text('num', '优惠券数量')->help('点击提交后请耐心等待,请勿再次点击提交按钮,以免造成多次发放');
     }
 }

+ 90 - 0
app/Admin/Controllers/HelpInfoController.php

xqd
@@ -0,0 +1,90 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\HelpInfo;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class HelpInfoController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '常见问题';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new HelpInfo());
+
+        $grid->column('id', __('Id'));
+        $grid->column('title', __('标题'));
+        $grid->column('content', __('内容'))->limit(50,'...');
+        $state = [
+            'on' => ['value' =>1, 'text' => '展示', 'color' => 'primary'],
+            'off' => ['value' => 0, 'text' => '不展示', 'color' => 'danger']
+        ];
+        $grid->column('status', __('状态'))->switch($state);
+        $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(HelpInfo::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('title', __('标题'));
+        $show->field('content', __('内容'));
+        $show->field('status', __('状态'))->using([0=>'不展示',1=>'展示']);
+        $show->field('created_at', __('创建时间'));
+        $show->field('updated_at', __('更新时间'));
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new HelpInfo());
+
+        $form->text('title', __('标题'));
+        $form->editor('content', __('内容'));
+        $state = [
+            'on' => ['value' =>1, 'text' => '展示', 'color' => 'primary'],
+            'off' => ['value' => 0, 'text' => '不展示', 'color' => 'danger']
+        ];
+        $form->switch('status', __('状态'))->default(1);
+        $form->footer(function ($footer) {
+            // 去掉`查看`checkbox
+            $footer->disableViewCheck();
+            // 去掉`继续编辑`checkbox
+            $footer->disableEditingCheck();
+            // 去掉`继续创建`checkbox
+            $footer->disableCreatingCheck();
+
+        });
+        return $form;
+    }
+}

+ 78 - 0
app/Admin/Controllers/UserManagement/BmUser/FeedBacksController.php

xqd
@@ -0,0 +1,78 @@
+<?php
+
+namespace App\Admin\Controllers\UserManagement\BmUser;
+
+use App\Models\Feedback;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class FeedBacksController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '反馈列表';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Feedback());
+        $grid->actions(function ($actions){
+           $actions->disableView();
+           $actions->disableEdit();
+        });
+        $grid->filter(function ($filter){
+           $filter->like('docter.nickname','名字');
+        });
+        $grid->column('id', __('Id'));
+        $grid->column('user_id', __('用户id'));
+        $grid->column('docter.nickname', __('用户名字'));
+        $grid->column('docter.phone', __('用户手机号'));
+        $grid->column('content', __('反馈内容'))->limit(50,'...');
+        $grid->column('created_at', __('创建时间'));
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(Feedback::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('user_id', __('User id'));
+        $show->field('content', __('Content'));
+        $show->field('created_at', __('Created at'));
+        $show->field('updated_at', __('Updated at'));
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Feedback());
+
+        $form->number('user_id', __('User id'));
+        $form->text('content', __('Content'));
+
+        return $form;
+    }
+}

+ 6 - 3
app/Admin/Controllers/UserManagement/DocterManagement/DoctorManagementController.php

xqd
@@ -80,15 +80,18 @@ class DoctorManagementController extends AdminController
             'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
         ];
 //        $grid->column('organization', __('所属机构'))->pluck('name')->label('info');
-        $grid->column('organization', __('所属机构'))->pluck('name')->display(function ($organization){
+        $grid->column('org', __('所属机构'))->display(function (){
 //            dd($organization);
-            if (empty($organization->toArray()))
+//            dd($this->id);
+            $org_id = DocterOrganization::where('docter_id',$this->id)->where('state',1)->pluck('organization_id')->toArray();
+            $name = Organization::whereIn('id',$org_id)->pluck('name')->toArray();
+            if (empty($name))
             {
                 return '无';
             }
             else
             {
-                return $organization;
+                return $name;
             }
         })->label('info');
         $grid->column('serviceapply', __('开通服务'))->where('status',2)->pluck('service_type')->display(function ($type){

+ 3 - 11
app/Admin/Controllers/VaccinesManagement/VaccinesController.php

xqd xqd xqd
@@ -32,12 +32,6 @@ class VaccinesController extends AdminController
         $grid->column('id', __('Id'));
         $grid->column('type', '类型')->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
         $grid->column('name', __('名称'));
-//        $grid->column('introduction','简介');
-        $grid->column('price', __('价钱'))->display(function ($v){
-            return round($v/100,4).'元';
-        });
-        $grid->column('remark', __('备注'));
-        $grid->column('supplier', __('厂家'));
         $states = [
             'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
             'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
@@ -58,9 +52,8 @@ class VaccinesController extends AdminController
             return new Table(['ID', '库存' ,'机构名称'], $org);
         });
 
-        $grid->column('stock','库存');
+        $grid->column('kc','库存');
         $grid->column('states','状态')->switch($states);
-        $grid->column('created_at', __('创建时间'));
         $grid->column('updated_at', __('更新时间'));
 
         $grid->filter(function($filter){
@@ -140,13 +133,12 @@ class VaccinesController extends AdminController
         $form->editing(function ($f){
             $f->model()->price /= 100;
         });
+
         $form->select('type', __('分类'))->options(Vaccines::$_post_type)->default('1');
         $form->text('name', __('名称'))->rules('required|min:3|max:255',['required'=>'请填写名称','min'=>'名称不能少于3个字符!','max'=>'名称长度过长!']);
-//        $form->text('introduction','简介')->rules('required',['require'=>'请填写疫苗简介!' ]);
         $form->text('price', __('价格'));
-        $form->text('remark', __('备注'))->rules('required',['required'=>'请填写备注!']);;
+        $form->text('remark', __('备注'));
         $form->text('supplier', __('厂家'))->rules('required',['required'=>'请填写厂家!']);
-        $form->number('stock','库存');
         $states = [
             'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
             'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],

+ 7 - 0
app/Admin/routes.php

xqd xqd
@@ -113,6 +113,8 @@ Route::group([
     $router->resource('user_coupons', UserManagement\BmUser\UserCouponsController::class);
     //用户管理->订单数据总览
     $router->resource('user_orders', UserManagement\BmUser\UserOrdersController::class);
+    //反馈列表
+    $router->resource('feedback', UserManagement\BmUser\FeedBacksController::class);
 
     /*
      * 订单管理
@@ -165,5 +167,10 @@ Route::group([
      * 权限管理
      * */
     $router->resource('cdms_roles', PermissionController::class);
+
+    /*
+     * 常见问题
+     * */
+    $router->resource('helpinfos', HelpInfoController::class);
 });
 

+ 4 - 20
app/Community/Controllers/ApiController.php

xqd xqd xqd xqd
@@ -428,7 +428,7 @@ class ApiController extends Controller
     }
 
     //获取月排班
-    public function get_month_schedule()
+    public function getMonthSchedule()
     {
         $date = request('date');
         $org_id = intval(request('org_id'));
@@ -460,10 +460,7 @@ class ApiController extends Controller
                 ['status' => false, 'type' => 3, 'start' => $serviceConfig[3]['nightStartTime'], 'end' => $serviceConfig[3]['nightEndTime']],
             ];
         }
-//
-//            self::baseMonthSchedule($month_day,$baseData);
-//            return [];
-//        }
+
 
         for ($i = 1; $i <= $month_day; $i++) {
             $week = date('N', $start_time + ($i - 1) * 86400);
@@ -499,14 +496,7 @@ class ApiController extends Controller
                     }
 //
                 }
-                //覆盖自定义排班
-//                echo '医生id '.$docter_id.' 机构id '.$org_id.' 周几'.$week.' 日期 '.$scheduleDate.'<br>';
-//                $self = SelfSchedule::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'schedule_type'=>$sType])->get()->GroupBy('type')->toArray();
-//                if(!empty($self)){
-//                    foreach($self as $k=>$sf){
-//                        $newBase[$k-1]['status'] = true;
-//                    }
-//                }
+
                 $scheduleList[$i - 1] = [
                     'schedulelingList' => $newBase,
                     'date' => $i,
@@ -532,13 +522,7 @@ class ApiController extends Controller
                         if ($org_id == $idSum) $newBase[$type - 1]['status'] = true;
                     }
                 }
-                //覆盖自定义排班
-//                $self = SelfSchedule::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'schedule_type'=>$sType,'organization_id'=>$org_id])->get(['type'])->GroupBy('type')->toArray();
-//                if(!empty($self)){
-//                    foreach($self as $k=>$sf){
-//                        $newBase[$k-1]['status'] = true;
-//                    }
-//                }
+
                 $scheduleList[$i - 1] = [
                     'schedulelingList' => $newBase,
                     'date' => $i,

+ 3 - 2
app/Community/Controllers/Vaccine/OrganizationVaccineController.php

xqd
@@ -37,8 +37,9 @@ class OrganizationVaccineController extends AdminController
 
 
         $grid->filter(function ($fliter){
-            $fliter->equal('organization.name','机构')->select(Organization::pluck('name','id'));
-            $fliter->euqal('vaccine.name','疫苗')->select(Vaccine::pluck('name','id'));
+//            $fliter->equal('organization.name','机构')->select(Organization::pluck('name','id'));
+//            $fliter->equal('organization.name','机构')->select(Organization::pluck('name','id'));
+            $fliter->equal('vaccine.name','疫苗')->select(Vaccine::pluck('name','id'));
         });
 
 

+ 2 - 5
app/Community/routes.php

xqd xqd
@@ -17,7 +17,7 @@ Route::resource('offices', OfficeController::class);
 Route::resource('orders', OrderController::class);
 Route::resource('docter_org', DocterOrgController::class);
 Route::resource('docter_verifies', DocterVerifyController::class);
-Route::resource('cdms_roles', PermissionController::class);
+//Route::resource('cdms_roles', PermissionController::class);
 Route::resource('docter_account', DocterAccountController::class);
 Route::resource('docter_chats', DocterChatController::class);
 
@@ -55,17 +55,14 @@ Route::get('/api/set_week_schedule', 'ApiController@setWeekSchedule');
 Route::get('/api/set_day_schedule', 'ApiController@setDaySchedule');
 Route::get('/api/get_week_chedule', 'ApiController@getWeekSchedule');
 Route::get('/api/set_month_schedule', 'ApiController@setmonthScheduel');
-Route::get('/api/get_month_schedule', 'ApiController@get_month_schedule');
+Route::get('/api/get_month_schedule', 'ApiController@getMonthSchedule');
 Route::get('/api/get_docter_setting', 'ApiController@getDocterSetting');
 Route::get('/api/update_docter_setting', 'ApiController@updateDocterSetting');
 Route::get('/api/docter_setting', 'ApiController@updateDocterSetting');
 Route::get('/api/self_schedule', 'ApiController@setSelfSchedule');
 Route::get('/api/getScheduleInfo', 'ApiController@getScheduleInfo');
 
-Route::get('/getComSchedule', 'ApiController@getComSchedule');
 Route::get('/getChatOrder', 'ApiController@get_chat_order');
-Route::get('/setDocChedule', 'ApiController@setDocChedule');
-
 
 
 

+ 3 - 0
app/Models/Feedback.php

xqd
@@ -14,4 +14,7 @@ class Feedback extends BaseModel
     {
         return 'feedbacks';
     }
+    public function docter(){
+        return $this->hasOne(User::class,'id','user_id');
+    }
 }

+ 7 - 0
app/Models/Vaccines.php

xqd xqd
@@ -5,6 +5,7 @@ namespace App\Models;
 
 class Vaccines extends BaseModel
 {
+    protected $appends = ['kc'];
     //
     public static $_post_type = [
         1=>"Ⅰ类疫苗",
@@ -13,6 +14,12 @@ class Vaccines extends BaseModel
     //导入格式
     protected $fillable = ['type','price',"name","remark","supplier",'stock','states'];
 
+    public function getKcAttribute()
+    {
+        $id = $this->id;
+        return OrganizationVaccine::where(['vaccine_id'=>$id])->sum('stock');
+    }
+
     public function organization()
     {
         return $this->belongsToMany(Organization::class,'org_id');

+ 1 - 1
resources/views/cdms/schedule.blade.php

xqd
@@ -1 +1 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>scheduling</title><link href="static/css/app.b0dfcc84.css" rel="preload" as="style"><link href="static/css/chunk-vendors.767f701c.css" rel="preload" as="style"><link href="static/js/app.d9e22020.js" rel="preload" as="script"><link href="static/js/chunk-vendors.feab90c7.js" rel="preload" as="script"><link href="static/css/chunk-vendors.767f701c.css" rel="stylesheet"><link href="static/css/app.b0dfcc84.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but scheduling doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.feab90c7.js"></script><script src="static/js/app.d9e22020.js"></script></body></html>
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>scheduling</title><link href="static/css/app.b0dfcc84.css" rel="preload" as="style"><link href="static/css/chunk-vendors.767f701c.css" rel="preload" as="style"><link href="static/js/app.ae6b80a5.js" rel="preload" as="script"><link href="static/js/chunk-vendors.feab90c7.js" rel="preload" as="script"><link href="static/css/chunk-vendors.767f701c.css" rel="stylesheet"><link href="static/css/app.b0dfcc84.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but scheduling doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="static/js/chunk-vendors.feab90c7.js"></script><script src="static/js/app.ae6b80a5.js"></script></body></html>