CommentImage.php 635 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\common\model\sharing;
  3. use app\common\model\BaseModel;
  4. /**
  5. * 拼团商品评价图片模型
  6. * Class CommentImage
  7. * @package app\common\model\sharing
  8. */
  9. class CommentImage extends BaseModel
  10. {
  11. protected $name = 'sharing_comment_image';
  12. protected $updateTime = false;
  13. /**
  14. * 关联文件库
  15. * @return \think\model\relation\BelongsTo
  16. */
  17. public function file()
  18. {
  19. $module = self::getCalledModule() ?: 'common';
  20. return $this->belongsTo("app\\{$module}\\model\\UploadFile", 'image_id', 'file_id')
  21. ->bind(['file_path', 'file_name', 'file_url']);
  22. }
  23. }