Comment.php 577 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Comment extends Model
  5. {
  6. protected $connection = 'mysql_w';
  7. protected $table='comment';
  8. protected $fillable=['user_id','store_id','content','start','is_reply','comment_id','order_id','is_see'];
  9. public function comment(){
  10. return $this->hasMany(Comment::class,'comment_id','id');
  11. }
  12. public function user(){
  13. return $this->hasOne(UserW::class,'id','user_id');
  14. }
  15. public function store(){
  16. return $this->hasOne(Store::class,'id','store_id');
  17. }
  18. }