feat: 产品
refactor: 产品详情页seo
This commit is contained in:
23
app/index/model/ProductParamsModel.php
Normal file
23
app/index/model/ProductParamsModel.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\index\model;
|
||||
|
||||
use app\common\model\ProductParamsBaseModel;
|
||||
|
||||
/**
|
||||
* 产品参数模型
|
||||
* @mixin \think\Model
|
||||
*/
|
||||
class ProductParamsModel extends ProductParamsBaseModel
|
||||
{
|
||||
// 所属产品范围查询
|
||||
public function scopeByProductId($query, $product)
|
||||
{
|
||||
if (is_array($product)) {
|
||||
$query->whereIn('product_id', $product);
|
||||
return;
|
||||
}
|
||||
$query->where('product_id', '=', $product);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user