单条查询,
$order = \OrderMain::findFirst("oid='" . $oid . "'");
多条查询,
$shop = \OrderShop::find(array( 'conditions'=>"oid=:oid:", 'bind'=>array('oid'=>$oid) ))
多表查询
$builder = $this->modelsManager->createBuilder() ->columns("s.sid,s.oid,s.uuid,s.shop_id,s.shop_type_name,s.shop_name,s.shop_attr,s.shop_num,s.shop_price,s.post_true, s.post_type,s.post_number,s.post_time,s.receive_true,s.create_time,m.order_status") ->addfrom("OrderMain",'m') ->leftjoin("OrderShop",'m.oid=s.oid','s'); $builder->andWhere("m.delete_flg=0")->orderBy("m.create_time desc");