Commit b66ce164 by Jansa Jose

dc

parent 0df082c3
......@@ -1380,15 +1380,18 @@ class Webservice_model extends CI_Model {
if(!isset($postData['vehBrand_id']) && empty($postData['vehBrand_id'])){
$respArr['message'] = 'Vehicle Brand Id is Required' ;
}
if(!isset($postData['vehiYear']) && empty($postData['vehiYear'])){
$respArr['message'] = 'Vehicle Year is Required' ;
// if(!isset($postData['vehiYear']) && empty($postData['vehiYear'])){
// $respArr['message'] = 'Vehicle Year is Required' ;
// }
$cond = array('VEH.veh_brand_id'=>$postData['vehBrand_id'],'VEH.status'=>'1');
if(isset($postData['vehiYear']) && !empty($postData['vehiYear'])){
$cond['VEH.year'] = $postData['vehiYear'];
}
$year = (isset($postData['vehiYear']) && !empty($postData['vehiYear']))?$postData['vehiYear']:'';
$this->db->select("DISTINCT(VEHM.model_name) as model,VEHM.veh_model_id,VEH.engine,VEH.trim");
$this->db->join('vehicle_models AS VEHM','VEHM.veh_model_id = VEH.model_id');
$this->db->order_by('model');
$result = $this->db->get_where('vehicles AS VEH',
array('VEH.veh_brand_id'=>$postData['vehBrand_id'],'VEH.status'=>'1','VEH.year'=>$year));
$result = $this->db->get_where('vehicles AS VEH',$cond);
if(empty($result) || empty($result = $result->result())){
$respArr['status'] = "error";
return $respArr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment