All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 6s
25 lines
515 B
PHP
25 lines
515 B
PHP
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\admin\model\v1;
|
|
|
|
use app\common\model\ProductCompatRelBaseModel;
|
|
|
|
/**
|
|
* @mixin \think\Model
|
|
*/
|
|
class ProductCompatRelModel extends ProductCompatRelBaseModel
|
|
{
|
|
// 关联兼容性数据
|
|
public function compat()
|
|
{
|
|
return $this->hasOne(ProductCompatModel::class, 'id', 'compat_id');
|
|
}
|
|
|
|
// 按所属产品查询
|
|
public function scopeProductId(\think\db\Query $query, int $id)
|
|
{
|
|
$query->where('product_id', '=', $id);
|
|
}
|
|
}
|