feat: 产品

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

View File

@@ -0,0 +1,28 @@
<?php
declare (strict_types = 1);
namespace app\index\model;
use app\common\model\ProductPurchaseLinkBaseModel;
/**
* 产品购买链接模型
* @mixin \think\Model
*/
class ProductPurchaseLinkModel extends ProductPurchaseLinkBaseModel
{
// 关联购买平台
public function platform()
{
return $this->hasOne(ProductPurchasePlatformModel::class, 'id', 'platform_id');
}
// 所属产品范围查询
public function scopeByProductId($query, $product_id)
{
if (is_array($product_id)) {
return $query->where('product_id', 'IN', $product_id);
}
return $query->where('product_id', '=', $product_id);
}
}