数组组合查询问题
-
原因:在查询数据库的时候数组中的元素依然在条件语句中存在,会导致第一个查询成功,第二次查询失败
$goods_id_array ; $goods_number_array ; for ($i = 0; $i < count($goods_id_array); $i++) { $number = $this->where($where)->find(); $where["goods_for_sale"] = $n["goods_num"] + $number["goods_for_sale"]; if ($this->save($where) === false) { $result["code"] = 603; $result["msg"] = $this->getError(); } //删除上一次更新的时候添加的条件 unset($where["goods_sales"]); }