Commit 5b034a47 authored by hj's avatar hj

更新提交

parent bd604eec
......@@ -105,6 +105,37 @@ class WuxiApiNewService extends PlatformAbstractService
$mergeData = [];
foreach($metaData['rawList'] as $datas){
if(!empty($datas['product_extend'])){
$tempData['supplier_product_id'] = $datas['r_code'];
$tempData['mdl'] = $datas['product_extend']['mdl'] ?? '';
$tempData['cas'] = $datas['c_cas'];
$tempData['nu'] = $datas['product_extend']['un'] ?? '';
$tempData['chinese_name'] = $datas['product_extend']['chinese_name'];
$tempData['english_name'] = $datas['product_extend']['english_name'];
$tempData['chemicalformula'] = $datas['product_extend']['molecular_formula'] ?? '';
$tempData['molecular_weight'] = $datas['product_extend']['molecular_weight'] ?? '';
$tempData['brand'] = $datas['product_extend']['brand'] ?? '';
$tempData['purity'] = $datas['product_extend']['purity'] ?? '';
$tempData['usually_ships_days_min'] = $datas['product_extend']['lead_time_min_days'] ?? '';
$tempData['usually_ships_within_days'] = $datas['product_extend']['lead_time_max_days'] ?? '';
$tempData['backorder_lead_time'] = $datas['product_extend']['lead_time_back_order_days'] ?? '';
//储存条件
$tempData['storage_condition'] = $datas['product_extend']['storage_condition'];
//运输条件
$tempData['transportation_condition'] = $datas['product_extend']['transportation_condition'];
$tempData['smiles'] = $datas['product_extend']['smiles'];
$tempData['sub_category'] = $datas['product_extend']['sub_category'];
$tempData['group_id'] = $datas['product_extend']['product_category'];
//是否进口
$tempData['is_imported'] = $datas['product_extend']['is_imported'];
//是否推送电商
$tempData['is_push_ds'] = false;
$tempData['ships_additional_description'] = $datas['product_extend']['ships_additional_description'];
$tempData['chemical_dissolve_cas'] = $datas['product_extend']['chemical_dissolve_cas'];
}
/*$tempData['supplier_product_id'] = $datas['r_code'];
$tempData['mdl'] = '';
$tempData['cas'] = $datas['c_cas'];
......@@ -180,7 +211,7 @@ Compounds,
];
$pack['prices'][] = [
'price' => bcmul($package['p_price'], 0.5, 2),
'price' => bcmul($package['p_price'], 1, 2),
'currency' => 'RMB',
//'status' => 'ACTIVE'
];
......
......@@ -219,18 +219,24 @@ class WuxiLabNewService
return false;
}
try{
$noSmiles = [];
/*$noSmiles = [];
foreach($updateData['rawList'] as $data){
if(empty($data['c_smiles']) && !empty($data['c_cas'])){
$noSmiles[] = $data['c_cas'];
}
}
}*/
$updateData['rawList'] = array_column($updateData['rawList'], null, 'c_cas');
$productsIdsList = array_column($updateData['rawList'], 'product_id');
$productsIdsList = array_column($updateData['rawList'], 'r_code');
$productsList = app(WuxiLabUpdateProductsService::class)->getUpdateProductsListByProductIds($productsIdsList);
dd($productsList);
if(!empty($productsList)){
$productsList = array_column($productsList, null, 'product_id');
foreach($updateData['rawList'] as &$data){
if(!empty($productsList[$data['r_code']])){
$data['product_extend'] = $productsList[$data['r_code']];
}
}
}
/*if(!empty($noSmiles)){
$noSmiles = array_unique($noSmiles);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment