代码优化提交
This commit is contained in:
34
Server/application/store/model/VendorModel.php
Normal file
34
Server/application/store/model/VendorModel.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace app\store\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 供应商模型
|
||||
*/
|
||||
class VendorModel extends Model
|
||||
{
|
||||
// 设置表名
|
||||
protected $table = 's2_vendor';
|
||||
|
||||
// 主键
|
||||
protected $pk = 'id';
|
||||
|
||||
// 自动写入时间戳
|
||||
protected $autoWriteTimestamp = true;
|
||||
protected $createTime = 'createTime';
|
||||
protected $updateTime = 'updateTime';
|
||||
|
||||
// 隐藏字段
|
||||
protected $hidden = ['isDel'];
|
||||
|
||||
/**
|
||||
* 与套餐的关联
|
||||
*/
|
||||
public function packages()
|
||||
{
|
||||
return $this->hasMany('VendorPackageModel', 'vendorId', 'id')
|
||||
->where('isDel', 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user