public function judge_account_login($account_id, $passwd) { $condition['account_id'] = $account_id; //$condition ['password'] = $this->passwd ( $passwd ); $condition['password'] = xw_md5($passwd); // $condition['_logic'] = 'OR'; // 把查询条件传入查询方法 $data = $this->where($condition)->find(); if ($data) { return $data; } return false; }
public function j_register() { if (!isset($_POST['mem']) && !isset($_POST['myh']) && !isset($_POST['myz']) && !isset($_POST['mp1']) && !isset($_POST['mp2'])) { Response::show('-100', '注册信息丢失!'); } // 验证码 $checkcode = strtolower($_POST['myz']); // 用户的邮箱 $email = $_POST['mem']; $Memcached = Memcached::getInstance(); // 暂时不加密了。 if ($Memcached->get($email) == $checkcode) { // 验证码正确 // 注册用户信息封装 $account_info = null; $account_info['account_id'] = $_POST['mem']; $account_info['account_name'] = $_POST['myh']; $account_info['password'] = xw_md5($_POST['mp1']); $model = M(); $model->startTrans(); $account_model = D('Account'); if ($account_model->find($account_info['account_id'])) { Response::show('-100', '用户已经存在!'); } if ($account_model->add_account($account_info)) { $model->commit(); Response::show('200', '注册成功!'); } else { $model->rollback(); Response::show('-100', '注册失败!'); } } else { Response::show('-100', '验证码不正确!'); } }