From fba566220dade0cb50333cd4b8fe45c867020f5f Mon Sep 17 00:00:00 2001 From: hetao Date: Tue, 19 Nov 2024 10:10:59 +0800 Subject: [PATCH] =?UTF-8?q?<=3D>=20change=20to=20=3D,=E6=95=88=E7=8E=87?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/db/Db.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/db/Db.php b/plugins/db/Db.php index 16a18fc..422db23 100644 --- a/plugins/db/Db.php +++ b/plugins/db/Db.php @@ -162,7 +162,7 @@ public function select($table,$condition="",$item="",$groupby="",$orderby="",$le $params=[]; $condition_str=""; if(!empty($condition)){ - $condition_str = "WHERE ".$this->buildsql($condition, "<=>", false, true, "AND",$params); + $condition_str = "WHERE ".$this->buildsql($condition, "=", false, true, "AND",$params); } //ITEM if(!empty($item)){ @@ -256,7 +256,7 @@ public function update($table,$condition,$item){ $params=[]; $params2=[]; $value = $this->buildsql($item, "=", false, true, ",",$params); - $condition_str = $this->buildsql($condition, "<=>", false, true, "AND",$params2); + $condition_str = $this->buildsql($condition, "=", false, true, "AND",$params2); if($condition_str!=""){ $condition_str=" WHERE ".$condition_str; } @@ -273,7 +273,7 @@ public function update($table,$condition,$item){ public function delete($table,$condition){ $table = $this->buildsql($table, "AS"); $params=[]; - $condition_str = $this->buildsql($condition, "<=>", false, true, "AND",$params); + $condition_str = $this->buildsql($condition, "=", false, true, "AND",$params); if($condition_str!=""){ $condition_str=" WHERE ".$condition_str; } @@ -412,6 +412,10 @@ private function buildsql($mixed, $split="", $revert=true, $alias=true, $joinfla [$v,$k] = [$k,$v]; //swap } if($return_params!==NULL){ + if($v===NULL && $joinflag=="AND"){ + $tmp[]="$k IS NULL"; + continue; + } $return_params[]=$v; $v="?"; }