|
|
@ -314,6 +314,12 @@ class GoodsManager |
|
|
|
return $attributes; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param $attrId |
|
|
|
* @param $goodsId |
|
|
|
* @return GoodsAttr[]|GoodsSku[]|array|File[]|\common\models\ars\TemFile[]|\yii\db\ActiveRecord[] |
|
|
|
* 获取属性值 |
|
|
|
*/ |
|
|
|
public static function getAttrValue($attrId, $goodsId) |
|
|
|
{ |
|
|
|
return GoodsAttr::find() |
|
|
@ -324,6 +330,12 @@ class GoodsManager |
|
|
|
->all(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param $type |
|
|
|
* @param $goodsId |
|
|
|
* @return array |
|
|
|
* 获取已存储的商品sku的id |
|
|
|
*/ |
|
|
|
public static function getOriginalIds($type, $goodsId) |
|
|
|
{ |
|
|
|
$ids = []; |
|
|
@ -387,6 +399,15 @@ class GoodsManager |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param $type |
|
|
|
* @param $data |
|
|
|
* @param $goodsId |
|
|
|
* @return bool |
|
|
|
* @throws \Throwable |
|
|
|
* @throws \yii\db\StaleObjectException |
|
|
|
* 删除sku |
|
|
|
*/ |
|
|
|
public static function deleteSku($type, $data, $goodsId) |
|
|
|
{ |
|
|
|
if (!$data['originalIds']) { |
|
|
|