You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
543 B

5 years ago
5 years ago
  1. <?php
  2. namespace App\Model\v3;
  3. use App\Model\Model;
  4. use Hyperf\Database\Model\SoftDeletes;
  5. class ShoppingCart extends Model
  6. {
  7. use SoftDeletes;
  8. protected $table = 'lanzu_shopping_cart';
  9. protected $fillable = [
  10. 'id',
  11. 'user_id',
  12. 'goods_id',
  13. 'market_id',
  14. 'store_id',
  15. 'num',
  16. 'activity_type'
  17. ];
  18. public function store()
  19. {
  20. return $this->belongsTo(Store::class, 'store_id', 'id');
  21. }
  22. public function goods()
  23. {
  24. return $this->morphTo();
  25. }
  26. }