| xqd
@@ -55,15 +55,13 @@ class OrderVaccinesController extends AdminController
|
|
|
$where = ['product_type'=>4];
|
|
|
if(!$is_admin){
|
|
|
$org_id = $user->org_id;
|
|
|
- $where = ['product_type'=>4,'organization_id'=>$org_id];
|
|
|
+ $where = ['product_type'=>4,'orders.organization_id'=>$org_id];
|
|
|
}
|
|
|
-
|
|
|
+ $grid->model()->where($where)->leftJoin('order_patients','order_patients.order_id','=','orders.id');
|
|
|
if(!empty($res['orderPatient']['appoint_start_time']['start']) || !empty($res['orderPatient']['appoint_start_time']['start']) ){
|
|
|
- $grid->model()->where($where)->leftJoin('order_patients','order_patients.order_id','=','orders.id')
|
|
|
- ->where('product_type',4)->orderBy('order_patients.appoint_start_time','asc');
|
|
|
+ $grid->model()->orderBy('order_patients.appoint_start_time','asc');
|
|
|
} else {
|
|
|
- $grid->model()->where($where)->leftJoin('order_patients','order_patients.order_id','=','orders.id')
|
|
|
- ->where('product_type',4)->orderBy('order_patients.appoint_start_time','desc');
|
|
|
+ $grid->model()->orderBy('order_patients.appoint_start_time','desc');
|
|
|
}
|
|
|
|
|
|
$grid->column('order_id', __('Id'));
|
| xqd
@@ -91,6 +89,7 @@ class OrderVaccinesController extends AdminController
|
|
|
return implode(',',$vaccine_name);
|
|
|
|
|
|
});
|
|
|
+// $grid->column('docter.name', __('排班医生'));
|
|
|
$status_arr = Order::getStatus();
|
|
|
$grid->column('order_status', __('订单状态'))->display(function ($w) use ($status_arr) {
|
|
|
$info = $status_arr[intval($w)];
|
| xqd
@@ -106,9 +105,12 @@ class OrderVaccinesController extends AdminController
|
|
|
return '<span class="label label-default">'.$info.'</span>';
|
|
|
}
|
|
|
});
|
|
|
+// $grid->column('payment_status', __('支付状态'))->using(Order::getPayStatus())->label([1=>'warring',2=>'success',3=>'info',4=>'danger']);
|
|
|
+
|
|
|
|
|
|
$grid->filter(function ($filter) {
|
|
|
$filter->column(1/2, function ($filter) {
|
|
|
+// $filter->equal('docter.id','排班医生')->select('/cdms/api/getDocter');
|
|
|
$filter->equal('order_status','订单状态')->select(Order::$_order_status);
|
|
|
$filter->timestampBetween('orderPatient.appoint_start_time','预约时间')->datetime();
|
|
|
});
|
| xqd
@@ -117,11 +119,16 @@ class OrderVaccinesController extends AdminController
|
|
|
$tools->append(new FasteOrder());
|
|
|
});
|
|
|
$grid->actions(function ($actions) {
|
|
|
+// if( $actions->row->order_status<= 2){
|
|
|
+// $actions->add(new Reserved());
|
|
|
+// }
|
|
|
+
|
|
|
if(!empty($actions->row->order_status) && ($actions->row->order_status<= 3 || $actions->row->order_status == 7 ) ){
|
|
|
$actions->add(new Finished());
|
|
|
$actions->add(new OrderCance());
|
|
|
$actions->add(new AddVaccine());
|
|
|
}
|
|
|
+
|
|
|
$actions->disableEdit();
|
|
|
// $actions->disableView();
|
|
|
$actions->disableDelete();
|