AiChatContent.php 767 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. /**
  5. * 聊天内容
  6. */
  7. class AiChatContent extends SoftBaseModel
  8. {
  9. protected $table = 'ai_chat_content';
  10. //机器人ID
  11. const ROBOT_USER_ID = 1001000001;
  12. //操作类型【1:是问,2:答】
  13. const OPERATE_TYPE_ASK = 1;
  14. const OPERATE_TYPE_ANSWER = 2;
  15. /**
  16. * 发送用户的信息
  17. * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
  18. */
  19. public function user(){
  20. return $this->belongsTo(User::class, 'user_id', 'id');
  21. }
  22. /**
  23. * 目标用户信息
  24. * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
  25. */
  26. public function target(){
  27. return $this->belongsTo(User::class, 'target_id', 'id');
  28. }
  29. }