...
|
...
|
@@ -30,8 +30,10 @@ class AdminStatisticsController extends AdminBaseController{ |
|
|
public function index(){
|
|
|
$param=$this->request->param();
|
|
|
$where='';
|
|
|
$where1=[];
|
|
|
if (!empty($param['hospital'])){
|
|
|
$where="hospital='".$param['hospital']."' AND";
|
|
|
$where1['hospital']=$param['hospital'];
|
|
|
}
|
|
|
//医院总体时长统计
|
|
|
$data=Db::name('order')
|
...
|
...
|
@@ -77,13 +79,23 @@ class AdminStatisticsController extends AdminBaseController{ |
|
|
$month_interval[$i]=[$month[$i],$month[$i+1]];
|
|
|
}
|
|
|
$Month_statistics=array();
|
|
|
$Month_money=array();
|
|
|
$Month=array();
|
|
|
for ($i = 0; $i<24; $i++){
|
|
|
$Month[]=date('Y-m-d',$month_interval[$i][1]);
|
|
|
$Month_statistics[]=Db::name('order')->where('start_time','between',$month_interval[$i])->count();
|
|
|
$Month_money[]=Db::name('order')
|
|
|
->alias('o')
|
|
|
->join('equipment e','o.eq_name=e.name')
|
|
|
->where($where1)
|
|
|
->where('o.start_time','between',$month_interval[$i])
|
|
|
->where('o.state',3)
|
|
|
->sum('o.price');
|
|
|
}
|
|
|
$this->assign('month',json_encode($Month));
|
|
|
$this->assign('monthData',json_encode($Month_statistics));
|
|
|
$this->assign('monthMoney',json_encode($Month_money));
|
|
|
|
|
|
|
|
|
//时间段统计
|
|
|
$interval=array();
|
...
|
...
|
@@ -99,6 +111,10 @@ class AdminStatisticsController extends AdminBaseController{ |
|
|
$interval[$k]=$interval[$k][0]['num'];
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->assign('interval',json_encode($interval));
|
|
|
|
|
|
$this->assign('hospital', isset($param['hospital']) ? $param['hospital'] : '');
|
...
|
...
|
|