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

$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 2nd, 2018 at 08:06 pm
If you think my article is useful to you, please feel free to appreciate