FootprintQuery.php 819 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace common\models\query;
  3. use common\enums\StatusEnum;
  4. /**
  5. * This is the ActiveQuery class for [[\common\models\TeamLike]].
  6. *
  7. * @see \common\models\TeamLike
  8. */
  9. class FootprintQuery extends \yii\db\ActiveQuery
  10. {
  11. public function active()
  12. {
  13. return $this->andWhere(['status' => StatusEnum::STATUS_ON]);
  14. }
  15. /**
  16. * @return $this
  17. */
  18. public function my()
  19. {
  20. return $this->andWhere(['user_id' => \Yii::$app->user->id]);
  21. }
  22. /**
  23. * @inheritdoc
  24. * @return \common\models\ClockLike[]|array
  25. */
  26. public function all($db = null)
  27. {
  28. return parent::all($db);
  29. }
  30. /**
  31. * @inheritdoc
  32. * @return \common\models\ClockLike|array|null
  33. */
  34. public function one($db = null)
  35. {
  36. return parent::one($db);
  37. }
  38. }