123456789101112131415161718192021222324 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class Comment extends Model
- {
- protected $connection = 'mysql_w';
- protected $table='comment';
- protected $fillable=['user_id','store_id','content','start','is_reply','comment_id','order_id','is_see'];
- public function comment(){
- return $this->hasMany(Comment::class,'comment_id','id');
- }
- public function user(){
- return $this->hasOne(UserW::class,'id','user_id');
- }
- public function store(){
- return $this->hasOne(Store::class,'id','store_id');
- }
- }
|