修复添加客户扩展信息时的bug

This commit is contained in:
老李 2021-04-10 20:57:59 +08:00
parent 3e41288687
commit 38ce9407cd
1 changed files with 6 additions and 3 deletions

View File

@ -196,9 +196,12 @@ class CustomerController extends Controller
]);
foreach ($dataInfo as $d){
DB::table('customer_field_value')
->where('customer_id','=',$id)
->where('customer_field_id',$d['customer_field_id'])
->update(['data'=>$d['data']]);
->updateOrInsert([
'customer_id' => $id,
'customer_field_id' => $d['customer_field_id'],
],[
'data'=>$d['data'],
]);
}
DB::commit();
return $this->success();