相信很多使用ECSHOP的朋友都想要這個功能,網(wǎng)上也有很多類似的修改教程。
下面說一下我的方法,也比較簡單,已在ECSHOP2.7.2版測試通過。
打開 /includes/modules/integrates/integrate.php 文件。
找到
if ($this->check_user($username, $password) > 0)
在它上面添加下面代碼段
if(is_email($username))
{
$sql = "select ".$this->field_name." from ".$this->table($this->user_table)." where ".$this->field_email."='".$username."'";
$username = $this->db->getOne($sql);
if(!$username) return false;
}
是不是挺簡單的。
其他版本的ECSHOP,站長沒有親自測試,相信也可以用此方法來解決。
新聞熱點
疑難解答
圖片精選