$tableName = "domain_5min_result_{$data}";
//原生写法 $data = M()->execute("insert into channel_stat.domain_5min_result_20201023 (`user_id`,`cdn_type_id`,`down_domain_id`,`open_supplier_id`,`time_stamp`,`all_down_size`,`flow`) values(0,3,0,1,1597247700,7500,7600) ON DUPLICATE key update flow=values(flow)"); $field = "user_id,cdn_type_id,down_domain_id,open_supplier_id,time_stamp,all_down_size,flow"; $updateField = 'all_down_size,flow'; $bandWidthData[0]['flow'] ="12232313213";
//thinkphp写法 $data =D('Stat/Domain5MinResult')->add($bandWidthData[0], [ 'table' =>'domain_5min_result_20201008' , 'field' => $field ], $updateField);