...
|
...
|
@@ -264,13 +264,13 @@ class User extends Api |
|
|
public function closeBind(){
|
|
|
$user = $this->auth->getUserinfo();
|
|
|
$list = \db('user')->where('id',$user['id'])->field('is_teach,bind_study')->find();
|
|
|
if ($list['bind_study'] == 0){
|
|
|
if ($list['bind_study'] === 0){
|
|
|
$this->error('您当前还未绑定学生');
|
|
|
}
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
\db('user')->where('id', $user['id'])->update(['bind_study' => 0]);
|
|
|
\db('study')->where('id',$user['id'])->update(['user_id'=>null]);
|
|
|
\db('study')->where('user_id',$user['id'])->update(['user_id'=>null]);
|
|
|
Db::commit();
|
|
|
} catch (Exception $e) {
|
|
|
$this->error('连接错误',$e->getMessage());
|
...
|
...
|
|