Ejemplo n.º 1
0
def select_lable_list(page, size):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    return mysql.get_list(planner_sql.select_lable_list,
                          ((page - 1) * size, size))
Ejemplo n.º 2
0
def select_user_servicetype_list(userid, page, size):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    return mysql.get_list(planner_sql.select_user_servicetype_list,
                          (userid, (page - 1) * size, size))
Ejemplo n.º 3
0
def select_planner_education(userid, page=1, size=10):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    return mysql.get_list(planner_sql.select_planner_education,
                          (userid, (page - 1) * size, size))
Ejemplo n.º 4
0
def select_planner_lables(userid, page, size):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    return mysql.get_list(planner_sql.select_planner_lables,
                          (userid, (page - 1) * size, size))
Ejemplo n.º 5
0
def service_list():
    ApiResponse = api_response.ApiResponse()
    data = mysql.get_list(service_sql.select_service_list, ())
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 6
0
def select_planner_qualifications(userid, page=1, size=2):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 2
    return mysql.get_list(planner_sql.select_planner_qualifications,
                          (userid, userid, userid, (page - 1) * size, size))
Ejemplo n.º 7
0
def get_team_member_list(teamId, page=1, size=10):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    return mysql.get_list(team_sql.select_team_member_list,
                          (teamId, (page - 1) * size, size))
Ejemplo n.º 8
0
def select_planner_team_member_list(userid, page=1, size=10):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    return mysql.get_list(team_sql.select_planner_team_member_list,
                          (userid, (page - 1) * size, size))
Ejemplo n.º 9
0
def select_evaluate_info(orderId, page=1, size=10):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    return mysql.get_list(order_sql.select_evaluate_info,
                          (orderId, (page - 1) * size, size))
Ejemplo n.º 10
0
def select_planner_complete_order_list(userid, page=1, size=10):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    return mysql.get_list(order_sql.select_planner_complete_order_list,
                          (userid, (page - 1) * size, size))
Ejemplo n.º 11
0
def select_order_evaluate(orderId, page, size):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    return mysql.get_list(order_sql.select_order_evaluate,
                          (orderId, (page - 1) * size, size))
Ejemplo n.º 12
0
def upgrade_user():
    ApiResponse = api_response.ApiResponse()
    Sex = request.form.get("Sex", type=int, default=0)
    if Sex == 0:
        raise custom_error.CustomFlaskErr(status_code=500, message="性别不能为空")
    Name = request.form.get("Name", type=str, default=None)
    if Name == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="真实姓名不能为空")
    Address = request.form.get("Address", type=str, default=None)
    if Address == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="地址不能为空")
    ServiceId = request.form.get("ServiceId", type=str, default=None)
    if ServiceId == None or ServiceId == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="服务不能为空")
    ServiceAreaId = request.form.get("ServiceAreaId", type=str, default=None)
    if ServiceAreaId == None or ServiceAreaId == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="服务区域不能为空")
    Email = request.form.get("Email", type=str, default=None)
    if Email == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="邮箱不能为空")
    Experience = request.form.get("Experience", type=str, default=None)
    if Experience == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="资历不能为空")
    IDCard = request.form.get("IDCard", type=str, default=None)
    if IDCard == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="身份证不能为空")
    IDCardPic = request.form.get("IDCardPic", type=str, default=None)
    if IDCardPic == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="身份证正面不能为空")
    IDCardBackPic = request.form.get("IDCardBackPic", type=str, default=None)
    if IDCardBackPic == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="身份证反面不能为空")

    userId = request_helper.current_user_mush_login()["Id"]

    nicheng = request_helper.current_user_mush_login()["Name"]
    if nicheng is None:
        nicheng = Name

    data_exists = mysql.get_list(user_upgrade.select_exists_upgrade, (userId))

    if len(data_exists):
        raise custom_error.CustomFlaskErr(status_code=500,
                                          message="你已经存在申请过注册规划师")

    argData = [(userId, Sex, Name, Address, ServiceId, ServiceAreaId, Email,
                Experience, IDCardPic, userId, IDCardBackPic, IDCard),
               (nicheng, userId)]

    argSql = (user_upgrade.insert_upgrade_user,
              user_upgrade.update_user_info_name)

    data_register = mysql.operate__many(argSql, argData)

    if data_register > 0:
        ApiResponse.message = "申请成功"
        ApiResponse.status = 200
        return api_response.response_return(ApiResponse)
    raise custom_error.CustomFlaskErr(status_code=500, message="申请失败")
