{"action":"created","comment":{"url":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/comments/60506643","id":60506643,"diff_hunk":"@@ -30,17 +30,41 @@ public function validate($num,$key)\n     {\n         // 进行密码加密\n         $password = $this->getPasswordByStr($key);\n+        // 取当前时间戳\n+        $now = time();\n         // 查询匹配\n         $map['num'] = (int)$num;\n         $map['password'] = $password;\n         $map['is_use'] = 0;\n         $data = $this->where($map)->find();\n         // 判断\n-        if ($data == null) {\n+        if ($data === null && $data['deadline'] < $now) {\n+            $this->setError(\"Get Card lists error: \" . $this->getError());\n             return false;\n         }\n         else{\n             return true;\n         }\n     }\n+    /**\n+     * 添加学生id到卡密表\n+     * @param  string $num 卡号\n+     * @param  string $key 密码\n+     * @param  int $studentId 学生id\n+     * @return bool 添加成功返回ture\n+     */\n+    public function addStudentId($num, $key,$studentId)\n+    {\n+        // 判断卡密是否正确\n+        $data = $this->validate($num,$key);\n+        if ($data === false) {\n+            $this->setError(\"Get Card lists error: \" . $this->getError());\n+            return false;\n+        }\n+        // 添加数据\n+        $data['student_id'] = (int)$studentId;","path":"Application/Card/Logic/CardLogic.class.php","position":37,"original_position":37,"commit_id":"f3156af0e78fd2d0212e1a41216348dd35106fac","original_commit_id":"f3156af0e78fd2d0212e1a41216348dd35106fac","user":{"login":"mskies","id":12424383,"avatar_url":"https://avatars.githubusercontent.com/u/12424383?v=3","gravatar_id":"","url":"https://api.github.com/users/mskies","html_url":"https://github.com/mskies","followers_url":"https://api.github.com/users/mskies/followers","following_url":"https://api.github.com/users/mskies/following{/other_user}","gists_url":"https://api.github.com/users/mskies/gists{/gist_id}","starred_url":"https://api.github.com/users/mskies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mskies/subscriptions","organizations_url":"https://api.github.com/users/mskies/orgs","repos_url":"https://api.github.com/users/mskies/repos","events_url":"https://api.github.com/users/mskies/events{/privacy}","received_events_url":"https://api.github.com/users/mskies/received_events","type":"User","site_admin":false},"body":"$data的值有两个，一个是true（第46行代码）,另一个是false（第43行代码）.\r\n无乱哪种情况，$data['student_id']的值均为null.","created_at":"2016-04-20T23:45:20Z","updated_at":"2016-04-20T23:45:20Z","html_url":"https://github.com/yunzhiclub/english_online_study/pull/111#discussion_r60506643","pull_request_url":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/comments/60506643"},"html":{"href":"https://github.com/yunzhiclub/english_online_study/pull/111#discussion_r60506643"},"pull_request":{"href":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/111","id":67194230,"html_url":"https://github.com/yunzhiclub/english_online_study/pull/111","diff_url":"https://github.com/yunzhiclub/english_online_study/pull/111.diff","patch_url":"https://github.com/yunzhiclub/english_online_study/pull/111.patch","issue_url":"https://api.github.com/repos/yunzhiclub/english_online_study/issues/111","number":111,"state":"open","locked":false,"title":"Developmentlt","user":{"login":"litian1218","id":13295560,"avatar_url":"https://avatars.githubusercontent.com/u/13295560?v=3","gravatar_id":"","url":"https://api.github.com/users/litian1218","html_url":"https://github.com/litian1218","followers_url":"https://api.github.com/users/litian1218/followers","following_url":"https://api.github.com/users/litian1218/following{/other_user}","gists_url":"https://api.github.com/users/litian1218/gists{/gist_id}","starred_url":"https://api.github.com/users/litian1218/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/litian1218/subscriptions","organizations_url":"https://api.github.com/users/litian1218/orgs","repos_url":"https://api.github.com/users/litian1218/repos","events_url":"https://api.github.com/users/litian1218/events{/privacy}","received_events_url":"https://api.github.com/users/litian1218/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-04-20T14:15:11Z","updated_at":"2016-04-20T23:45:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0846ead18d40a2913dc8c4e5aac21f54bc76bb19","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/111/commits","review_comments_url":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/111/comments","review_comment_url":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yunzhiclub/english_online_study/issues/111/comments","statuses_url":"https://api.github.com/repos/yunzhiclub/english_online_study/statuses/f3156af0e78fd2d0212e1a41216348dd35106fac","head":{"label":"yunzhiclub:developmentlt","ref":"developmentlt","sha":"f3156af0e78fd2d0212e1a41216348dd35106fac","user":{"login":"yunzhiclub","id":15880432,"avatar_url":"https://avatars.githubusercontent.com/u/15880432?v=3","gravatar_id":"","url":"https://api.github.com/users/yunzhiclub","html_url":"https://github.com/yunzhiclub","followers_url":"https://api.github.com/users/yunzhiclub/followers","following_url":"https://api.github.com/users/yunzhiclub/following{/other_user}","gists_url":"https://api.github.com/users/yunzhiclub/gists{/gist_id}","starred_url":"https://api.github.com/users/yunzhiclub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yunzhiclub/subscriptions","organizations_url":"https://api.github.com/users/yunzhiclub/orgs","repos_url":"https://api.github.com/users/yunzhiclub/repos","events_url":"https://api.github.com/users/yunzhiclub/events{/privacy}","received_events_url":"https://api.github.com/users/yunzhiclub/received_events","type":"Organization","site_admin":false},"repo":{"id":52929473,"name":"english_online_study","full_name":"yunzhiclub/english_online_study","owner":{"login":"yunzhiclub","id":15880432,"avatar_url":"https://avatars.githubusercontent.com/u/15880432?v=3","gravatar_id":"","url":"https://api.github.com/users/yunzhiclub","html_url":"https://github.com/yunzhiclub","followers_url":"https://api.github.com/users/yunzhiclub/followers","following_url":"https://api.github.com/users/yunzhiclub/following{/other_user}","gists_url":"https://api.github.com/users/yunzhiclub/gists{/gist_id}","starred_url":"https://api.github.com/users/yunzhiclub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yunzhiclub/subscriptions","organizations_url":"https://api.github.com/users/yunzhiclub/orgs","repos_url":"https://api.github.com/users/yunzhiclub/repos","events_url":"https://api.github.com/users/yunzhiclub/events{/privacy}","received_events_url":"https://api.github.com/users/yunzhiclub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yunzhiclub/english_online_study","description":"英语在线学习系统","fork":false,"url":"https://api.github.com/repos/yunzhiclub/english_online_study","forks_url":"https://api.github.com/repos/yunzhiclub/english_online_study/forks","keys_url":"https://api.github.com/repos/yunzhiclub/english_online_study/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yunzhiclub/english_online_study/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yunzhiclub/english_online_study/teams","hooks_url":"https://api.github.com/repos/yunzhiclub/english_online_study/hooks","issue_events_url":"https://api.github.com/repos/yunzhiclub/english_online_study/issues/events{/number}","events_url":"https://api.github.com/repos/yunzhiclub/english_online_study/events","assignees_url":"https://api.github.com/repos/yunzhiclub/english_online_study/assignees{/user}","branches_url":"https://api.github.com/repos/yunzhiclub/english_online_study/branches{/branch}","tags_url":"https://api.github.com/repos/yunzhiclub/english_online_study/tags","blobs_url":"https://api.github.com/repos/yunzhiclub/english_online_study/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yunzhiclub/english_online_study/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yunzhiclub/english_online_study/git/refs{/sha}","trees_url":"https://api.github.com/repos/yunzhiclub/english_online_study/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yunzhiclub/english_online_study/statuses/{sha}","languages_url":"https://api.github.com/repos/yunzhiclub/english_online_study/languages","stargazers_url":"https://api.github.com/repos/yunzhiclub/english_online_study/stargazers","contributors_url":"https://api.github.com/repos/yunzhiclub/english_online_study/contributors","subscribers_url":"https://api.github.com/repos/yunzhiclub/english_online_study/subscribers","subscription_url":"https://api.github.com/repos/yunzhiclub/english_online_study/subscription","commits_url":"https://api.github.com/repos/yunzhiclub/english_online_study/commits{/sha}","git_commits_url":"https://api.github.com/repos/yunzhiclub/english_online_study/git/commits{/sha}","comments_url":"https://api.github.com/repos/yunzhiclub/english_online_study/comments{/number}","issue_comment_url":"https://api.github.com/repos/yunzhiclub/english_online_study/issues/comments{/number}","contents_url":"https://api.github.com/repos/yunzhiclub/english_online_study/contents/{+path}","compare_url":"https://api.github.com/repos/yunzhiclub/english_online_study/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yunzhiclub/english_online_study/merges","archive_url":"https://api.github.com/repos/yunzhiclub/english_online_study/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yunzhiclub/english_online_study/downloads","issues_url":"https://api.github.com/repos/yunzhiclub/english_online_study/issues{/number}","pulls_url":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls{/number}","milestones_url":"https://api.github.com/repos/yunzhiclub/english_online_study/milestones{/number}","notifications_url":"https://api.github.com/repos/yunzhiclub/english_online_study/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yunzhiclub/english_online_study/labels{/name}","releases_url":"https://api.github.com/repos/yunzhiclub/english_online_study/releases{/id}","deployments_url":"https://api.github.com/repos/yunzhiclub/english_online_study/deployments","created_at":"2016-03-02T03:12:01Z","updated_at":"2016-04-20T07:28:07Z","pushed_at":"2016-04-20T15:13:31Z","git_url":"git://github.com/yunzhiclub/english_online_study.git","ssh_url":"git@github.com:yunzhiclub/english_online_study.git","clone_url":"https://github.com/yunzhiclub/english_online_study.git","svn_url":"https://github.com/yunzhiclub/english_online_study","homepage":null,"size":40912,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"yunzhiclub:development","ref":"development","sha":"1ca3b5686913f0cde14954a57d3950210892ab19","user":{"login":"yunzhiclub","id":15880432,"avatar_url":"https://avatars.githubusercontent.com/u/15880432?v=3","gravatar_id":"","url":"https://api.github.com/users/yunzhiclub","html_url":"https://github.com/yunzhiclub","followers_url":"https://api.github.com/users/yunzhiclub/followers","following_url":"https://api.github.com/users/yunzhiclub/following{/other_user}","gists_url":"https://api.github.com/users/yunzhiclub/gists{/gist_id}","starred_url":"https://api.github.com/users/yunzhiclub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yunzhiclub/subscriptions","organizations_url":"https://api.github.com/users/yunzhiclub/orgs","repos_url":"https://api.github.com/users/yunzhiclub/repos","events_url":"https://api.github.com/users/yunzhiclub/events{/privacy}","received_events_url":"https://api.github.com/users/yunzhiclub/received_events","type":"Organization","site_admin":false},"repo":{"id":52929473,"name":"english_online_study","full_name":"yunzhiclub/english_online_study","owner":{"login":"yunzhiclub","id":15880432,"avatar_url":"https://avatars.githubusercontent.com/u/15880432?v=3","gravatar_id":"","url":"https://api.github.com/users/yunzhiclub","html_url":"https://github.com/yunzhiclub","followers_url":"https://api.github.com/users/yunzhiclub/followers","following_url":"https://api.github.com/users/yunzhiclub/following{/other_user}","gists_url":"https://api.github.com/users/yunzhiclub/gists{/gist_id}","starred_url":"https://api.github.com/users/yunzhiclub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yunzhiclub/subscriptions","organizations_url":"https://api.github.com/users/yunzhiclub/orgs","repos_url":"https://api.github.com/users/yunzhiclub/repos","events_url":"https://api.github.com/users/yunzhiclub/events{/privacy}","received_events_url":"https://api.github.com/users/yunzhiclub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yunzhiclub/english_online_study","description":"英语在线学习系统","fork":false,"url":"https://api.github.com/repos/yunzhiclub/english_online_study","forks_url":"https://api.github.com/repos/yunzhiclub/english_online_study/forks","keys_url":"https://api.github.com/repos/yunzhiclub/english_online_study/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yunzhiclub/english_online_study/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yunzhiclub/english_online_study/teams","hooks_url":"https://api.github.com/repos/yunzhiclub/english_online_study/hooks","issue_events_url":"https://api.github.com/repos/yunzhiclub/english_online_study/issues/events{/number}","events_url":"https://api.github.com/repos/yunzhiclub/english_online_study/events","assignees_url":"https://api.github.com/repos/yunzhiclub/english_online_study/assignees{/user}","branches_url":"https://api.github.com/repos/yunzhiclub/english_online_study/branches{/branch}","tags_url":"https://api.github.com/repos/yunzhiclub/english_online_study/tags","blobs_url":"https://api.github.com/repos/yunzhiclub/english_online_study/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yunzhiclub/english_online_study/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yunzhiclub/english_online_study/git/refs{/sha}","trees_url":"https://api.github.com/repos/yunzhiclub/english_online_study/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yunzhiclub/english_online_study/statuses/{sha}","languages_url":"https://api.github.com/repos/yunzhiclub/english_online_study/languages","stargazers_url":"https://api.github.com/repos/yunzhiclub/english_online_study/stargazers","contributors_url":"https://api.github.com/repos/yunzhiclub/english_online_study/contributors","subscribers_url":"https://api.github.com/repos/yunzhiclub/english_online_study/subscribers","subscription_url":"https://api.github.com/repos/yunzhiclub/english_online_study/subscription","commits_url":"https://api.github.com/repos/yunzhiclub/english_online_study/commits{/sha}","git_commits_url":"https://api.github.com/repos/yunzhiclub/english_online_study/git/commits{/sha}","comments_url":"https://api.github.com/repos/yunzhiclub/english_online_study/comments{/number}","issue_comment_url":"https://api.github.com/repos/yunzhiclub/english_online_study/issues/comments{/number}","contents_url":"https://api.github.com/repos/yunzhiclub/english_online_study/contents/{+path}","compare_url":"https://api.github.com/repos/yunzhiclub/english_online_study/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yunzhiclub/english_online_study/merges","archive_url":"https://api.github.com/repos/yunzhiclub/english_online_study/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yunzhiclub/english_online_study/downloads","issues_url":"https://api.github.com/repos/yunzhiclub/english_online_study/issues{/number}","pulls_url":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls{/number}","milestones_url":"https://api.github.com/repos/yunzhiclub/english_online_study/milestones{/number}","notifications_url":"https://api.github.com/repos/yunzhiclub/english_online_study/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yunzhiclub/english_online_study/labels{/name}","releases_url":"https://api.github.com/repos/yunzhiclub/english_online_study/releases{/id}","deployments_url":"https://api.github.com/repos/yunzhiclub/english_online_study/deployments","created_at":"2016-03-02T03:12:01Z","updated_at":"2016-04-20T07:28:07Z","pushed_at":"2016-04-20T15:13:31Z","git_url":"git://github.com/yunzhiclub/english_online_study.git","ssh_url":"git@github.com:yunzhiclub/english_online_study.git","clone_url":"https://github.com/yunzhiclub/english_online_study.git","svn_url":"https://github.com/yunzhiclub/english_online_study","homepage":null,"size":40912,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/111"},"html":{"href":"https://github.com/yunzhiclub/english_online_study/pull/111"},"issue":{"href":"https://api.github.com/repos/yunzhiclub/english_online_study/issues/111"},"comments":{"href":"https://api.github.com/repos/yunzhiclub/english_online_study/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yunzhiclub/english_online_study/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/yunzhiclub/english_online_study/statuses/f3156af0e78fd2d0212e1a41216348dd35106fac"}}}}