|
@@ -113,7 +113,7 @@ func UpdateScreensStatusByGatewayId(id, status int) error {
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
-func UpdateScreensStatusAndOnline(code string, sta request.DeviceStatus) error {
|
|
|
+func UpdateScreensStatusIsLogin(code string, sta request.DeviceStatus, isLogin int) error {
|
|
|
var screens Screens
|
|
|
return global.GVA_DB.Model(&screens).Select("status", "play_status", "display_status", "source_status", "last_online_time", "is_login").
|
|
|
Where("screens_code = ?", code).Updates(map[string]interface{}{
|
|
@@ -122,20 +122,7 @@ func UpdateScreensStatusAndOnline(code string, sta request.DeviceStatus) error {
|
|
|
"display_status": sta.DisplayStatus,
|
|
|
"source_status": sta.SourceStatus,
|
|
|
"last_online_time": time.Now(),
|
|
|
- "is_login": 1,
|
|
|
- }).Error
|
|
|
-}
|
|
|
-
|
|
|
-func UpdateScreensStatusAndOffline(code string, sta request.DeviceStatus) error {
|
|
|
- var screens Screens
|
|
|
- return global.GVA_DB.Model(&screens).Select("status", "play_status", "display_status", "source_status", "last_offline_time", "is_login").
|
|
|
- Where("screens_code = ?", code).Updates(map[string]interface{}{
|
|
|
- "status": sta.Status,
|
|
|
- "play_status": sta.PlayStatus,
|
|
|
- "display_status": sta.DisplayStatus,
|
|
|
- "source_status": sta.SourceStatus,
|
|
|
- "last_offline_time": time.Now(),
|
|
|
- "is_login": 0,
|
|
|
+ "is_login": isLogin,
|
|
|
}).Error
|
|
|
}
|
|
|
|