Ver Fonte

计免儿保用户电话号码修改

Swdz-WangHaiJun há 4 anos atrás
pai
commit
aa48e5234b

+ 13 - 14
app/Admin/Controllers/VaccinesManagement/VaccinesController.php

xqd xqd xqd
@@ -30,27 +30,26 @@ class VaccinesController extends AdminController
         $grid = new Grid(new Vaccines());
         $grid->model()->orderBy('id','desc');
         $grid->column('id', __('Id'));
-        $grid->column('type', '类型')->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
+//        $grid->column('type', '类型')->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
         $grid->column('name', __('名称'));
         $states = [
             'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
             'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
         ];
 
-        $grid->column('organizations', '机构库存')->display(function (){
+        $grid->column('organizations', '机构')->display(function (){
             return '点击查看';
         })->modal('机构库存', function ($model) {
             $org = $model->organizationvaccines()->get()->map(function ($comment) {
-                return $comment->only(['org_id','vaccine_id','stock']);
+                return $comment->only(['org_id', 'stock']);
             });
             $org = $org->toArray();
             for($i=0;$i<count($org);$i++)
             {
                 $id = $org[$i]['org_id'];
-                $org[$i]['vaccine_id'] = $this->name;
                 $org[$i]['org_name'] = Organization::where('id',$id)->value('name');
             }
-            return new Table(['ID','疫苗','库存','机构名称'], $org);
+            return new Table(['ID', '库存' ,'机构名称'], $org);
         });
 
         $grid->column('kc','库存');
@@ -110,12 +109,12 @@ class VaccinesController extends AdminController
         $show = new Show(Vaccines::findOrFail($id));
 
         $show->field('id', __('Id'));
-        $show->field('type', __('分类'))->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
-        $show->field('introduction','简介');
-        $show->field('price', __('价钱'));
+//        $show->field('type', __('分类'))->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
+//        $show->field('introduction','简介');
+//        $show->field('price', __('价钱'));
         $show->field('name', __('名称'));
-        $show->field('remark', __('备注'));
-        $show->field('supplier', __('厂家'));
+//        $show->field('remark', __('备注'));
+//        $show->field('supplier', __('厂家'));
         $show->field('created_at', __('创建时间'));
         $show->field('updated_at', __('更新时间'));
 
@@ -135,11 +134,11 @@ class VaccinesController extends AdminController
             $f->model()->price /= 100;
         });
 
-        $form->select('type', __('分类'))->options(Vaccines::$_post_type)->default('1');
+//        $form->select('type', __('分类'))->options(Vaccines::$_post_type)->default('1');
         $form->text('name', __('名称'))->rules('required|min:3|max:255',['required'=>'请填写名称','min'=>'名称不能少于3个字符!','max'=>'名称长度过长!']);
-        $form->text('price', __('价格'));
-        $form->text('remark', __('备注'));
-        $form->text('supplier', __('厂家'))->rules('required',['required'=>'请填写厂家!']);
+//        $form->text('price', __('价格'));
+//        $form->text('remark', __('备注'));
+//        $form->text('supplier', __('厂家'))->rules('required',['required'=>'请填写厂家!']);
         $states = [
             'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
             'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],

+ 5 - 1
app/Community/Controllers/NurseUserController.php

xqd xqd
@@ -4,6 +4,7 @@ namespace App\Community\Controllers;
 
 use App\Models\Order;
 use App\Models\OrderNurse;
+use App\Models\Patient;
 use App\Models\PatientRemark;
 use App\Models\Serviceapplys;
 use EasyWeChat\Factory;
@@ -36,7 +37,10 @@ class NurseUserController extends AdminController
         $grid->model()->GroupBy('patient_id');
         $grid->column('orderPatient.name', __('姓名'));
         $grid->column('orderUser.nickname', __('监护人'));
-        $grid->column('orderPatient.phone', __('监护人手机号'));
+        $grid->column('orderPatient.phone', __('监护人手机号'))->display(function ($w){
+            if(empty($w)) return Patient::where('id',$this->patient_id)->value('phone');
+            return $w;
+        });;
         $grid->column('orderPatient.birthday', __('出生日期'));
 
         if(!$is_amdin){

+ 2 - 0
app/Community/Controllers/VaccineUserController.php

xqd xqd
@@ -3,6 +3,7 @@
 namespace App\Community\Controllers;
 
 use App\Models\Order;
+use App\Models\Patient;
 use App\Models\PatientRemark;
 use Encore\Admin\Controllers\AdminController;
 use Encore\Admin\Facades\Admin;
@@ -39,6 +40,7 @@ class VaccineUserController extends AdminController
         $grid->column('orderPatient.name', __('姓名'));
         $grid->column('orderUser.nickname', __('监护人'));
         $grid->column('orderPatient.phone', __('监护人手机号'))->display(function ($w){
+            if(empty($w)) return Patient::where('id',$this->patient_id)->value('phone');
             return $w;
         });
         $grid->column('orderPatient.birthday', __('出生日期'));