35 lines
1.0 KiB
PHP
35 lines
1.0 KiB
PHP
<?php
|
||
|
||
namespace app\common\model\wms;
|
||
|
||
use think\Model;
|
||
|
||
/**
|
||
* 地区数据模型
|
||
*/
|
||
class Storage extends Model
|
||
{
|
||
protected $connection = 'db_wms';
|
||
// 表名
|
||
protected $name = 'storage';
|
||
// 自动写入时间戳字段
|
||
protected $autoWriteTimestamp = 'int';
|
||
// 定义时间戳字段名
|
||
protected $createTime = 'createtime';
|
||
protected $updateTime = 'updatetime';
|
||
// 追加属性
|
||
protected $append = [
|
||
];
|
||
public function employees()//yewu为第一张表的字段,employee_num为第二张表的字段
|
||
{
|
||
return $this->belongsTo('app\common\model\wms\Stock', 'STOCKID', 'STOCKID', [], 'LEFT')->setEagerlyType(0);
|
||
}
|
||
public function employees2()//yewu为第一张表的字段,employee_num为第二张表的字段
|
||
{
|
||
return $this->belongsTo('app\common\model\wms\Space', 'SPACEID', 'SPACEID', [], 'LEFT')->setEagerlyType(0);
|
||
}
|
||
public function goods(){
|
||
return $this->belongsTo('app\common\model\wms\Goods', 'GOODSID', 'GOODSID', [], 'LEFT')->setEagerlyType(0);
|
||
}
|
||
}
|