albumTable.php 加入checkreg和checklogin
在albumTable.php
加入
public function checkReg($aii_username) { $aii_username = $aii_username; $rowset = $this->select(array('aii_username' => $aii_username)); $row = $rowset->current(); if ($row) { throw new \Exception("this username already reg"); } return true; } //检查该用户名是否被注册 public function checkLogin(Album $album) { $aii_username = $album->aii_username; $aii_password=$album->aii_password; $rowset = $this->select(array('aii_username' => $aii_username,'aii_password'=>$aii_password)); $row = $rowset->current(); if (!$row) { throw new \Exception("the username or password is wrong"); } return true; } //验证登录