GoodsLabel.php 896 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Http\Models;
  3. use Eloquent;
  4. use Illuminate\Database\Eloquent\Builder;
  5. use Illuminate\Database\Eloquent\Model;
  6. /**
  7. * 商品标签
  8. * Class GoodsLabel
  9. *
  10. * @package App\Http\Models
  11. * @mixin Eloquent
  12. * @property int $id
  13. * @property int $goods_id 商品ID
  14. * @property int $label_id 标签ID
  15. * @property-read Goods $goods
  16. * @method static Builder|GoodsLabel newModelQuery()
  17. * @method static Builder|GoodsLabel newQuery()
  18. * @method static Builder|GoodsLabel query()
  19. * @method static Builder|GoodsLabel whereGoodsId($value)
  20. * @method static Builder|GoodsLabel whereId($value)
  21. * @method static Builder|GoodsLabel whereLabelId($value)
  22. */
  23. class GoodsLabel extends Model
  24. {
  25. public $timestamps = FALSE;
  26. protected $table = 'goods_label';
  27. protected $primaryKey = 'id';
  28. function goods()
  29. {
  30. return $this->hasOne(Goods::class, 'id', 'goods_id');
  31. }
  32. }