$giModel = M('GroupIntegral');
$gi_table = $giModel->order('id desc')->limit('999')->buildSql();//先排序
$gi_list = $giModel->table($gi_table .'as gi')
->field('gi.*,m.username,m.mobile')
->group('gi.uid')
->join('pre_members m on m.uid = gi.uid')
->select();//在关联分组