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.

24 lines
555 B

<?php
namespace app\integral\model;
use app\integral\model\IntegralProductSpecItem;
class IntegralProductSku extends Base
{
/**
* 获取SkuName
* @date 2021-03-01
*/
public function getSkuNameAttr($value, $data)
{
$spec_item_model = new IntegralProductSpecItem();
$spec_item = $spec_item_model->where([
['product_id', '=', $data['product_id']],
['spec_item_id', 'in', explode('_', $data['sku'])]
])->column('spec_item_value');
return implode(' ', $spec_item);
}
}