正在显示
1 个修改的文件
包含
6 行增加
和
3 行删除
@@ -48,6 +48,9 @@ class Bind extends Api | @@ -48,6 +48,9 @@ class Bind extends Api | ||
48 | // if ($users['bind_study'] == 1) { | 48 | // if ($users['bind_study'] == 1) { |
49 | // $this->error('您当前已经绑定过学生了,请勿重复操作'); | 49 | // $this->error('您当前已经绑定过学生了,请勿重复操作'); |
50 | // } | 50 | // } |
51 | + if (empty($res)){ | ||
52 | + $this->error('当前学生不存在'); | ||
53 | + } | ||
51 | Db::startTrans(); | 54 | Db::startTrans(); |
52 | try { | 55 | try { |
53 | db('study') | 56 | db('study') |
@@ -96,10 +99,10 @@ class Bind extends Api | @@ -96,10 +99,10 @@ class Bind extends Api | ||
96 | if (!empty($res['user_id'])){ | 99 | if (!empty($res['user_id'])){ |
97 | $this->error('当前学生已经被绑定了'); | 100 | $this->error('当前学生已经被绑定了'); |
98 | } | 101 | } |
102 | + if (empty($res)){ | ||
103 | + $this->error('当前学生不存在'); | ||
104 | + } | ||
99 | $users = db('user')->where('id', $user['id'])->find(); | 105 | $users = db('user')->where('id', $user['id'])->find(); |
100 | -// if ($users['bind_study'] == 1) { | ||
101 | -// $this->error('您当前已经绑定过学生了,请勿重复操作'); | ||
102 | -// } | ||
103 | Db::startTrans(); | 106 | Db::startTrans(); |
104 | try { | 107 | try { |
105 | db('study') | 108 | db('study') |
-
请 注册 或 登录 后发表评论