123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace app\common\model;
- use think\Cookie;
- use think\Model;
- /**
- * 模型
- */
- class Carts extends Model
- {
- // 表名
- protected $name = 'shop_carts';
- // 开启自动写入时间戳字段
- protected $autoWriteTimestamp = 'int';
- // 定义时间戳字段名
- protected $createTime = 'createtime';
- protected $updateTime = '';
- // 追加属性
- protected $append = [];
- public function Goods()
- {
- return $this->belongsTo('Goods', 'goods_id', 'id', [], 'LEFT');
- }
- public function Sku()
- {
- return $this->belongsTo('Sku', 'goods_sku_id', 'id', [], 'LEFT');
- }
- }
|