$list = M('goods g')
->field('g.cat_id,g.goods_id,g.goods_name,g.shop_price,g.market_price,g.commission')
->where("NOT EXISTS ( SELECT goods_id FROM tp_coupon c where c.goods_id = g.goods_id and c.user_id = $user_id and g.cat_id in(846,847,849)) and g.is_end = 0 and g.is_on_sale = 1 and g.cat_id in(846,847,849)")
->select();
查询在cat_id=(846,847,849)时,没出现在tp_coupon表中的产品