ecshop 待评价的功能

2016-07-07 15:01 来源:www.chinab4c.com 作者:ecshop专家



直接贴出sql语句,其它的靠你自已做了:
$sql = 'select g.goods_id,g.goods_name,og.order_id from ' . $ecs->table('goods') . ' as g left join ' . $ecs->table('order_goods') . 'as og on og.goods_id=g.goods_id where o.user_id=\''.$_SESSION['user_id'].'\' andg.goods_id not exists (select c.id_value from '. $ecs->table(comment) .' as c where c.comment_type=0 and c.user_id=\''.$_SESSION['user_id'].'\' )';

仅做参考,没做测试,可能有更好的方法

>>>>>>是有问题,改正过来了:

$sql = 'select g.goods_id,g.goods_name from ' . $ecs->table('goods') . ' as g left join ' . $ecs->table('order_goods') . ' as og on og.goods_id=g.goods_idleft join ' . $ecs->table('order_info') . 'as o on o.order_id=og.order_idwhere o.user_id=\''.$_SESSION['user_id'].'\' andg.goods_id not exists (select c.id_value from '. $ecs->table(comment) .' as c where c.comment_type=0 and c.user_id=\''.$_SESSION['user_id'].'\' )';