AccountModel.php 508 B

123456789101112131415161718192021
  1. <?php
  2. namespace app\models;
  3. use yii\base\Model;
  4. use app\models\entity\Accounts;
  5. class AccountModel extends Model
  6. {
  7. public function OnlineAccountCheck($last_seen, $timeout_seconds = 60)
  8. {
  9. //var_dump($last_seen);
  10. $last_seen = date($last_seen);
  11. $time = (time()-strtotime($last_seen));
  12. //$date1 = date('d.m.Y H:i', strtotime($last_seen_mobile));
  13. if ($time <= $timeout_seconds)
  14. return true;
  15. return false;
  16. }
  17. }