Exemplo n.º 1
0
def notice_add(params):
    create_time = date_time()
    info_data = {
        '_id': get_uuid(),
        'title': params['title'],
        'contents': params['contents'],
        'type': params['type'],
        'create_time': create_time
    }
    info_id = collection['Notice'].insert_one(info_data).inserted_id
    if info_id:
        return True
    else:
        return False
Exemplo n.º 2
0
def partner_add(params):
    create_time = date_time()
    info_data = {
        '_id': get_uuid(),
        'name': params['name'],
        'logo': params['logo'],
        'url': params['url'],
        'type': params['type'],
        'create_time': create_time
    }
    info_id = collection['PartnerInfo'].insert_one(info_data).inserted_id
    if info_id:
        return True
    else:
        return False
Exemplo n.º 3
0
def person_info_company(password, mobile, username):
    """
    注册企业信息表
    :param password: type(string) 密码
    :param mobile:  type(string) 手机号
    :param username:  type(string) 手机号
    :return: _id
    """
    nickname = mobile + "_g"
    create_time = date_time()
    company_id = get_uuid()
    company_info = {
        "_id": company_id,
        "create_time": create_time,
        "host": username,
        "name": "",
        "logo": "",
        "province": "",
        "company_type": "",
        "company_address": "",
        "address": "",
        "tele_person": "",
        "telephone": "",
        "fix_phone": "",
        "website": "",
        "description": "",
        "page_urls": [],
        "product": [],
        "fax": "1356343",
        "organization_code": "",
        "certificate": "",
        "production_license": "",
        "checkout": ""
    }
    collection['CompanyInfo'].insert_one(company_info)
    user_id = get_uuid()
    info_data = {
        '_id': user_id,
        'nickname': nickname,
        'username': username,
        'mobile': mobile,
        'password': password,
        'head_pic': "",
        'create_time': create_time,
        'company': company_id
    }
    collection['UserInfo'].insert_one(info_data)
    return user_id
Exemplo n.º 4
0
def person_info_register(password, mobile):
    """
    注册个人信息表
    :param password: type(string) 密码
    :param mobile:  type(string) 手机号
    :return: _id
    """
    nickname = mobile + "_g"
    create_time = date_time()
    info_data = {
        'nickname': nickname,
        'username': nickname,
        'mobile': mobile,
        'password': password,
        'head_pic': "",
        'create_time': create_time
    }
    info_id = collection['UserInfo'].insert_one(info_data).inserted_id
    return info_id
Exemplo n.º 5
0
def news_add(params):
    create_time = date_time()
    info_data = {
        '_id': get_uuid(),
        'title': params['title'],
        'subtitle': params['subtitle'],
        'abstract': params['abstract'],
        'contents': params['contents'],
        'pictures': params['pictures'],
        'type': params['type'],
        'area': params['area'],
        'source': params['source'],
        'province': params['province'],
        'city': params['city'],
        'create_time': create_time
    }
    info_id = collection['MediaNews'].insert_one(info_data).inserted_id
    if info_id:
        return True
    else:
        return False
Exemplo n.º 6
0
def production_base_add(params):
    create_time = date_time()
    info_data = {
        '_id': get_uuid(),
        'name': params['name'],
        'product': params['product'],
        'province': params['province'],
        'content': params['content'],
        'people': params['people'],
        'certificate': params['certificate'],
        'pic': params['pic'],
        'type': params['type'],
        'city': params['city'],
        'address': params['address'],
        'telephone': params['telephone'],
        'companys': params['companys'],
        'brand': params['brand'],
        'create_time': create_time
    }
    info_id = collection['ProductionBase'].insert_one(info_data).inserted_id
    if info_id:
        return True
    else:
        return False