public function audit($uids, $type = 1)
{
// 处理数据
!is_array($uids) && ($uids = explode(',', $uids));
$uids = array_unique(array_filter(array_map('intval', $uids)));
// 审核指定用户
$map['uid'] = array('IN', $uids);
$result = $this->_user_model->where($map)->setField('is_audit', $type);
model('User')->cleanCache($uids);
if (!$result) {
$this->_error = L('PUBLIC_REVIEW_FAIL');
// 审核失败
return false;
} else {
if ($type == 0) {
$this->_error = L('PUBLIC_CANCEL_REVIEW_SUCCESS');
// 取消审核成功
// 发送取消审核邮件
foreach ($uids as $touid) {
model('Notify')->sendNotify($touid, 'audit_error');
}
return true;
}
// 发送通过审核邮件
foreach ($uids as $uid) {
$this->sendActivationEmail($uid, 'audit_ok');
}
$this->_error = L('PUBLIC_REVIEW_SUCCESS');
// 审核成功
return true;
}
}