code = $code.$max_id; $tax->save(); $customer->tax_max_id = $max_id; $customer->save(); // 客户档案写入外部接口 $department = DB::table('department')->where('id', $tax['department_id'])->first(); $class = DB::table('customer_class')->where('id', $tax['class_id'])->first(); $tax['class_code'] = $class['code']; $tax['department_code'] = $department['code']; $tax['headCode'] = $customer->code; $ret = plugin_sync_api('CustomerSync', $tax); if ($ret['success'] == true) { return $params; } abort_error($ret['msg']); } return $params; } public function onBeforeDelete($params) { return $params; } }