相信很多使用ECSHOP的朋友都想要這個(gè)功能,網(wǎng)上也有很多類似的修改教程。
下面說(shuō)一下我的方法,也比較簡(jiǎn)單,已在ECSHOP2.7.2版測(cè)試通過(guò)。
打開(kāi) /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;
}
是不是挺簡(jiǎn)單的。
其他版本的ECSHOP,站長(zhǎng)沒(méi)有親自測(cè)試,相信也可以用此方法來(lái)解決。
新聞熱點(diǎn)
疑難解答
圖片精選