| xqd
@@ -19,7 +19,7 @@ class OrganizationController extends AdminController
|
|
|
*
|
|
|
* @var string
|
|
|
*/
|
|
|
- protected $title = '机构列表';
|
|
|
+ protected $title = '计免服务';
|
|
|
|
|
|
/**
|
|
|
* Make a grid builder.
|
| xqd
@@ -31,17 +31,18 @@ class OrganizationController extends AdminController
|
|
|
$grid = new Grid(new Organization());
|
|
|
|
|
|
$grid->column('name', __('社区医院'));
|
|
|
- $grid->column('orders', __('总订单数'))->display(function (){
|
|
|
- return Order::where('organization_id',$this->id)->count();
|
|
|
+ $type = request('product_type',4);
|
|
|
+ $grid->column('orders', __('总订单数'))->display(function () use ($type) {
|
|
|
+ return Order::where('organization_id',$this->id)->where('product_type',$type)->count();
|
|
|
});
|
|
|
- $grid->column('ordering', __('进行中订单'))->display(function (){
|
|
|
+ $grid->column('ordering', __('进行中订单'))->where('product_type',$type)->display(function () use ($type) {
|
|
|
return Order::where(['organization_id'=>$this->id,'order_status'=>3])->count();
|
|
|
});
|
|
|
- $grid->column('is_ok', __('完成数量'))->display(function (){
|
|
|
- return Order::where(['organization_id'=>$this->id,'order_status'=>4])->count();
|
|
|
+ $grid->column('is_ok', __('完成数量'))->display(function () use ($type) {
|
|
|
+ return Order::where(['organization_id'=>$this->id,'order_status'=>4])->where('product_type',$type)->count();
|
|
|
});
|
|
|
- $grid->column('anomaly', __('异常数量'))->display(function (){
|
|
|
- return Order::where(['organization_id'=>$this->id])->orWhere('order_status',5)->orWhere('payment_status','>',2)->count();
|
|
|
+ $grid->column('anomaly', __('异常数量'))->display(function () use ($type) {
|
|
|
+ return Order::where(['organization_id'=>$this->id])->where('product_type',$type)->orWhere('order_status',5)->orWhere('payment_status','>',2)->count();
|
|
|
});
|
|
|
$grid->filter(function ($filter){
|
|
|
$filter->disableIdFilter();
|