fix method query

This commit is contained in:
iBNu Maksum 2025-03-04 15:16:48 +07:00
parent ee3dcc05a0
commit 3b7d478635
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5

View File

@ -55,15 +55,13 @@ switch ($action) {
->where('type', $tp);
if (count($mts) > 0) {
if (count($mts) != count($methods)) {
$w = [];
$v = [];
foreach ($mts as $mt) {
$w = [];
$v = [];
foreach ($mts as $mt) {
$w[] ='method';
$v[] = "$mt - %";
}
$query->where_likes($w, $v);
$w[] ='method';
$v[] = "$mt - %";
}
$query->where_likes($w, $v);
}
}
if (count($rts) > 0) {
@ -90,15 +88,13 @@ switch ($action) {
}
if (count($mts) > 0) {
if (count($mts) != count($methods)) {
$w = [];
$v = [];
foreach ($mts as $mt) {
$w = [];
$v = [];
foreach ($mts as $mt) {
$w[] ='method';
$v[] = "$mt - %";
}
$query->where_likes($w, $v);
$w[] ='method';
$v[] = "$mt - %";
}
$query->where_likes($w, $v);
}
}
if (count($rts) > 0) {
@ -126,17 +122,6 @@ switch ($action) {
if (count($plns) > 0) {
$query->where_in('plan_name', $plns);
}
if (count($mts) > 0) {
if (count($mts) != count($methods)) {
$w = [];
$v = [];
foreach ($mts as $mt) {
$w[] ='method';
$v[] = "$mt - %";
}
$query->where_likes($w, $v);
}
}
$count = $query->count();
if ($count > 0) {
$result['datas'][] = $count;
@ -173,15 +158,13 @@ switch ($action) {
}
if (count($mts) > 0) {
if (count($mts) != count($methods)) {
$w = [];
$v = [];
foreach ($mts as $mt) {
$w = [];
$v = [];
foreach ($mts as $mt) {
$w[] ='method';
$v[] = "$mt - %";
}
$query->where_likes($w, $v);
$w[] ='method';
$v[] = "$mt - %";
}
$query->where_likes($w, $v);
}
}
if (count($rts) > 0) {