| xqd
@@ -49,6 +49,7 @@ class OrderVaccinesController extends AdminController
|
|
|
$grid->column('id', __('Id'));
|
|
|
$grid->column('orderPatient.name', __('预约用户'));
|
|
|
$grid->column('yuyue', __('预约时间'))->display(function ($w){
|
|
|
+ if(empty($this->orderPatient) || empty($this->orderPatient->appoint_start_time)) return '';
|
|
|
return date('Y-m-d H:i:s',($this->orderPatient->appoint_start_time)) .'致' . date('Y-m-d H:i:s',($this->orderPatient->appoint_end_time));
|
|
|
});
|
|
|
$grid->column('end_time', __('接种时间'))->display(function ($w){
|
| xqd
@@ -62,10 +63,15 @@ class OrderVaccinesController extends AdminController
|
|
|
$grid->column('orderPatient.birthday', __('患者年龄'))->display(function ($w){
|
|
|
return birthday_to_age($w);
|
|
|
});
|
|
|
- $grid->column('orderVaccine.vaccine_name', __('接种疫苗'));
|
|
|
+ $grid->column('vac_name', __('接种疫苗'))->display(function ($w){
|
|
|
+ $vaccine_name = OrderVaccine::where('order_id',$this->id)->pluck('vaccine_name')->toArray();
|
|
|
+ if(empty($vaccine_name) ) return '';
|
|
|
+ return implode(',',$vaccine_name);
|
|
|
+
|
|
|
+ });
|
|
|
$grid->column('docter.name', __('排班医生'));
|
|
|
$grid->column('order_status', __('订单状态'))->using(Order::getStatus());
|
|
|
- $grid->column('payment_status', __('支付状态'))->using(Order::getStatus())->label('info');
|
|
|
+ $grid->column('payment_status', __('支付状态'))->using([1=>'待付款',2=>'已付款',3=>'退款中',4=>'已退款'])->label('info');
|
|
|
|
|
|
$grid->filter(function ($filter){
|
|
|
$filter->column(1/2, function ($filter) {
|
| xqd
@@ -76,14 +82,18 @@ class OrderVaccinesController extends AdminController
|
|
|
});
|
|
|
|
|
|
$grid->actions(function ($actions) {
|
|
|
- if(!empty($actions->row->orders) && $actions->row->orders->order_status< 2 ){
|
|
|
- $actions->add(new Finished());
|
|
|
+ if( $actions->row->order_status<= 2 ){
|
|
|
$actions->add(new Reserved());
|
|
|
$actions->add(new OrderCance());
|
|
|
}
|
|
|
|
|
|
- $actions->add(new AddVaccine());
|
|
|
- $actions->disableView();
|
|
|
+ if( $actions->row->order_status<= 3 ){
|
|
|
+ $actions->add(new Finished());
|
|
|
+ $actions->add(new AddVaccine());
|
|
|
+ }
|
|
|
+
|
|
|
+ $actions->disableEdit();
|
|
|
+// $actions->disableView();
|
|
|
$actions->disableDelete();
|
|
|
});
|
|
|
|
| xqd
@@ -98,19 +108,26 @@ class OrderVaccinesController extends AdminController
|
|
|
*/
|
|
|
protected function detail($id)
|
|
|
{
|
|
|
- $show = new Show(OrderVaccine::findOrFail($id));
|
|
|
+ $show = new Show(Order::findOrFail($id));
|
|
|
|
|
|
$show->field('id', __('Id'));
|
|
|
- $show->field('order_id', __('Order id'));
|
|
|
- $show->field('order_patient_id', __('Order patient id'));
|
|
|
- $show->field('vaccine_id', __('Vaccine id'));
|
|
|
- $show->field('vaccine_type', __('Vaccine type'));
|
|
|
- $show->field('vaccine_price', __('Vaccine price'));
|
|
|
- $show->field('vaccine_name', __('Vaccine name'));
|
|
|
- $show->field('vaccine_remark', __('Vaccine remark'));
|
|
|
- $show->field('vaccine_supplier', __('Vaccine supplier'));
|
|
|
- $show->field('created_at', __('Created at'));
|
|
|
- $show->field('updated_at', __('Updated at'));
|
|
|
+ $show->field('orderPatient.name', __('患者姓名'));
|
|
|
+ $show->field('orderPatient.sex', __('患者性别'))->as(function ($w){
|
|
|
+ return $w==1?'男':'女';
|
|
|
+ });
|
|
|
+ $show->field('orderPatient.birthday', __('生日'))->as(function ($w){
|
|
|
+ return birthday_to_age($w);
|
|
|
+ });
|
|
|
+ $show->field('orderVaccine.id', __('疫苗'))->as(function ($w){
|
|
|
+ $vaccine_name = OrderVaccine::where('order_id',$this->id)->pluck('vaccine_name')->toArray();
|
|
|
+ if(empty($vaccine_name) ) return '';
|
|
|
+ return implode(',',$vaccine_name);
|
|
|
+ });
|
|
|
+ $show->field('payment_status', __('支付状态'))->using([1=>'待付款',2=>'已付款',3=>'退款中',4=>'已退款'])->label('info');
|
|
|
+
|
|
|
+ $show->field('order_status', __('订单状态'))->using(Order::getStatus())->label('info');
|
|
|
+ $show->field('created_at', __('创建时间'));
|
|
|
+ $show->field('updated_at', __('更新时间'));
|
|
|
|
|
|
return $show;
|
|
|
}
|