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.
30 lines
623 B
30 lines
623 B
<?php
|
|
|
|
namespace app\mall\model;
|
|
|
|
|
|
class MallProductSpec extends Base
|
|
{
|
|
|
|
/**
|
|
* 查找所有规格
|
|
* @date 2022-12-13
|
|
*/
|
|
public function listSpec($where, $field = '*', $order = '')
|
|
{
|
|
if (empty($order)) {
|
|
$order = 'id desc';
|
|
}
|
|
|
|
return $this->with(['mallProductSpecItem'])->field($field)->where($where)->order($order)->select();
|
|
}
|
|
|
|
|
|
/**
|
|
* 一对多关联规格项
|
|
*/
|
|
public function mallProductSpecItem()
|
|
{
|
|
return $this->hasMany('MallProductSpecItem', 'spec_id', 'spec_id')->field('spec_id,spec_item_id,spec_item_value');
|
|
}
|
|
} |