<?php
class pinche_driverModel extends model{
	public $table="mod_pinche_driver";
	public function __construct(){
		parent::__construct();
	}
	
	public function getFree($lineid){
		$sql="
			select d.* from ".table("mod_pinche_driver_line")." as l
			left join ".table("mod_pinche_driver")." as d
			on l.driverid=d.driverid
			where l.lineid=".$lineid." AND l.status=1 
			order by l.freetime ASC
			limit 1
		";
		$res=$this->getRow($sql);
		return $res;
	} 
	
}