老天 发布的文章

位置:https://www.transifex.com/odoo/teams/

1 团队 正在翻译 6 项目
0 团队管理员 93 协调员 127 复核员 3,185 译员

正在翻译 6 个项目:
Odoo 10.0 39/39
Odoo 8.0 63/63
Odoo 9.0 76/76
Odoo 9.0 Documentation 5/5
Odoo.com 7/7
Odoo Master 6/6

汉语翻译团队成员参与人数之最

387 个成员 to Chinese (China)

团队成员:
10 个成员 to Afrikaans
14 个成员 to Albanian
4 个成员 to Amharic
265 个成员 to Arabic
3 个成员 to Armenian
16 个成员 to Basque
7 个成员 to Bengali
11 个成员 to Bosnian
29 个成员 to Bulgarian
10 个成员 to Burmese
38 个成员 to Catalan
387 个成员 to Chinese (China)
23 个成员 to Chinese (Hong Kong)
56 个成员 to Chinese (Taiwan)
33 个成员 to Croatian
24 个成员 to Czech
28 个成员 to Danish
60 个成员 to Dutch
28 个成员 to Dutch (Belgium)
21 个成员 to English (Australia)
113 个成员 to English (United Kingdom)
12 个成员 to Estonian
2 个成员 to Faroese
45 个成员 to Finnish
346 个成员 to French
34 个成员 to French (Belgium)
26 个成员 to French (Canada)
8 个成员 to French (Switzerland)
7 个成员 to Galician
9 个成员 to Georgian
155 个成员 to German
33 个成员 to Greek
13 个成员 to Gujarati
23 个成员 to Hebrew
42 个成员 to Hindi
20 个成员 to Hungarian
4 个成员 to Icelandic
83 个成员 to Indonesian
102 个成员 to Italian
51 个成员 to Japanese
6 个成员 to Kabyle
2 个成员 to Kazakh
6 个成员 to Khmer
28 个成员 to Korean
7 个成员 to Lao
6 个成员 to Latvian
2 个成员 to Lingala
28 个成员 to Lithuanian
9 个成员 to Macedonian
6 个成员 to Malayalam (India)
2 个成员 to Marathi
31 个成员 to Mongolian
15 个成员 to Norwegian Bokmål
68 个成员 to Persian
55 个成员 to Polish
74 个成员 to Portuguese
200 个成员 to Portuguese (Brazil)
31 个成员 to Romanian
230 个成员 to Russian
4 个成员 to Serbian
16 个成员 to Serbian (Latin)
10 个成员 to Slovak
15 个成员 to Slovenian
300 个成员 to Spanish
30 个成员 to Spanish (Argentina)
7 个成员 to Spanish (Bolivia)
17 个成员 to Spanish (Chile)
59 个成员 to Spanish (Colombia)
5 个成员 to Spanish (Costa Rica)
10 个成员 to Spanish (Dominican Republic)
23 个成员 to Spanish (Ecuador)
70 个成员 to Spanish (Mexico)
4 个成员 to Spanish (Panama)
5 个成员 to Spanish (Paraguay)
18 个成员 to Spanish (Peru)
3 个成员 to Spanish (Uruguay)
24 个成员 to Spanish (Venezuela)
45 个成员 to Swedish
16 个成员 to Tamil
8 个成员 to Telugu
33 个成员 to Thai
119 个成员 to Turkish
36 个成员 to Ukrainian
9 个成员 to Urdu
53 个成员 to Vietnamese

截图:
团队概览 - Google Chrome_006.png

目的:打开二级域名分别指向相应的odoo8.0中的数据库,如,打开odoo1.odoo123.com指向数据库odoo1,打开odoo2.odoo123.com指向数据库odoo2,打开odoo3.odoo123.com指向数据库odoo3。其中odoo1用于自己练习用odoo来做测试用,odoo2用于做自己的个人财务账,odoo3用于做网店账。

步骤:

一、修改etc\odoo\odoo-server.conf(或者可能是openerp-server.conf这个文件)中的

dbfilter = ^%d; 过滤要显示的数据库名称(推荐^%d默认.*通配)

二、在lnmp中增加三个vhost:sudo lnmp vhost add分别做三次,完成;

三、修改usr\local\nginx\conf\vhost\目录下的三个配置文件见附件;

四、到域名管理中增加三条A记录:odoo1.odoo123.com、odoo2.odoo123.com、odoo3.odoo123.com;本机测试可直接修改hosts文件(需要root权限)。

重启lnmp和odoo8.0。顺利实现!

The end.
odoo查询全部数据

odoo1.odoo123.com.conf

odoo2.odoo123.com.conf

odoo3.odoo123.com.conf

来自:https://github.com/leangjia/ez_SQL_help-zh_cn

附:
ez_sql_help_zh_cn.htm

DEMO.PHP 演示示例代码:

