Depot.php
679 字节
<?php
namespace app\api\model;
use think\Model;
class Depot extends Model
{
// 表名
protected $name = 'depot';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
];
public function goods()
{
return $this->belongsTo('Goods', 'goods_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function area()
{
return $this->belongsTo('Area', 'area_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}