本文整理汇总了PHP中AbstractModel::getOnComplexQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractModel::getOnComplexQuery方法的具体用法?PHP AbstractModel::getOnComplexQuery怎么用?PHP AbstractModel::getOnComplexQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractModel
的用法示例。
在下文中一共展示了AbstractModel::getOnComplexQuery方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllBidbyId
public static function getAllBidbyId($id)
{
$select = new SelectPDO();
$select->from("bid", ["bid.*", "lot.title", "user.first_name", "user.last_Name"])->where("`bid`.`lot_id` = ?", array($id))->join("lot", "lot_id", "id")->join("user", "user_id", "id");
$data = AbstractModel::getOnComplexQuery($select);
return $data;
}
示例2: actionMyLots
/**
* this function shows us our all lots
*
*/
public function actionMyLots()
{
if ($this->request->order == "") {
$products = MyProduct::getMyProduct($this->user->id);
if (!$products) {
$products = [];
}
$countLots = $this->user->getQuantityLots();
$countBids = $this->user->getQuantityBids();
if ($countLots == "") {
$countLots = 0;
}
if ($countBids == "") {
$countBids = 0;
}
$this->view->lots = $countLots;
$this->view->countBids = $countBids;
$this->view->user = $this->name;
$this->view->products = $products;
$this->view->render('mylots');
$this->view->display();
} else {
$id = (int) $_POST["order"];
$fields = ["title", "description", "current_price", "id", "front_img", "created"];
$where = "user_id = ? ";
$user_id = $this->user->id;
$select = new SelectPDO();
$select->from("lot", $fields)->where($where, array($user_id));
switch ($id) {
case '0':
$select->order("current_price", false);
break;
case '1':
$select->order("current_price", true);
break;
case '2':
$select->order("created");
break;
default:
$select->order("title");
break;
}
$data = AbstractModel::getOnComplexQuery($select);
$data = json_encode($data);
echo $data;
exit;
$products = MyProduct::getMyProduct($this->user->id);
echo json_encode($products);
}
}