|
@@ -668,6 +668,9 @@ class ReportFormsService extends Service
|
|
|
public function deviceStatisticsReport($data){
|
|
|
if(empty($data['time'][0]) || empty($data['time'][1])) return [false, '时间必须选择!'];
|
|
|
|
|
|
+ $day = $this->returnDays($data['time']);
|
|
|
+ if($day > 10) return [false, '设备数据查询时间仅支持范围区间在10天内'];
|
|
|
+
|
|
|
$model = SystemL::where('time','>=',$data['time'][0])
|
|
|
->where('time','<',$data['time'][1]);
|
|
|
if(! empty($data['title'])) $model->whereIn('device_name',$data['title']);
|
|
@@ -757,13 +760,15 @@ class ReportFormsService extends Service
|
|
|
public function deviceStatisticsReportDetail($data){
|
|
|
if(empty($data['device_name']) || empty($data['time'][0]) || empty($data['time'][0])) return [false,'参数不能为空!'];
|
|
|
|
|
|
+ $day = $this->returnDays($data['time']);
|
|
|
+ if($day > 10) return [false, '设备数据查询时间仅支持范围区间在10天内'];
|
|
|
+
|
|
|
$result = SystemL::where('time','>=',$data['time'][0])
|
|
|
->where('time','<',$data['time'][1])
|
|
|
->where('device_name',$data['device_name'])
|
|
|
->select('device_name','time','data_point_name')
|
|
|
->get()->toArray();
|
|
|
|
|
|
-
|
|
|
$return = [
|
|
|
'run' => [],
|
|
|
'work' => [],
|
|
@@ -804,6 +809,9 @@ class ReportFormsService extends Service
|
|
|
public function deviceStatisticsReportChart($data){
|
|
|
if(empty($data['time'][0]) || empty($data['time'][1])) return [false, '时间必须选择!'];
|
|
|
|
|
|
+ $day = $this->returnDays($data['time'], false);
|
|
|
+ if($day > 31) return [false, '查询时间仅支持范围区间在31天内'];
|
|
|
+
|
|
|
$process_time = [];
|
|
|
|
|
|
$result = SystemL::where('time','>=',$data['time'][0])
|
|
@@ -865,6 +873,9 @@ class ReportFormsService extends Service
|
|
|
public function deviceStatisticsReportOEEChart($data){
|
|
|
if(empty($data['time'][0]) || empty($data['time'][1])) return [false, '时间必须选择!'];
|
|
|
|
|
|
+ $day = $this->returnDays($data['time'], false);
|
|
|
+ if($day > 31) return [false, '查询时间仅支持范围区间在31天内'];
|
|
|
+
|
|
|
//获取数据
|
|
|
$result = SystemL::where('time','>=',$data['time'][0])
|
|
|
->where('time','<',$data['time'][1])
|