def user_query(user, table_dict): # 单个用户查询查询数量 try: sql = """SELECT COUNT(id), COUNT(call_result), SUM(hold_time) FROM call_detail WHERE call_result = 'connect' and user_detail_id = {0}; """.format(user[0]) import pdb; pdb.set_trace() print(sql) count_list = db.session.execute(sql) print(count_list) except Exception as e: current_app.logger.error(e) return jsonify(errno=RET.DBERR, errmsg="查询历史号码对象列表异常")
# user[0]是传过来的一个整数
ERROR:info:'int' object is not subscriptable # 查询老是报这句错误, 求大神指教