Notification.php 709 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\admin\model\ask;
  3. use think\Model;
  4. class Notification extends Model
  5. {
  6. // 表名
  7. protected $name = 'ask_notification';
  8. // 自动写入时间戳字段
  9. protected $autoWriteTimestamp = 'int';
  10. // 定义时间戳字段名
  11. protected $createTime = 'createtime';
  12. protected $updateTime = 'updatetime';
  13. // 追加属性
  14. protected $append = [
  15. ];
  16. public function fromuser()
  17. {
  18. return $this->belongsTo("\app\common\model\User", 'from_user_id', 'id', [], 'LEFT')->setEagerlyType(0);
  19. }
  20. public function touser()
  21. {
  22. return $this->belongsTo("\app\common\model\User", 'to_user_id', 'id', [], 'LEFT')->setEagerlyType(0);
  23. }
  24. }