where($map)
查询条件的数组是这样的
$map['pass']="1";
$map['ems'] = '2';
$map['status']="sellout";
但 我想加个sql查询 where = " and (select count(c.item_id) from " . table("items_cate_re") ." as c where c.cate_id=$cid and c.item_id=" . table("items") . ".id)>0 ";
如果是普通的 $where =" pass = 1" 这的话
直接 $where .= " and (select count(c.item_id) from " . table("items_cate_re") ." as c where c.cate_id=$cid and c.item_id=" . table("items") . ".id)>0 ";
就好了
原sql 是这样的
$items_list = $item_mod->where($map)->order($order)->limit($start . ',' . $page_size)->select();
可是 数组 和字符串 混一起了 搞了半天 没搞出来 晕倒的
求指点迷津 谢谢
最佳答案