|
|
|
@ -58,8 +58,9 @@ class TimingController extends AdminController {
|
|
|
|
|
|
|
|
|
|
$data['model'] = json_encode($this->modelDevice(['create_time'=>['between',[$startTime,$startTime+86399]],'version'=>1]));
|
|
|
|
|
|
|
|
|
|
$duration = $this->duration(['create_time'=>array('between',[$startTime-86400*7,$startTime-1]),'version'=>1]);
|
|
|
|
|
$data['duration7'] = ($duration/M('device_record','tab_')->table('(' . $newSql . ') as a')->where(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])])->order('create_time')->count())/7;
|
|
|
|
|
$duration = $this->duration(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])]);
|
|
|
|
|
$newSqls = M('device_record','tab_')->field('min(create_time) as create_time,model,unique_code,id')->group('unique_code')->select(false);
|
|
|
|
|
$data['duration7'] = ($duration/M('device_record','tab_')->table('(' . $newSqls . ') as a')->where(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])])->order('create_time')->count())/7;
|
|
|
|
|
|
|
|
|
|
$getStatistics = M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>1])->find();
|
|
|
|
|
echo "\n";
|
|
|
|
@ -91,8 +92,9 @@ class TimingController extends AdminController {
|
|
|
|
|
|
|
|
|
|
$data['model'] = json_encode($this->modelDevice(['create_time'=>['between',[$startTime,$startTime+86399]],'version'=>2]));
|
|
|
|
|
|
|
|
|
|
$duration = $this->duration(['create_time'=>array('between',[$startTime-86400*7,$startTime-1]),'version'=>2]);
|
|
|
|
|
$data['duration7'] = ($duration/M('device_record','tab_')->table('(' . $newSql . ') as a')->where(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])])->order('create_time')->count())/7;
|
|
|
|
|
// $duration = $this->duration(['create_time'=>array('between',[$startTime-86400*7,$startTime-1]),'version'=>2]);
|
|
|
|
|
// $data['duration7'] = ($duration/M('device_record','tab_')->table('(' . $newSql . ') as a')->where(['create_time'=>array('between',[$startTime-86400*7,$startTime-1])])->order('create_time')->count())/7;
|
|
|
|
|
$data['duration7'] = 0;
|
|
|
|
|
echo 4;
|
|
|
|
|
$getStatistics = M('device_statistics','tab_')->where(['time'=>$startTime,'version'=>2])->find();
|
|
|
|
|
echo "\n";
|
|
|
|
|