审查视图

application/api/model/Cart.php 516 字节
李忠强 authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php


namespace app\api\model;


use think\Model;

class Cart extends Model
{
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    protected $createTime = 'createtime';
    protected $updateTime = '';

    public function goods()
    {
18
        return $this->belongsTo('Goods', 'goods_id', 'goods_id', [], 'INNER')->setEagerlyType(0);
李忠强 authored
19 20 21 22
    }

    public function sku()
    {
23
        return $this->belongsTo('GoodsSpec', 'sku_id', 'goods_spec_id', [], 'INNER')->setEagerlyType(0);
李忠强 authored
24 25
    }
}