|
@@ -55,18 +55,24 @@ class OrderVaccinesController extends AdminController
|
|
$where = ['product_type'=>4];
|
|
$where = ['product_type'=>4];
|
|
if(!$is_admin){
|
|
if(!$is_admin){
|
|
$org_id = $user->org_id;
|
|
$org_id = $user->org_id;
|
|
- $where = ['product_type'=>4,'orders.organization_id'=>$org_id];
|
|
|
|
|
|
+ $where = ['product_type'=>4,'organization_id'=>$org_id];
|
|
}
|
|
}
|
|
- $grid->model()->where($where)->leftJoin('order_patients','order_patients.order_id','=','orders.id');
|
|
|
|
|
|
+ $grid->model()->where($where);
|
|
if(!empty($res['orderPatient']['appoint_start_time']['start']) || !empty($res['orderPatient']['appoint_start_time']['start']) ){
|
|
if(!empty($res['orderPatient']['appoint_start_time']['start']) || !empty($res['orderPatient']['appoint_start_time']['start']) ){
|
|
- $grid->model()->orderBy('order_patients.appoint_start_time','asc');
|
|
|
|
|
|
+ $grid->model()->orderBy('appoint_start_time');
|
|
} else {
|
|
} else {
|
|
- $grid->model()->orderBy('order_patients.appoint_start_time','desc');
|
|
|
|
|
|
+ $grid->model()->orderBy('appoint_start_time','desc');
|
|
}
|
|
}
|
|
|
|
|
|
- $grid->column('order_id', __('Id'));
|
|
|
|
|
|
+ $grid->column('id', __('Id'));
|
|
$grid->column('user.nickname', __('预约用户'));
|
|
$grid->column('user.nickname', __('预约用户'));
|
|
-
|
|
|
|
|
|
+ $grid->column('orderPatient.phoe', __('电话'))->display(function ($w){
|
|
|
|
+ if(empty($w)) {
|
|
|
|
+ if(empty($this->orderUser->phone)) return '';
|
|
|
|
+ return $this->orderUser->phone;
|
|
|
|
+ }
|
|
|
|
+ return $w;
|
|
|
|
+ });
|
|
$grid->column('appoint_start_time', __('预约时间'))->display(function ($w){
|
|
$grid->column('appoint_start_time', __('预约时间'))->display(function ($w){
|
|
if(empty($this->orderPatient) || empty($this->orderPatient->appoint_start_time)) return '';
|
|
if(empty($this->orderPatient) || empty($this->orderPatient->appoint_start_time)) return '';
|
|
return date('Y-m-d H:i',$w).'~'.date('H:i',$this->appoint_end_time);
|
|
return date('Y-m-d H:i',$w).'~'.date('H:i',$this->appoint_end_time);
|
|
@@ -160,7 +166,7 @@ class OrderVaccinesController extends AdminController
|
|
if(empty($vaccine_name) ) return '';
|
|
if(empty($vaccine_name) ) return '';
|
|
return implode(',',$vaccine_name);
|
|
return implode(',',$vaccine_name);
|
|
});
|
|
});
|
|
- $show->field('payment_status', __('支付状态'))->using([1=>'待付款',2=>'已付款',3=>'退款中',4=>'已退款'])->label('info');
|
|
|
|
|
|
+ $show->field('payment_status', __('支付状态'))->using(Order::getPayStatus())->label('info');
|
|
|
|
|
|
$show->field('order_status', __('订单状态'))->using(Order::getStatus())->label('info');
|
|
$show->field('order_status', __('订单状态'))->using(Order::getStatus())->label('info');
|
|
$show->field('created_at', __('创建时间'));
|
|
$show->field('created_at', __('创建时间'));
|