24 lines
490 B
PHP
24 lines
490 B
PHP
<?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);
|
|
}
|
|
}
|