Php 如何解决此错误opencart注意:未定义属性:Proxy::GetTotalCustomersBytelPhone in

Php 如何解决此错误opencart注意:未定义属性:Proxy::GetTotalCustomersBytelPhone in,php,opencart-3,Php,Opencart 3,我使用opencart版本3.0.3.3 我试图用它来阻止客户注册中重复的电话号码 在catalog/model/account/customer.php中添加新函数: 代码:全选 public function getTotalCustomersByTelephone($telephone) { $query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "c

我使用opencart版本3.0.3.3

我试图用它来阻止客户注册中重复的电话号码

catalog/model/account/customer.php中添加新函数:
代码:全选

public function getTotalCustomersByTelephone($telephone) {
    $query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer WHERE LOWER(telephone) = '" . $this->db->escape(utf8_strtolower($telephone)) . "'");

    return $query->row['total'];
}
    // Customer Group
    if ($this->model_account_customer->getTotalCustomersByTelephone($this->request->post['telephone'])) {
        $this->error['warning'] = $this->language->get('error_exists');
    } 
在第237行电话输入检查之后,在
目录/controller/account/register.php中
代码:全选

public function getTotalCustomersByTelephone($telephone) {
    $query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer WHERE LOWER(telephone) = '" . $this->db->escape(utf8_strtolower($telephone)) . "'");

    return $query->row['total'];
}
    // Customer Group
    if ($this->model_account_customer->getTotalCustomersByTelephone($this->request->post['telephone'])) {
        $this->error['warning'] = $this->language->get('error_exists');
    } 
加: 代码:全选

public function getTotalCustomersByTelephone($telephone) {
    $query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer WHERE LOWER(telephone) = '" . $this->db->escape(utf8_strtolower($telephone)) . "'");

    return $query->row['total'];
}
    // Customer Group
    if ($this->model_account_customer->getTotalCustomersByTelephone($this->request->post['telephone'])) {
        $this->error['warning'] = $this->language->get('error_exists');
    } 
但当注册为新客户时,结果会显示这一点

注意:未定义的属性:第245行/home/xxx/public\u html/catalog/controller/account/register.php中的Proxy::getTotalCustomersBytelphone

我感激 谢谢,你说得对,只是我更新了现金,它工作正常。

我很感激
谢谢,你说得对,只要我刷新现金,它就可以正常工作。

return$query->row['total']??无效确保清除了缓存中的修改
返回$query->row['total']??无效确保已清除缓存中的修改