|
@@ -47,26 +47,29 @@ class OrderVaccinesController extends AdminController
|
|
} );
|
|
} );
|
|
});
|
|
});
|
|
|
|
|
|
- DB::enableQueryLog();
|
|
|
|
-
|
|
|
|
-
|
|
|
|
$user = Admin::user();
|
|
$user = Admin::user();
|
|
$is_admin = Admin::user()->inRoles(['administrator','devloper']);
|
|
$is_admin = Admin::user()->inRoles(['administrator','devloper']);
|
|
$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);
|
|
@@ -110,7 +113,7 @@ class OrderVaccinesController extends AdminController
|
|
|
|
|
|
$grid->filter(function ($filter) {
|
|
$grid->filter(function ($filter) {
|
|
$filter->column(1/2, function ($filter) {
|
|
$filter->column(1/2, function ($filter) {
|
|
-// $filter->equal('docter.id','排班医生')->select('/cdms/api/getDocter');
|
|
|
|
|
|
+// $filter->equal('docter.id','排班医生')->select('https://wechat.fresherbaby.com/api/getAppiontInfo?telphone=13808729518&sig=d7d875f10af1c341b8ba3d9e433e88aa&SecretKey=2018&st=2018&id=11&barcode=&area=12');
|
|
$filter->equal('order_status','订单状态')->select(Order::$_order_status);
|
|
$filter->equal('order_status','订单状态')->select(Order::$_order_status);
|
|
$filter->timestampBetween('orderPatient.appoint_start_time','预约时间')->datetime();
|
|
$filter->timestampBetween('orderPatient.appoint_start_time','预约时间')->datetime();
|
|
});
|
|
});
|
|
@@ -160,7 +163,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', __('创建时间'));
|