才不是懒 只是在思考怎么写个性签名!
Customer::find() ->from(Customer::tableName().' A') ->select(['A.*', 'sum(B.amount)']) ->leftJoin(erp_order::tableName(). ' B', 'A.id = B.customer_id and B.status = 1') ->andWhere(['A.status'=>1]) ->groupBy('A.id') ->asArray() ->all()
可以了 谢谢