问题描述
我使用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'];
}
在第237行的电话输入检查之后,在catalog / controller / account / register.PHP中,之前 代码:全选
// Customer Group
if ($this->model_account_customer->getTotalCustomersByTelephone($this->request->post['telephone'])) {
$this->error['warning'] = $this->language->get('error_exists');
}
通知:未定义的属性:第245行的/home/xxx/public_html/catalog/controller/account/register.PHP中的Proxy :: getTotalCustomersByTelephone
解决方法
我很感激 谢谢,您是对的,请刷新现金,一切正常。