一个条件的时候,可以直接运用以下方法:

$map['miaoshu'] =array('like','%'.$sp.'%');
$result=M('shangpin')->where($map)->select();

多个查询条件的时候,

$map['spname | miaoshu'] =array('like','%'.$sp.'%');
$result=M('shangpin')->where($map)->select();
Last modification:September 2, 2018
If you think my article is useful to you, please feel free to appreciate