【修改】修改如下,测试可以用了,不知道妥不妥?
/**
* 发送邮件
*/
$result = $this->send_notice($member['member_id'],'email_touser_find_password',array(
'site_name' => $GLOBALS['setting_config']['site_name'],
'site_url' => SHOP_SITE_URL,
'user_name' => $_POST['username'],
'new_password' => $new_password
),false);
$this->addcron($cron_data,true);
$this->send_emailOp();
showDialog($lang['login_password_email_success'],SHOP_SITE_URL,'succ');
}
/**
* 异步发送邮件
*/
public function send_emailOp() {
Model('member')->checkloginMember();
$model_cron = Model('cron');
$condition = array();
$condition['type'] = 2;
$condition['exeid'] = $_SESSION['member_id'];
$condition['code'] = 'email_touser_find_password';
$cron_info = $model_cron->getCronInfo();
if (empty($cron_info)) return ;
$content = unserialize($cron_info['content']);
if (!$content[1]) $content[1] = false;
$this->send_notice($cron_info['exeid'],$cron_info['code'],$content[0],$content[1]);
$model_cron->delCron($condition);
}
} |