You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
684 B
32 lines
684 B
<?php
|
|
|
|
namespace app\integral\model;
|
|
|
|
class IntegralProductSpec extends Base
|
|
{
|
|
|
|
|
|
/**
|
|
* 查找所有规格
|
|
* @date 2022-11-09
|
|
*/
|
|
public function listSpec($where, $field = '*', $order = '')
|
|
{
|
|
if (empty($order)) {
|
|
$order = 'id desc';
|
|
}
|
|
|
|
return $this->with(['integralProductSpecItem'])->field($field)->where($where)->order($order)->select();
|
|
}
|
|
|
|
/**
|
|
* API-一对多关联规格项
|
|
* @date 2022-11-09
|
|
*/
|
|
public function integralProductSpecItem()
|
|
{
|
|
return $this->hasMany('IntegralProductSpecItem', 'spec_id', 'spec_id')
|
|
->field('spec_id,spec_item_id,spec_item_value');
|
|
}
|
|
|
|
} |