<?php

/**
 * Class that operate on table 'productionorder'. Database Mysql.
 *
 * @author: http://phpdao.com
 * @date: 2014-04-07 17:42
 */
class ProductionorderMySqlExtDAO extends ProductionorderMySqlDAO {

    public function queryAllWithProductName($id) {

        $sql = 'SELECT productionorder. * , product.productName
				FROM productionorder
				INNER JOIN product ON product.productId = productionorder.productId
				AND productionorder.productionOrderid ="' . $id . '"';

        $sqlQuery = new SqlQuery($sql);
        //print_r($sqlQuery);
        return $this->getList($sqlQuery);
    }

    public function queryByOrderDateBettween($from, $to) {
        $sql = 'SELECT * FROM productionorder WHERE DATE( orderDate ) >= ? and DATE( orderDate ) <= ?';
        $sqlQuery = new SqlQuery($sql);
        $sqlQuery->set($from);
        $sqlQuery->set($to);
        return $this->getList($sqlQuery);
    }

}

?>