代码优化提交

This commit is contained in:
wong
2025-04-17 17:18:35 +08:00
parent 4f838149e9
commit 9c33603c04
19 changed files with 1657 additions and 480 deletions

View 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);
}
}