作者 开飞机的舒克

绑定学生之后更改用户昵称

@@ -56,13 +56,13 @@ class Bind extends Api @@ -56,13 +56,13 @@ class Bind extends Api
56 'user_id' => $user['id'], 56 'user_id' => $user['id'],
57 'updatetime' => time() 57 'updatetime' => time()
58 ]); 58 ]);
59 - if ($users['is_teach'] == 0){  
60 - $update['nickname'] = $res['name']."家长";  
61 - }  
62 $update = [ 59 $update = [
63 'bind_study' => 1, 60 'bind_study' => 1,
64 'updatetime' => time() 61 'updatetime' => time()
65 ]; 62 ];
  63 + if ($users['is_teach'] == 0){
  64 + $update['nickname'] = $res['name']."家长";
  65 + }
66 \db('user') 66 \db('user')
67 ->where('id', $user['id']) 67 ->where('id', $user['id'])
68 ->update($update); 68 ->update($update);
@@ -108,13 +108,13 @@ class Bind extends Api @@ -108,13 +108,13 @@ class Bind extends Api
108 'user_id' => $user['id'], 108 'user_id' => $user['id'],
109 'updatetime' => time() 109 'updatetime' => time()
110 ]); 110 ]);
111 - if ($users['is_teach'] == 0){  
112 - $update['nickname'] = $res['name']."家长";  
113 - }  
114 $update = [ 111 $update = [
115 'bind_study' => 1, 112 'bind_study' => 1,
116 'updatetime' => time() 113 'updatetime' => time()
117 ]; 114 ];
  115 + if ($users['is_teach'] == 0){
  116 + $update['nickname'] = $res['name']."家长";
  117 + }
118 \db('user') 118 \db('user')
119 ->where('id', $user['id']) 119 ->where('id', $user['id'])
120 ->update($update); 120 ->update($update);