$coupons = pdo_fetchall("select * from ".tablename('wangniu_activity')." where flag = 0 and isopen = 1 and ischeck = 1 and start_time < ".time()." and end_time > ".time()." and weid = ".$weid." and storeid = '".$id."'. order by type asc");
... " and storeid = '".$id."' order by type asc"