作者 郭盛
1 个管道 的构建 通过 耗费 12 秒

修改搜索

... ... @@ -387,10 +387,8 @@ class User extends Api
if(!empty($param['address'])){
$address = $param['address'];
$where_address = function ($query_address) use ($address) {
foreach ($address as $v){
$a = Db::name('words')->where('id',$v)->field('id,name')->find();
$query_address->where('address_ids','like','%,'.$v.',%')->whereor('keyword','like',"%$a[name]%");
}
$a = Db::name('words')->where('id',$address)->field('id,name')->find();
$query_address->where('address_ids','like','%,'.$address.',%')->whereor('keyword','like',"%$a[name]%");
};
}
... ... @@ -399,21 +397,18 @@ class User extends Api
if(!empty($param['text'])){
$text = $param['text'];
$where_text = function ($query_text) use ($text) {
foreach ($text as $vt){
$a = Db::name('words')->where('id',$vt)->field('id,name')->find();
$query_text->where('text_ids','like','%,'.$vt.',%')->whereor('keyword','like',"%$a[name]%");
}
$a = Db::name('words')->where('id',$text)->field('id,name')->find();
$query_text->where('text_ids','like','%,'.$text.',%')->whereor('keyword','like',"%$a[name]%");
};
}
//判断如果传递过来价格关键词不为空
$where_price = [];
if(!empty($param['price'])){
$price = $param['price'];
$where_price = function ($query_price) use ($price) {
foreach ($price as $vp){
$query_price->where('price',$vp);
}
$query_price->where('price',$price);
};
}
... ...