$result = Db::table('xxxxxx') // 表名
->alias('g')
->join('xxxxx_2 u','g.user_id = u.id')
->where('(user_id = '.$user_id.' OR puser_id = '.$user_id.') AND pay_mineral = 0') // pay_menral为硬性条件
->order('pdate desc') // 时间倒序
->select();