Commit 7920ab68 authored by clone's avatar clone

用户验证

parent aa2e7a03
......@@ -94,7 +94,7 @@ class Basic extends Controller
//todo 待完成
$userModel = new Users();
$userArr = $userModel->selectUser($this->userId);
if (count($userArr) > 0 && ($userArr["status"] != 0 || $userArr["id"] != $this->userId || $userArr["user_phone"] != $this->phone)) {
if (count($userArr) > 0 && ( $userArr["id"] != $this->userId || $userArr["user_phone"] != $this->phone)) {
echo json_encode(array( "code" => "101", "msg" => "用户验证失败,重新登录!", "data" => [], "type" => "json" ));
exit;
}
......
......@@ -10,7 +10,16 @@ class Users extends Model
// 设置当前模型对应的完整数据表名称
protected $table = 'u_users';
public function add() {
public function add()
{
}
public function selectUser($userId)
{
$param["status"] = array( "eq", 0 );
return $this->field("id,user_phone")
->where($param)
->find($userId);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment