GoodsCategoryMap.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Models\Goods;
  3. use App\Base\BaseModel;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. /**
  6. * App\Models\Goods\GoodsCategoryMap
  7. *
  8. * @property int $id
  9. * @property int $goods_id
  10. * @property int $category_id
  11. * @property int $is_public 是否对普通会员展示
  12. * @property \Illuminate\Support\Carbon|null $created_at
  13. * @property \Illuminate\Support\Carbon|null $updated_at
  14. * @method static \Illuminate\Database\Eloquent\Builder|GoodsCategoryMap newModelQuery()
  15. * @method static \Illuminate\Database\Eloquent\Builder|GoodsCategoryMap newQuery()
  16. * @method static \Illuminate\Database\Eloquent\Builder|GoodsCategoryMap query()
  17. * @method static \Illuminate\Database\Eloquent\Builder|GoodsCategoryMap whereCategoryId($value)
  18. * @method static \Illuminate\Database\Eloquent\Builder|GoodsCategoryMap whereCreatedAt($value)
  19. * @method static \Illuminate\Database\Eloquent\Builder|GoodsCategoryMap whereGoodsId($value)
  20. * @method static \Illuminate\Database\Eloquent\Builder|GoodsCategoryMap whereId($value)
  21. * @method static \Illuminate\Database\Eloquent\Builder|GoodsCategoryMap whereIsPublic($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder|GoodsCategoryMap whereUpdatedAt($value)
  23. * @mixin \Eloquent
  24. * @property-read \App\Models\Goods\Category|null $category
  25. * @property-read \App\Models\Goods\Goods|null $goods
  26. */
  27. class GoodsCategoryMap extends BaseModel
  28. {
  29. protected $table = "goods_category_map";
  30. protected $fillable = ['goods_id', "category_id", "is_public"];
  31. public function format(...$options)
  32. {
  33. }
  34. public function category()
  35. {
  36. return $this->belongsTo(Category::class);
  37. }
  38. public function goods()
  39. {
  40. return $this->belongsTo(Goods::class);
  41. }
  42. }