Ejemplo n.º 13
0
def select_lable_list(name, page=1, size=10):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    sear = "%" + name + "%"
    return mysql.get_list(lable_sql.select_lable_list,
                          (name, name, sear, (page - 1) * size, size))
Ejemplo n.º 14
0
def select_user_dynamic_list(userid,page,size):
    if userid == None or userid=="":
        raise custom_error.CustomFlaskErr(status_code=500, message="输入不正确,请刷新后重试")
    if page<=0:
        page=1
    if size<=0:
        size=10
    return mysql.get_list(dynamic_sql.select_user_dynamic_list,(userid,(page-1)*size,size))
Ejemplo n.º 15
0
def get_team_list(userid, name, page, size):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    sear = "%" + name + "%"
    return mysql.get_list(team_sql.select_team_list,
                          (userid, name, name, sear, (page - 1) * size, size))
Ejemplo n.º 16
0
def select_service_area_list(name, page=1, size=10):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    sear = "%" + name + "%"
    return mysql.get_list(service_area_sql.select_service_area_list,
                          (name, name, sear, (page - 1) * size, size))
Ejemplo n.º 17
0
def service():
    ApiResponse = api_response.ApiResponse()
    count = request.form.get("count", type=int, default=5)
    data = mysql.get_list(service_sql.select_top_service, (count))
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 18
0
def cooperation():
    ApiResponse = api_response.ApiResponse()
    size = request.form.get("size", type=int, default=10)
    page = request.form.get("page", type=int, default=1)
    data = mysql.get_list(platform_sql.select_platform_cooperation, ((page-1)*size,size))
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 19
0
def select_dynamic_list(content, page=1, size=10):
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    sear = "%" + content + "%"
    return mysql.get_list(dynamic_sql.select_dynamic_list,
                          (content, content, sear, sear,
                           (page - 1) * size, size))
Ejemplo n.º 20
0
def get_service_notice_list():
    userId = request_helper.current_user_mush_login()["Id"]
    UserType = request_helper.current_user_mush_login()["UserType"]

    ApiResponse = api_response.ApiResponse()
    size = request.form.get("size", type=int, default=10)
    page = request.form.get("page", type=int, default=1)
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    if UserType == 1:
        data = mysql.get_list(service_notice_sql.select_service_notice_list2, (userId, (page - 1) * size, size))
    else:
        data = mysql.get_list(service_notice_sql.select_service_notice_list1, (userId, (page - 1) * size, size))
    if len(data) > 0:
        for item in data:
            if item["OrderStatus"] == 1:
                item["OrderStatusStr"] = "通知后台"
                continue
            if item["OrderStatus"] == 2:
                item["OrderStatusStr"] = "客服回访"
                continue
            if item["OrderStatus"] == 3:
                item["OrderStatusStr"] = "拟定合同"
                continue
            if item["OrderStatus"] == 4:
                item["OrderStatusStr"] = "线下签约"
                continue
            if item["OrderStatus"] == 5:
                item["OrderStatusStr"] = "平台审查"
                continue
            if item["OrderStatus"] == 6:
                item["OrderStatusStr"] = "付款确认"
                continue
            if item["OrderStatus"] == 7:
                item["OrderStatusStr"] = "服务完成"
                continue

    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 21
0
def select_user_list(name,page=1,size=10):
    if page<=0:
        page=1
    if size<=0:
        size=10
    sear="%"+ name +"%"

    listCount = mysql.get_object(user_sql.select_user_list_count,(name,name,sear,sear))
    data= mysql.get_list(user_sql.select_user_list,(name,name,sear,sear,(page-1)*size,size))
    return data,listCount
