fix: add info last_connected_at & installed_at

ricky rx 2 years ago
parent 7118fea237
commit 3a66a4b040

@ -23,6 +23,8 @@ class TvController extends Controller {
$latestVideoUpdate = null;
if($request->id) {
$tv = Tv::find($request->id);
$tv->last_connected_at = now();
$tv->save();
$latestApkUpdate = ApkUpdate::getLatest();
$latestVideoUpdate = VideoUpdate::getLatestSelected();
}

@ -167,6 +167,8 @@ class NewTvRequest extends Model {
$tv->col10 = $tvRequest->col10;
$tv->notes = $tvRequest->notes;
$tv->device_info = $newTvReq->device_info;
$tv->installed_at = now();
$tv->last_connected_at = now();
$tv->save();
$newTvReq->activated_at = now();

@ -40,13 +40,6 @@ class Tv extends Model {
//------------------------------------------------------------
// -- RELATED TO DATA FUNCTION
public static function createAnonymousData() :Tv {
$newTv = new self;
$newTv->code = self::generateRandomCode();
$newTv->is_active = true;
$newTv->save();
return $newTv;
}
// -- END RELATED TO DATA FUNCTION
//------------------------------------------------------------

Loading…
Cancel
Save