<?php
/*
 本代码由 口号帮 创建
 创建时间 2019-05-08 16:22:09
 技术支持 口号帮 
 严禁反编译、逆向等任何形式的侵权行为，违者将追究法律责任
*/

namespace App\Models;use Illuminate\Database\Eloquent\Model;use Illuminate\Database\Eloquent\SoftDeletes;class Product extends Model{use SoftDeletes;protected $dates=['deleted_at'];protected $casts=['market_element'=>'json','guess_like'=>'json'];protected $guarded=[];public function corner(){return $this->belongsTo(Corner::class,'corner_id','id');}public function material(){return $this->belongsToMany(ProductMaterial::class,'product_has_materials','product_id','material_id');}public function channel(){return $this->belongsToMany(ProductChannel::class,'product_has_channels','product_id','channel_id');}public function zichannel(){return $this->belongsToMany(ProductZimeitiChannel::class,'product_has_zimeiti_channels','product_id','zimeiti_channel_id');}public function resource(){return $this->belongsToMany(ProductResource::class,'product_has_resources','product_id','resource_id');}public function trade(){return $this->belongsToMany(ProductTrade::class,'product_has_trades','product_id','trade_id');}public function video(){return $this->belongsToMany(ProductVideo::class,'product_has_videos','product_id','video_id');}public function label(){return $this->belongsToMany(ProductLabel::class,'product_has_labels','product_id','label_id');}public function zimeiti(){return $this->belongsToMany(ProductZimeitiChannel::class,'product_has_zimeiti_channels','product_id','zimeiti_channel_id');}public function collect(){return $this->belongsToMany(ProductCollectionName::class,'product_has_collections','product_id','collection_id');}public function website(){return $this->belongsToMany(ProductWebsite::class,'product_has_websites','product_id','website_id');}public function type(){return $this->belongsToMany(ProductType::class,'product_has_types','product_id','type_id');}public function protype(){return $this->belongsToMany(ProductType::class,'product_has_types','product_id','type_id');}public function category(){return $this->belongsToMany(ProductCategory::class,'product_has_categories','product_id','category_id');}public function column(){return $this->belongsToMany(ProductColumn::class,'product_has_columns','product_id','column_id');}public function district(){return $this->belongsToMany(District::class,'product_has_districts','product_id','district_id');}public function platform(){return $this->hasMany(ProductPlatform::class,'product_id','id');}public function fans(){return $this->hasOne(ProductFan::class,'product_id','id');}public function views(){return $this->hasOne(ProductView::class,'product_id','id');}public function apply(){return $this->hasMany(Apply::class,'product_id','id');}public function member(){return $this->hasOne(Member::class,'id','member_id');}public function productComment(){return $this->hasOne(Comment::class,'product_id','id');}public function limitDistrict(){return $this->hasMany(ProductDistrict::class,'product_id','id');}public function pro_type(){return $this->hasOne(ProductHasType::class,'product_id','id');}public function order(){return $this->hasMany(Apply::class,'id','product_id');}public function media(){return $this->hasOne(Member::class,'id','member_id');}public function product_attribute(){return $this->hasOne(ProductArticleAttribute::class,'product_id','id');}}
?>