对接改价推送

main
yanzai 1 year ago
parent 3d596b12fe
commit 0c386a5db2

@ -10,6 +10,17 @@ class ComboItemGroupService
$combos=$res['变更套餐'];
$successCount = 0;//成功的数量
foreach ($combos as $combo){
if($combo['变更类别']=='改价'){
DB::table('combos')->where(['combo_id' => $combo['Id']])->update([
'original_price'=> $combo['原价'],
'price'=> $combo['价格'],
]);
foreach ($combo['包含项目'] as $key => $v) {
DB::table('combo_items')->where(['combo_id' => $combo['Id'],'item_id'=>$v['Id']])->update([
'price'=> $v['价格']
]);
}
}
if($combo['变更类别']=='删除'){
DB::table('combos')->where(['combo_id' => $combo['Id']])->delete();
DB::table('combo_items')->where(['combo_id' => $combo['Id']])->delete();
@ -103,6 +114,9 @@ class ComboItemGroupService
if(isset($res['变更收费项目'])){
$items=$res['变更收费项目'];
foreach ($items as $item){
if($item['变更类别']=='改价'){
DB::table('items')->where(['item_id'=>$item['Id']])->update(['price'=>$item['价格']]);
}
if($item['变更类别']=='删除'){
DB::table('items')->where(['item_id'=>$item['Id']])->delete();
}

Loading…
Cancel
Save