|
@@ -20,7 +20,7 @@ class ServiceController extends AdminController
|
|
*
|
|
*
|
|
* @var string
|
|
* @var string
|
|
*/
|
|
*/
|
|
- protected $title = '服务';
|
|
|
|
|
|
+ protected $title = '医生服务';
|
|
|
|
|
|
/**
|
|
/**
|
|
* Make a grid builder.
|
|
* Make a grid builder.
|
|
@@ -30,41 +30,47 @@ class ServiceController extends AdminController
|
|
protected function grid()
|
|
protected function grid()
|
|
{
|
|
{
|
|
$grid = new Grid(new Serviceapplys());
|
|
$grid = new Grid(new Serviceapplys());
|
|
|
|
+ $grid->model()->orderByDesc('id');
|
|
|
|
|
|
$status = request('status',2);
|
|
$status = request('status',2);
|
|
-
|
|
|
|
|
|
+//
|
|
$grid->tools(function ($tools) {
|
|
$grid->tools(function ($tools) {
|
|
$tools->batch(function ($batch) {
|
|
$tools->batch(function ($batch) {
|
|
$batch->disableDelete();
|
|
$batch->disableDelete();
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
- if($status == 2){
|
|
|
|
- $grid->column('ondocter.name','医生姓名');
|
|
|
|
- $grid->column('ondocter.phone_price','咨询价格');
|
|
|
|
- $grid->column('step_price','步进价格')->display(function (){
|
|
|
|
- $step = Doctertimes::where(['docter_id'=>$this->id])->value('step_price');
|
|
|
|
- return $step;
|
|
|
|
- });
|
|
|
|
|
|
+ $grid->column('ondocter.name','医生姓名');
|
|
|
|
+ $grid->column('ondocter.phone_price','咨询价格');
|
|
|
|
+ $grid->column('step_price','步进价格')->display(function (){
|
|
|
|
+ $step = Doctertimes::where(['docter_id'=>$this->id])->value('step_price');
|
|
|
|
+ return $step;
|
|
|
|
+ });
|
|
|
|
|
|
- $grid->column('orders','总订单数')->display(function (){
|
|
|
|
|
|
+ $grid->column('orders','总订单数')->display(function (){
|
|
|
|
|
|
- $order_type = Order::where(['docter_id'=>$this->id,'product_type'=>1])->count();
|
|
|
|
- return $order_type;
|
|
|
|
- });
|
|
|
|
- $grid->column('orders_actions','进行中数')->display(function (){
|
|
|
|
- $action = Order::where(['docter_id'=>$this->id,'product_type'=>1,'order_status'=>3])->count();
|
|
|
|
- return $action;
|
|
|
|
- });
|
|
|
|
- $grid->column('orders_inishs','完成数')->display(function (){
|
|
|
|
- $finish = Order::where(['docter_id'=>$this->id,'product_type'=>1,'order_status'=>4])->count();
|
|
|
|
- return $finish;
|
|
|
|
- });
|
|
|
|
- $grid->column('orders_anomaly','异常数')->display(function (){
|
|
|
|
- $anomaly = Order::where(['docter_id'=>$this->id,'product_type'=>1])->whereIn('order_status',[1,2,5])->count();
|
|
|
|
- return $anomaly;
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
|
|
+ $order_type = Order::where(['docter_id'=>$this->id,'product_type'=>1])->count();
|
|
|
|
+ return $order_type;
|
|
|
|
+ });
|
|
|
|
+ $grid->column('orders_actions','进行中数')->display(function (){
|
|
|
|
+ $action = Order::where(['docter_id'=>$this->id,'product_type'=>1,'order_status'=>3])->count();
|
|
|
|
+ return $action;
|
|
|
|
+ });
|
|
|
|
+ $grid->column('orders_inishs','完成数')->display(function (){
|
|
|
|
+ $finish = Order::where(['docter_id'=>$this->id,'product_type'=>1,'order_status'=>4])->count();
|
|
|
|
+ return $finish;
|
|
|
|
+ });
|
|
|
|
+ $grid->column('orders_anomaly','异常数')->display(function (){
|
|
|
|
+ $anomaly = Order::where(['docter_id'=>$this->id,'product_type'=>1])->whereIn('order_status',[1,2,5])->count();
|
|
|
|
+ return $anomaly;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $grid->column('status', __('状态'))->using([1=>'审核',2=>'已通过',3=>'已拒绝'])->label([
|
|
|
|
+ 1 => 'warning',
|
|
|
|
+ 2 => 'success',
|
|
|
|
+ 3 => 'default'
|
|
|
|
+ ]);
|
|
|
|
+ if($status == 7) {
|
|
|
|
|
|
$grid->column('id', __('Id'));
|
|
$grid->column('id', __('Id'));
|
|
$grid->column('ondocter.avatar', __('头像'))->image('',50,50);
|
|
$grid->column('ondocter.avatar', __('头像'))->image('',50,50);
|
|
@@ -91,10 +97,10 @@ class ServiceController extends AdminController
|
|
$actions->disableEdit();
|
|
$actions->disableEdit();
|
|
$actions->disableView();
|
|
$actions->disableView();
|
|
$actions->disableDelete();
|
|
$actions->disableDelete();
|
|
- if($actions->row->status == 1){
|
|
|
|
- $actions->add(new ApplysAction());
|
|
|
|
- $actions->add(new RefuseAction());
|
|
|
|
- }
|
|
|
|
|
|
+// if($actions->row->status == 1){
|
|
|
|
+// $actions->add(new ApplysAction());
|
|
|
|
+// $actions->add(new RefuseAction());
|
|
|
|
+// }
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|