feat: 产品

refactor: 产品详情页seo
This commit is contained in:
2025-04-24 10:21:45 +08:00
parent 2f848b7522
commit 2596988965
43 changed files with 592 additions and 63 deletions

View File

@@ -0,0 +1,25 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
use app\common\model\ProductRelatedBaseModel;
/**
* 相关产品表模型
* @mixin \think\Model
*/
class ProductRelatedModel extends ProductRelatedBaseModel
{
// 关联产品
public function product()
{
return $this->hasOne(ProductModel::class, 'id', 'related_product_id');
}
// 所属产品范围查询
public function scopeByProductId($builder, $product_id)
{
return $builder->where('product_id', '=', $product_id);
}
}