作者 开飞机的舒克

优化解除绑定接口

... ... @@ -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());
... ...
... ... @@ -5754,7 +5754,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-03-28 15:06:11 <a href="./" target="_blank">校园活动</a>
Generated on 2023-03-28 15:47:18 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...