ChenWuJie 4 سال پیش
والد
کامیت
180eb85d77

+ 1 - 1
app/Admin/Actions/backstage/Coupon/CouponBatchGrant.php

xqd
@@ -25,7 +25,7 @@ class CouponBatchGrant extends BatchAction
         //获取过期类型是指定几天过期
         if ($coupon->expire_type == 1){
             $effective_days = $coupon->effective_days;
-            $expire_time = date("Y-m-d H:i:s", strtotime('+'.$effective_days.'day'));
+            $expire_time = date("Y-m-d H:i:s",  ('+'.$effective_days.'day'));
             $expire_time_num = strtotime($expire_time);
             $arr = [
                 'user_id' => 0,

+ 1 - 1
app/Admin/Actions/backstage/Pass.php

xqd
@@ -15,7 +15,7 @@ class Pass extends RowAction
     {
 //         $model ...
 //        dd($model);
-        DocterOrganization::where('id',$model->id)->update(['state'=>2]);
+        DocterOrganization::where('id',$model->id)->update(['state'=>2,'authentication_time'=>date('Y-m-d H:i:s')]);
         Docter::where('id',$model->docter_id)->update(['is_then'=>1]);
         return $this->response()->success('审核通过')->refresh();
     }

+ 2 - 2
app/Admin/Actions/backstage/Refuse.php

xqd
@@ -13,8 +13,8 @@ class Refuse extends RowAction
     {
         // $model ...
         DocterOrganization::where('id',$model->id)->update(['state'=>3]);
-        
-        return $this->response()->success('审核拒绝')->refresh();
+
+        return $this->response()->success('审核驳回')->refresh();
     }
 
 }

+ 26 - 8
app/Admin/Controllers/ApproveController.php

xqd
@@ -39,15 +39,33 @@ class ApproveController extends AdminController
         $grid->column('organization.name', __('机构'));
         $grid->column('office.name', __('科室'));
         $grid->column('qualification.name', __('医生资质'));
-        $grid->column('state', __('状态'))->using([1=>'待审核',2=>'已认证',3=>'已驳回']);
-
+        $grid->column('state', __('认证状态'))->using([1=>'待审核',2=>'已认证',3=>'已驳回']);
+        $grid->column('authentication_time', __('认证时间'));
+        //禁用创建按钮
+        $grid->disableCreateButton();
         $grid->actions(function ($actions) {
-            //通过申请
-            $actions->add(new Pass());
-            //驳回申请
-            $actions->add(new Refuse());
-            //撤销申请
-            $actions->add(new Revoke());
+            // 去掉删除
+            $actions->disableDelete();
+            // 去掉编辑
+            $actions->disableEdit();
+            // 去掉查看
+            $actions->disableView();
+            //待审核状态下 给通过和驳回
+            if ($actions->row->state == 1){
+                //通过申请
+                $actions->add(new Pass());
+                //驳回申请
+                $actions->add(new Refuse());
+            }
+            //已认证状态下 给撤销
+            if ($actions->row->state == 2){
+                $actions->add(new Revoke());
+            }
+            //驳回状态下 不给任何操作
+            if ($actions->row->state == 3){
+
+            }
+
         });
         return $grid;
     }

+ 77 - 0
app/Admin/Controllers/CommunityNotice/CommunityNotices.php

xqd
@@ -0,0 +1,77 @@
+<?php
+
+namespace App\Admin\Controllers\CommunityNotice;
+
+use App\Models\CommunityNotice;
+use Encore\Admin\Auth\Database\Administrator;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Facades\Admin;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class CommunityNotices extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '社区端通告';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new CommunityNotice());
+        $grid->column('id', __('Id'))->sortable();
+        $grid->column('title', __('标题'));
+        $grid->column('type', __('类型'))->using([1=>'社区通告']);
+        $grid->column('content', __('内容'))->limit(100,'...');
+        $grid->column('admin_id', __('发布人'))->display(function ($id){
+            return Administrator::where('id',$id)->value('username');
+        });
+        $grid->column('updated_at', __('更新时间'));
+        $grid->column('created_at', __('创建时间'));
+
+
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(CommunityNotice::findOrFail($id));
+
+
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new CommunityNotice());
+        $form->text('title', __('标题'));
+        $form->select('type', __('类型'))->options([1=>'社区端通告']);
+        $form->editor('content', __('内容'));
+        $form->submitted(function ($form){
+            $form->model()->admin_id = Admin::user()->id;
+        });
+
+        return $form;
+    }
+}

+ 1 - 1
app/Admin/Controllers/CouponManagement/CouponManagementController.php

xqd
@@ -40,7 +40,7 @@ class CouponManagementController extends AdminController
         $grid->column('id', __('Id'));
         $grid->column('name', __('劵名称'));
         $grid->column('title', __('劵标题'));
-        $grid->column('icon', __('券图标'))->image();
+        $grid->column('icon', __('券图标'))->image('',100,100);
         $grid->column('type', __('类型'))->using([1=>'满减券',2=>'折扣券']);
         $grid->column('usable_type', __('可用类型'))->using([1=>'全部产品通用',2=>'部分产品可用']);
         $grid->column('money', __('满减券的优惠钱数'))->display(function ($money){

+ 1 - 0
app/Models/CommunityNotice.php

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