<?php namespace app\api\model; use think\Model; class Cart extends Model { // 自动写入时间戳字段 protected $autoWriteTimestamp = 'int'; protected $createTime = 'createtime'; protected $updateTime = ''; public function goods() {
return $this->belongsTo('Goods', 'goods_id', 'goods_id', [], 'INNER')->setEagerlyType(0);
} public function sku() {
return $this->belongsTo('GoodsSpec', 'sku_id', 'goods_spec_id', [], 'INNER')->setEagerlyType(0);
} }