我正在使用Phalcon PHP框架。我是新来的。我尝试了以下方法来连接表并从这些表中选择列。但是,它只返回主表中的数据。
$jumpstarts = $this->modelsManager->createBuilder()
->columns("products.title, users_jumpstart.id, users_jumpstart.amount, invoices.user_id, invoices.product_id, invoices.created_at as billing_date, users.username")
->from(['users_jumpstart' => 'Models\Jumpstart'])
->leftJoin('Models\Invoices', "users_jumpstart.purchaseId=invoices.id", "invoices")
->leftJoin('Models\Users', "invoices.user_id=users.id", "users")
->leftJoin('Models\CoreProducts', "invoices.product_id=products.id", "products")
->where('users_jumpstart.userId=:user_id:', ['user_id' => 9])
->getQuery()
->execute();
它只返回users_jumpstart的列,即id和amount。 提前谢谢。