<?php

    /**********************************************************************
    *  ezSQL initialisation for mySQL
    */

    // Include ezSQL core
    include_once "../shared/ez_sql_core.php";

    // Include ezSQL database specific component
    include_once "ez_sql_mysql.php";

    // Initialise database object and establish a connection
    // at the same time - db_user / db_password / db_name / db_host
    $db = new ezSQL_mysql('db_user','db_password','db_name','db_host');

    /**********************************************************************
    *  ezSQL demo for mySQL database
    */

    // Demo of getting a single variable from the db
    // (and using abstracted function sysdate)
    $current_time = $db->get_var("SELECT " . $db->sysdate());
    print "ezSQL demo for mySQL database run @ $current_time";

    // Print out last query and results..
    $db->debug();

    // Get list of tables from current database..
    $my_tables = $db->get_results("SHOW TABLES",ARRAY_N);

    // Print out last query and results..
    $db->debug();

    // Loop through each row of results..
    foreach ( $my_tables as $table )
    {
        // Get results of DESC table..
        $db->get_results("DESC $table[0]");

        // Print out last query and results..
        $db->debug();
    }

?>

----------以下转载----------

操作MySQL,使用ezSQL,简单而方便

ezSQL官方下载地址:http://justinvincent.com/ezsql

使用示例:

事先 include once <ez_sql.php>;

include once <ez_sql.php>;

取数值:

$var = $db->get_var("SELECT count(*) FROM users");


取对象:

$user = $db->get_row("SELECT name,email FROM users WHERE id = 2");


取数组:

$users = $db->get_results("SELECT name, email FROM users");
foreach ( $users as $user )
{
    // 使用对象语法
    echo $user->name;
    echo $user->email;
}

可以看出,其实函数返回值为二维数组,经foreach分解后,$user为每条记录的内容,可直接用$user->字段名的方式访问。

get_results()还有另一种调用方式:

// Extract results into the array $dogs (and evaluate if there are any results at the same time)..
if ( $dogs = $db->get_results(“SELECT breed, owner, name FROM dogs”, ARRAY_A) )
{
            // Loop through the resulting array on the index $dogs[n]
            foreach ( $dogs as $dog_detail )
            {
 
                        // Loop through the resulting array
                        foreach ( $dogs_detail as $key => $val )
                        {
                                    // Access and format data using $key and $val pairs..
                                    echo “<b>” . ucfirst($key) . “</b>: $val<br>”;
                        }
 
                        // Do a P between dogs..
                        echo “<p>”;
            }
}
else
{
            // If no users were found then if evaluates to false..
            echo “No dogs found.”;
}
 

输出结果:

Output:
Breed: Boxer
Owner: Amy
Name: Tyson

Breed: Labrador
Owner: Lee
Name: Henry

Breed: Dachshund
Owner: Mary
Name: Jasmine


执行Insert操作:

$db->query("INSERT INTO users (id, name, email) VALUES (NULL,'duuge','duuge@duuge.com')");


调试信息

// Display last query and all associated results

$db->debug();

四种方法:

  1. bool $db->query(query)
  2. var $db->get_var(query)
  3. mixed $db->get_row(query)
  4. mixed $db->get_results(query)

ezSQL functions

$db->get_results -- get multiple row result set from the database (or previously cached results)

$db->get_row -- get one row from the database (or previously cached results)

$db->get_col -- get one column from query (or previously cached results) based on column offset

$db->get_var -- get one variable, from one row, from the database (or previously cached results)

$db->query -- send a query to the database (and if any results, cache them)

$db->debug -- print last sql query and returned results (if any)

$db->vardump -- print the contents and structure of any variable

$db->select -- select a new database to work with

$db->get_col_info -- get information about one or all columns such as column name or type

$db->hide_errors -- turn ezSQL error output to browser off

$db->show_errors -- turn ezSQL error output to browser on

$db->escape -- Format a string correctly to stop accidental mal formed queries under all PHP conditions

$db = new db -- Initiate new db object.


ezSQL variables

$db->num_rows – Number of rows that were returned (by the database) for the last query (if any)

$db->insert_id -- ID generated from the AUTO_INCRIMENT of the previous INSERT operation (if any)

$db->rows_affected -- Number of rows affected (in the database) by the last INSERT, UPDATE or DELETE (if any)

$db->num_queries -- Keeps track of exactly how many 'real' (not cached) queries were executed during the lifetime of the current script

$db->debug_all – If set to true (i.e. $db->debug_all = true;) Then it will print out ALL queries and ALL results of your script.

$db->cache_dir – Path to mySQL caching dir.

$db->cache_queries – Boolean flag (see mysql/disk_cache_example.php)

$db->cache_inserts – Boolean flag (see mysql/disk_cache_example.php)

$db->use_disk_cache – Boolean flag (see mysql/disk_cache_example.php)

$db->cache_timeout – Number in hours (see mysql/disk_cache_example.php)



EOF