Notify.php 661 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Author: NODELOG
  5. * DateTime: 2017/3/8 17:34
  6. * Description:
  7. */
  8. namespace api\modules\v1\models;
  9. use api\common\models\User;
  10. class Notify extends \common\models\Notify
  11. {
  12. public function fields()
  13. {
  14. return [
  15. 'from',
  16. 'to',
  17. 'title'
  18. ];
  19. }
  20. public function extraFields()
  21. {
  22. return [
  23. 'content',
  24. ];
  25. }
  26. public function getFrom()
  27. {
  28. return $this->hasOne(User::className(), ['id' => 'from_uid']);
  29. }
  30. public function getTo()
  31. {
  32. return $this->hasOne(User::className(), ['id' => 'to_uid']);
  33. }
  34. }