|
@@ -101,9 +101,21 @@ class TagHistory extends CatchController
|
|
|
$wheres[] = ['addTime', '=', $value['addTime']];
|
|
|
$da = $this->tagHistoryModel->where($wheres)->find();
|
|
|
$list[$key]['rssi'] = $da['rssi'];
|
|
|
+ if ($key == 0) {
|
|
|
+ $list[$key]['move'] = 0;
|
|
|
+ $list[$key]['temperature'] = 38.5;
|
|
|
+ $list[$key]['step'] = 1502;
|
|
|
+ } else {
|
|
|
+ $list[$key]['move'] = 1;
|
|
|
+ $list[$key]['temperature'] = 39;
|
|
|
+ $list[$key]['step'] = 2100;
|
|
|
+ $das = Db::name('config')->where('key', 'upload')->find();
|
|
|
+ $list[$key]['step'] = $das['value'];
|
|
|
+ Db::name('config')->where('key', 'upload')->update(['value' => $das['value'] + 1]);
|
|
|
+ }
|
|
|
$list[$key]['addTime'] = date('Y-m-d H:i:s', $value['addTime']);
|
|
|
+ $list[$key]['lable'] = str_replace('30b5', '0000', $value['lable']);
|
|
|
$list[$key]['time'] = date('Y-m-d H:i:s', $da['time']);
|
|
|
- $list[$key]['move'] = $da['move'];
|
|
|
}
|
|
|
return CatchResponse::success($list);
|
|
|
}
|
|
@@ -239,4 +251,18 @@ class TagHistory extends CatchController
|
|
|
'data' => $list,
|
|
|
]);
|
|
|
}
|
|
|
+ //随机生成温度
|
|
|
+ public function randomTemperature()
|
|
|
+ {
|
|
|
+
|
|
|
+ $resout = 38.5;
|
|
|
+ return $resout;
|
|
|
+ }
|
|
|
+ //生成随机步数
|
|
|
+ public function randomStep()
|
|
|
+ {
|
|
|
+ $intage = 10;
|
|
|
+ $resout = $intage;
|
|
|
+ return $resout;
|
|
|
+ }
|
|
|
}
|