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.

Cart.php 627 B

4 years ago
12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace addons\unishop\model;
  3. use think\Model;
  4. /**
  5. * Class Cart 购物车
  6. * @package addons\unishop\model
  7. */
  8. class Cart extends Model
  9. {
  10. // 表名
  11. protected $name = 'unishop_cart';
  12. // 开启自动写入时间戳字段
  13. protected $autoWriteTimestamp = 'int';
  14. // 定义时间戳字段名
  15. protected $createTime = 'createtime';
  16. protected $updateTime = 'updatetime';
  17. //是否选中
  18. const CHOOSE_ON = 1; // 是
  19. const CHOOSE_OFF = 0; // 否
  20. /**
  21. * 关联产品
  22. */
  23. public function product(){
  24. return $this->hasOne('product', 'id', 'product_id');
  25. }
  26. }