$goods=new Goods();
$where = [
'and',
['shop_id' => $shopId]
];
if($status > 0){
$where[] = ['status' => $status];
}
if($keyword){
$where[]=['like', 'name', $keyword];
}yii 组装多个条件
最新推荐文章于 2022-05-29 13:09:34 发布
本文介绍了一种通过设置查询条件来筛选特定商品的方法。使用了多种查询参数,包括商店ID、状态及名称关键字等,以便精确查找目标商品。
4637

被折叠的 条评论
为什么被折叠?



