admin 管理员组

文章数量: 1184232


2024年1月11日发(作者:ueditor粘贴图片上传)

注册登录流程:实现代码(后端响应):

@('/data',methods=['GET'])def data(): limit = int(['limit']) page = int(['page']) page = (page-1)*limit conn = t(host='localhost', user='root', password='123456', port=3366, db='lagou',charset='utf8mb4') cursor = () if (len() == 2): e("select count(*) from demo") count = ll() cursor = (cursor=rsor) e("select * from demo limit "+str(page)+","+str(limit)) data_dict = [] result = ll() for field in result: data_(field) else: education = str(['education']) positionName = str(['positionName']).lower() if(education=='不限'): e("select count(*) from demo where positionName like '%"+positionName+"%'") count = ll() cursor = (cursor=rsor) e("select * from demo where positionName like '%"+positionName+"%' limit " + str(page) + "," + str(limit)) data_dict = [] result = ll() for field in result: data_(field) else: e("select count(*) from demo where positionName like '%"+positionName+"%' and education = '"+education+"'") count = ll() cursor = (cursor=rsor) e("select * from demo where positionName like '%"+positionName+"%' and education = '"+education+"' limit " + str(page) + "," + str(limit)) data_dict = [] result = ll() for field in result: data_(field) table_result = {"code": 0, "msg": None, "count": count[0], "data": data_dict} () () return jsonify(table_result)

st[9], temp_list[10], temp_list[11]]) temp_list = [] for i in positionName: e( "SELECT COUNT(*) FROM demo WHERE SUBSTR(salary,1,2) > 40 and positionName like '%" + i + "%';") count = ll() temp_list += count[0] zzt_(['40以上', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5], temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) else: education = str(['education']) temp_list = [] for i in positionName: e( "SELECT COUNT(*) FROM demo WHERE SUBSTR(salary,1,2) like '%K%' and positionName like '%" + i + "%' and education = '"+education+"'") count = ll() temp_list += count[0] zzt_(['0—10K', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5], temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) temp_list = [] for i in positionName: e( "SELECT COUNT(*) FROM demo WHERE SUBSTR(salary,1,2) BETWEEN 10 AND 20 and positionName like '%" + i + "%' and education = '"+education+"'") count = ll() temp_list += count[0] zzt_(['10—20K', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5], temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) temp_list = [] for i in positionName: e( "SELECT COUNT(*) FROM demo WHERE SUBSTR(salary,1,2) BETWEEN 20 AND 30 and positionName like '%" + i + "%' and education = '"+education+"'") count = ll() temp_list += count[0] zzt_(['20—30K', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5], temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) temp_list = [] for i in positionName: e( "SELECT COUNT(*) FROM demo WHERE SUBSTR(salary,1,2) BETWEEN 30 AND 40 and positionName like '%" + i + "%' and education = '"+education+"'") count = ll() temp_list += count[0] zzt_(['30—40K', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5], temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) temp_list = [] for i in positionName: e( "SELECT COUNT(*) FROM demo WHERE SUBSTR(salary,1,2) > 40 and positionName like '%" + i + "%' and education = '"+education+"'") count = ll() temp_list += count[0] zzt_(['40以上', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5], temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) result = {"zzt": zzt_list} () return jsonify(result)

zzt_(['0—10K', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5],temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) # 10-20k temp_list = [] e("SELECT COUNT(*) FROM demo WHERE SUBSTR(salary,1,2) BETWEEN 10 AND 20 and positionName like '%" + positionName + "%' and city = '北京';") count = ll() for i in count[0].keys(): value = count[0][i] for num in range(len(positionName_sample)): if positionName == positionName_sample[num]: temp_(value) else: temp_(0) # temp_(value) zzt_(['10—20K', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5],temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) # 20-30k temp_list = [] e("SELECT COUNT(*) FROM demo WHERE SUBSTR(salary,1,2) BETWEEN 20 AND 30 and positionName like '%" + positionName + "%' and city = '北京';") count = ll() for i in count[0].keys(): value = count[0][i] for num in range(len(positionName_sample)): if positionName == positionName_sample[num]: temp_(value) else: temp_(0) #temp_(value) zzt_(['20—30K', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5],temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) # 30-40k temp_list = [] e("SELECT COUNT(*) FROM demo WHERE SUBSTR(salary,1,2) BETWEEN 30 AND 40 and positionName like '%" + positionName + "%' and city = '北京';") count = ll() for i in count[0].keys(): value = count[0][i] for num in range(len(positionName_sample)): if positionName == positionName_sample[num]: temp_(value) else: temp_(0) #temp_(value) zzt_(['30—40K', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5],temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) # >40k temp_list = [] e("SELECT COUNT(*) FROM demo WHERE SUBSTR(salary,1,2) > 40 and positionName like '%" + positionName + "%' and city = '北京';") count = ll() for i in count[0].keys(): value = count[0][i] for num in range(len(positionName_sample)): if positionName == positionName_sample[num]: temp_(value) else: temp_(0) #temp_(value) zzt_(['>40K', temp_list[0], temp_list[1], temp_list[2], temp_list[3], temp_list[4], temp_list[5],temp_list[6], temp_list[7], temp_list[8], temp_list[9], temp_list[10], temp_list[11]]) print(zzt_list) result = {"district": district, "district_result": district_result, "companySize": companySize, "companySizeResult": companySizeResult, "education": education, "educationResult": educationResult, "workYear_data":workYear_data, "firstType": firstType, "firstType_data": firstType_data, "leida_max_dict":leida_max

@('/price',methods=['GET'])def price(): conn = t(host='localhost', user='root', password='123456', port=3366, db='lagou', charset='utf8mb4') cursor = () price_kind = ['<=1000', '1001~2000', '2001~3000', '3001~4000', '4001~5000', '5001~6000', '6001~7000', '7001~8000', '8001~9000', '9001~10000', '>10000'] price_data = [] #

获取到每种价格类别对应的个数 # <=1000 e("SELECT count(*) from house where price between 0 and 1000;") count = ll() price_(count[0][0]) # 1001~2000 e("SELECT count(*) from house where price between 1001 and 2000;") count = ll() price_(count[0][0]) # 2001~3000 e("SELECT count(*) from house where price between 2001 and 3000;") count = ll() price_(count[0][0]) # 3001~4000 e("SELECT count(*) from house where price between 3001 and 4000;") count = ll() price_(count[0][0]) # 4001~5000 e("SELECT count(*) from house where price between 4001 and 5000;") count = ll() price_(count[0][0]) # 5001~6000 e("SELECT count(*) from house where price between 5001 and 6000;") count = ll() price_(count[0][0]) # 6001~7000 e("SELECT count(*) from house where price between 6001 and 7000;") count = ll() price_(count[0][0]) # 7001~8000 e("SELECT count(*) from house where price between 7001 and 8000;") count = ll() price_(count[0][0]) # 8001~9000 e("SELECT count(*) from house where price between 8001 and 9000;") count = ll() price_(count[0][0]) # 9001~10000 e("SELECT count(*) from house where price between 9001 and 10000;") count = ll() price_(count[0][0]) # >10000 e("SELECT count(*) from house where price >10000;") count = ll() price_(count[0][0]) () print(price_data) return jsonify({"price_kind": price_kind, "price_data": price_data})


本文标签: 代码 类别 价格 粘贴