@@ -220,7 +220,7 @@ class Goods extends Backend
$skuId=[];
$detailId=[];
foreach ($data['sku'] as $key=>$_sku){
- $sku=Arr::only($_sku,['amount_cost','amount_kill_ladder','amount_ladder','num_stock','num_stock_kill','temp_ids','id']);
+ $sku=Arr::only($_sku,(new GoodsSku)->columns());
$sku['name']=$_sku['specValues'];
$sku['goods_id']=$goods['id'];
if(!empty($sku['id'])){
@@ -2373,4 +2373,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
public function hasColumn($column){
return in_array($column,$this->getTableInfo()['fields']);
}
+ public function columns(){
+ return $this->getTableInfo()['fields'];
+ }