老大,经过测试,把框架的Medoo类库升级到最新版,按照我添加的Model操作类是可以操作多表查询的,其他写法可按照官方的文档可实现了 model //多表查询,第一个参数为表名,第二个是关联表名,第三个是查询字段(一定要字段名,*号不行),第四个为where条件
public function select_join($table,$join, $columns = null, $where = null){
return $this->pdo->select($table,$join,$columns,$where);
}
php操作写法 $data = S("")->select_join("host",
array(
"[>]admin" => array("uid" => "id"),
), array("host.domain","admin.username"
), array(
"ORDER" => "host.id DESC",
// "LIMIT" => 50
));
var_dump($data);
输出结果 Array
(
[0] => Array
(
[domain] => vsuw.cn
[username] => admin
)
[1] => Array
(
[domain] => www.vsuw.cn
[username] => admin1
)
)
|