tp3.2group和sum的联合使用

$res = M('settlement')
            ->field(['*','sum(total_amount)'=>'total_amount','sum(price)'=>'price','sum(agent_coupon_price)'=>'agent_coupon_price','sum(integral_money)'=>'integral_money','sum(settlement_price)'=>'settlement_price','sum(price_back)'=>'price_back','sum(clean_price)'=>'clean_price'])
            ->group('uid')
            ->select();

 

转载于:https://my.oschina.net/u/4054486/blog/3085281

你可能感兴趣的:(tp3.2group和sum的联合使用)