Ejemplo n.º 22
0
def get_order_detail():
    ApiResponse = api_response.ApiResponse()
    OrderId = request.form.get("OrderId", type=str, default=None)
    if OrderId == None or OrderId == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="订单id不能为空")

    ApiResponse.data = mysql.get_object(order_sql.select_planner_order_detail,
                                        (OrderId))
    flowList = []
    if ApiResponse.data != None:
        order_flow_list = mysql.get_list(order_sql.get_order_status, (OrderId))
        if len(order_flow_list) > 0:
            for item in order_flow_list:
                if item["StartStatus"] == 6:
                    flowList.append({
                        "StatusStr": "服务完成",
                        "IsDo": "1",
                        "ChangeTime": item["ChangeTime"]
                    })
                    flowList.append({
                        "StatusStr": "付款确认",
                        "IsDo": "1",
                        "ChangeTime": item["ChangeTime"]
                    })
                if item["StartStatus"] == 5:
                    flowList.append({
                        "StatusStr": "平台审查",
                        "IsDo": "1",
                        "ChangeTime": item["ChangeTime"]
                    })
                if item["StartStatus"] == 4:
                    flowList.append({
                        "StatusStr": "线下签约",
                        "IsDo": "1",
                        "ChangeTime": item["ChangeTime"]
                    })
                if item["StartStatus"] == 3:
                    flowList.append({
                        "StatusStr": "拟定合同",
                        "IsDo": "1",
                        "ChangeTime": item["ChangeTime"]
                    })
                if item["StartStatus"] == 2:
                    flowList.append({
                        "StatusStr": "客服回访",
                        "IsDo": "1",
                        "ChangeTime": item["ChangeTime"]
                    })
        ApiResponse.data["OrderFlowing"] = flowList
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    return api_response.response_return(ApiResponse)
Ejemplo n.º 23
0
def get_system_notice_list():
    userId = request_helper.current_user_mush_login()["Id"]
    ApiResponse = api_response.ApiResponse()
    size = request.form.get("size", type=int, default=10)
    page = request.form.get("page", type=int, default=1)
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    data = mysql.get_list(system_notice_sql.select_system_notice_list, (userId, (page - 1) * size, size))
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 24
0
def update_base_config_by_id():
    ApiResponse = api_response.ApiResponse()
    Id = request.form.get("Id", type=int, default=0)
    if Id <= 0:
        raise custom_error.CustomFlaskErr(status_code=500, message="Id不能为空")
    Value = request.form.get("Value", type=str, default=None)
    Remark = request.form.get("Remark", type=str, default=None)
    imageUrl = request.form.get("imageUrl", type=str, default=None)

    ApiResponse.data = mysql.get_list(config_sql.update_config,
                                      (Value, Remark, imageUrl, Id))
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    return api_response.response_return(ApiResponse)
Ejemplo n.º 25
0
def searchds():
    ApiResponse = api_response.ApiResponse()
    size = request.form.get("size", type=int, default=10)
    page = request.form.get("page", type=int, default=1)
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    data = mysql.get_list(demand_service_sql.select_search_demand_service,
                          ((page - 1) * size, size))
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 26
0
def select_user_file():
    ApiResponse = api_response.ApiResponse()
    size = request.form.get("size", type=int, default=10)
    page = request.form.get("page", type=int, default=1)
    user = request_helper.current_user_mush_login()
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    data = mysql.get_list(user_info_sql.select_sys_file,
                          ((page - 1) * size, size))
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 27
0
def collection_list():
    ApiResponse = api_response.ApiResponse()
    size = request.form.get("size", type=int, default=10)
    page = request.form.get("page", type=int, default=1)
    user = request_helper.current_user_mush_login()
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    data = mysql.get_list(demand_service_sql.select_collection_demand_service,
                          (user["Id"], (page - 1) * size, size))
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 28
0
def plannerinfo():
    ApiResponse = api_response.ApiResponse()
    size = request.form.get("size", type=int, default=10)
    page = request.form.get("page", type=int, default=1)
    plannerId = request.form.get("plannerId", type=str, default=None)
    if plannerId == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="请选择规划师")
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    planner = planner_logic.select_planner_info(plannerId)
    teamlist = team_logic.select_planner_team_member_list(
        plannerId, page, size)
    qualifications = planner_logic.select_planner_qualifications(
        plannerId, 0, 2)
    complete_order_list = order_logic.select_planner_complete_order_list(
        plannerId, 0, 1)
    lables = planner_logic.select_planner_lables(plannerId, 0, 4)
    ServiceTypeList = planner_logic.select_user_servicetype_list(
        plannerId, 0, 9)
    ServiceAreaList = planner_logic.select_user_servicearea_list(
        plannerId, 0, 9)
    evaluate = planner_logic.select_planner_evaluate(plannerId, 0, 1)
    albumList = mysql.get_list(user_info_sql.select_user_album,
                               (plannerId, 0, 9))
    fllow_count = 0
    user = request_helper.current_user()
    if user != None and any(user) and user["Id"] != plannerId:
        obj = planner_logic.get_whether_follw(user["Id"], plannerId)
        fllow_count = obj["fllow_count"]
    data = {
        'planner': planner,
        "teamlist": teamlist,
        "qualifications": qualifications,
        "order": complete_order_list,
        "lables": lables,
        "evaluate": evaluate,
        "fllow_count": fllow_count,
        "albumList": albumList,
        "ServiceTypeList": ServiceTypeList,
        "ServiceAreaList": ServiceAreaList
    }
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 29
0
def register():
    ApiResponse = api_response.ApiResponse()
    Account = request.form.get("Account", type=str, default=None)
    Password = request.form.get("Password", type=str, default=None)
    VCode = request.form.get("VCode", type=str, default=None)
    if Account == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="账号不能为空")
    if Password == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="密码不能为空")
    if VCode == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="验证码不能为空")

    data_exists = mysql.get_list(user_sql.select_exists_user, (Account))
    if len(data_exists):
        raise custom_error.CustomFlaskErr(status_code=500, message="账号已经存在")

    vocde_exists = mysql.get_object(verification_code_sql.select_verification_lastcode, (Account, 1))
    if vocde_exists == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="验证码已失效")
    if vocde_exists["VCode"] != VCode:
        raise custom_error.CustomFlaskErr(status_code=500, message="验证码不正确")
    # 设置验证码已读
    mysql.operate_object(verification_code_sql.update_verificatioin_vcode, (vocde_exists["Id"]))

    guid = str(uuid.uuid1())
    sql_list = [user_sql.insert_user, user_sql.insert_userinfo]
    args_list = [(guid, Account, Password, Account), (guid)]

    data_register = mysql.operate__many(sql_list, args_list)
    if data_register > 0:
        # region 设置登陆信息,直接跳转到首页
        guid = str(uuid.uuid1())
        ip = request.remote_addr
        count = mysql.operate_object(user_sql.update_user_token, (guid, ip, Account, Password))
        user = mysql.get_object(user_sql.select_user_login_info, (guid))
        session["user"] = user
        data = {"token": guid, "datetime": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()), "user": user}

        ApiResponse.message = "注册成功"
        ApiResponse.status = 200
        ApiResponse.data = data
        return api_response.response_return(ApiResponse)
    # date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    raise custom_error.CustomFlaskErr(status_code=500, message="注册失败")
Ejemplo n.º 30
0
def select_demand_list():
    ApiResponse = api_response.ApiResponse()
    size = request.form.get("size", type=int, default=10)
    name = request.form.get("name", type=str, default="")
    page = request.form.get("page", type=int, default=1)
    type = request.form.get("type", type=int, default=1)
    if page <= 0:
        page = 1
    if size <= 0:
        size = 10
    data = mysql.get_list(demand_service_sql.select_demand_list, (type,(page - 1) * size, size))
    listCount = mysql.get_object(demand_service_sql.select_demand_count, (type))

    if listCount is not None:
        ApiResponse.data = data
        ApiResponse.listCount = listCount["count"]
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    return api_response.response_return(ApiResponse)