/** * Lọc tin khách tìm xe theo loại xe */ public function actionLoc_theo_xe() { $maLoaiXe = Yii::app()->request->getParam('id'); //Nếu không tồn tại mã loại xe thì sẽ redirect về trang chủ if (!$maLoaiXe) { $this->redirect(Yii::app()->homeUrl); } $matins = Tinghepxe::listMaTin(Tinghepxe::CODE_KTX, ' AND ma_loai_xe_ghep= ' . $maLoaiXe); $ma = '('; foreach ($matins as $matin) { $ma .= $matin['ma_tin'] . ','; } $ma .= '0)'; $condition = " AND tinkhachhang.ma_tin IN {$ma}"; Yii::app()->session['condition'] = $condition; $this->actionIndex(null, $condition, false); }
/** * Lọc tin xe tìm khách theo loại xe ghép */ public function actionLoc_theo_xe() { $maLoaiXe = Yii::app()->request->getParam('id'); $matins = Tinghepxe::listMaTin(Tinghepxe::CODE_XTK, ' AND ma_loai_xe_ghep= ' . $maLoaiXe); $ma = '('; foreach ($matins as $matin) { $ma .= $matin['ma_tin'] . ','; } $ma .= '0)'; $condition = " AND tinkhachhang.ma_tin IN {$ma}"; Yii::app()->session['condition'] = $condition; $this->actionIndex(null, $condition, false); }