- update t_porg_commission_discount d inner join (select store_id,travel_agency_id,time_date,sale_type,sum(parking_fee) as parking_fee, sum(personnel_fee) as personnel_fee, sum(sichou_commission_fee) as sichou_commission_fee, sum(sijin_commission_fee) as sijin_commission_fee, sum(baihuo_commission_fee) as baihuo_commission_fee, sum(fee_subtotal) as fee_subtotal from t_plvs_order where store_id=' . $store_id . ' and settlement_status < 1 and commission_rate_id > 0 group by store_id,travel_agency_id,time_date,sale_type) as o on d.store_id=o.store_id and d.travel_agency_id=o.travel_agency_id and d.time_date=o.time_date and d.sale_type=o.sale_type set d.parking_fee=o.parking_fee, d.personnel_fee=o.personnel_fee, d.sichou_commission_fee=o.sichou_commission_fee, d.sijin_commission_fee=o.sijin_commission_fee, d.baihuo_commission_fee=o.baihuo_commission_fee, d.subtotal=o.fee_subtotal where d.store_id=1 and d.status < 1
- --该片段来自于http://www.codesnippet.cn/detail/0707201614812.html
来源: http://www.codesnippet.cn/detail/0707201614812.html