<?php

/**
 * Class that operate on table 'onlinetemporderproduct'. Database Mysql.
 *
 * @author: http://phpdao.com
 * @date: 2019-11-13 10:55
 */
class OnlinetemporderproductMySqlExtDAO extends OnlinetemporderproductMySqlDAO {

    public function queryByOrderidAndProductid($orderid, $productid) {
        $sql = 'SELECT * FROM onlinetemporderproduct WHERE orderid = ? and productid = ?';
        $sqlQuery = new SqlQuery($sql);
        $sqlQuery->setNumber($orderid);
        $sqlQuery->setNumber($productid);
        return $this->getRow($sqlQuery);
    }

    public function queryByOrderidEX($orderid) {
        $sql = 'SELECT onlinetemporderproduct.*,product.productName,productcat.productCatName
                FROM onlinetemporderproduct
                join product on product.productId = onlinetemporderproduct.productid
                left join productcat on productcat.productCatId = product.productCatId
                WHERE orderid = ' . $orderid . ' ';
        $sqlQuery = new SqlQuery($sql);
        return $this->getList($sqlQuery);
    }

}

?>