feat: 添加产品购买链接相关接口

This commit is contained in:
2025-02-18 18:09:11 +08:00
parent 0ec541ab76
commit 8913ec7e5e
5 changed files with 452 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
declare (strict_types = 1);
namespace app\admin\model\v1;
use app\common\model\ProductPurchaseLinkBaseModel;
/**
* 产品 - 购买链接模型
* @mixin \think\Model
*/
class ProductPurchaseLinkModel extends ProductPurchaseLinkBaseModel
{
// 关联产品
public function product()
{
return $this->belongsTo(ProductModel::class, 'product_id', 'id');
}
// 关联平台
public function platform()
{
return $this->belongsTo(ProductPurchaseLinkPlatformModel::class, 'platform_id', 'id');
}
// 根据语言查询
public function scopeLanguage($query, $value)
{
$query->where('language_id', '=', $value);
}
}

View File

@@ -0,0 +1,19 @@
<?php
declare (strict_types = 1);
namespace app\admin\model\v1;
use app\common\model\ProductPurchasePlatformBaseModel;
/**
* 产品 - 采购链接平台模型
* @mixin \think\Model
*/
class ProductPurchaseLinkPlatformModel extends ProductPurchasePlatformBaseModel
{
// 根据语言查询
public function scopeLanguage($query, $value)
{
$query->where('language_id', '=', $value);
}
}