where(['pwd' => md5($pwd), 'appid' => $appid], "(", ")")->where('(user', $user)->whereOr(['email' => $user, 'phone' => $user], ")")->find(); //false if (!$res_user) out(113, $app_res); //账号密码不正确 if ($res_user['ban'] > time() || $res_user['ban'] == 999999999) out(114, $res_user['ban_notice'], $app_res); //账号被禁用 $res = Db::table('user')->where('id', $res_user['id'])->update(['pwd' => md5($newpwd)]); //die($res); if ($res) { if (defined('USER_LOG') && USER_LOG == 1) { Db::table('log')->add(['uid' => $res_user['id'], 'type' => $act, 'status' => 200, 'time' => time(), 'ip' => getip(), 'appid' => $appid]); //记录日志 } out(200, '修改成功', $app_res); } else { if (defined('USER_LOG') && USER_LOG == 1) { Db::table('log')->add(['uid' => $res_user['id'], 'type' => $act, 'status' => 201, 'time' => time(), 'ip' => getip(), 'appid' => $appid]); //记录日志 } out(201, '修改失败', $app_res); } ?>