private function get_soap_stat($start, $end, $user_id = null)
 {
     $query = UserSoapHistory::select(DB::raw('count(*) as count, users.name as nurse, user_soap_history.user_id as pk'))->where('user_soap_history.health_date', '>=', $start)->where('user_soap_history.health_date', '<', $end)->where('user_soap_history.is_visible', '=', 1)->leftJoin('users', 'user_soap_history.user_id', '=', 'users.id');
     $data = array();
     if ($user_id != null) {
         $records = $query->where('user_soap_history.user_id', '=', $user_id)->first();
         $total_count = UserSoapHistory::select(DB::raw('count(*) as total'))->where('user_soap_history.health_date', '>=', $start)->where('user_soap_history.health_date', '<', $end)->where('user_soap_history.is_visible', '=', 1)->first();
         if ($total_count['total'] > 0) {
             array_push($data, array('nurse' => $records['nurse'], 'count' => $records['count'], 'total' => $total_count['total']));
         }
         $data['count'] = $total_count['total'];
         $data['name'] = $records['nurse'];
     } else {
         $records = $query->groupBy('user_soap_history.user_id')->get();
         $counter = 0;
         for ($i = 0; $i < count($records); $i++) {
             $count = $records[$i]['count'];
             $data[$i] = array('nurse' => $records[$i]['nurse'], 'count' => $count, 'nurse_detail' => $records[$i]['pk']);
             $counter += $count;
         }
         $data['count'] = $counter;
         $data['name'] = '全院';
     }
     return $data;
 }