|
@@ -361,10 +361,11 @@ class AgentDeviceView(View):
|
|
|
device_info = AgentDevice.objects.filter(serial_number=serial_number)
|
|
|
if not device_info.exists():
|
|
|
return
|
|
|
+ LOGGER.info('同步更新设备激活状态serial:{},type:{}'.format(serial_number, bind_type))
|
|
|
n_time = int(time.time())
|
|
|
if bind_type == 1:
|
|
|
# 绑定设备
|
|
|
- device_info.update(status=1, updated_time=n_time)
|
|
|
+ device_info.update(status=1, updated_time=n_time, at_time=n_time)
|
|
|
elif bind_type == 2:
|
|
|
# 解绑设备
|
|
|
device_info.update(status=0, updated_time=n_time)
|