info('用户删除开始'); try { $uid = $this->ask('请输入你想要删除的用户uid?'); $user = QappUser::getUserByUid($uid); if ($user) { $channel = QappPackage::where(['channel_id' => $user['channel_id']])->value("name"); if ($this->confirm("确定要删除" . $channel . "的uid为{$uid}的用户吗? [y|N]")) { $this->info("用户删除中........"); QappUser::where(['uid' => $user['uid']])->update(['device_no' => $user['androidid'].$user['uid'] ]); User::where(['id' => $user['uid']])->update(['openid' => $user['androidid'].$user['uid'],'unionid' => $user['androidid'].$user['uid']]); } else { $this->info("取消删除"); } } else { $this->info("UID为{$uid}的用户不存在"); } $this->info("操作完成"); } catch (\Exception $exception) { $this->error("uid 为{$uid}的用户删除你是失败"); } } }