예제 #1
0
파일: questionlist.php 프로젝트: zwq/unpei
?>
</a></span>
</p>
<div style="height:auto!important;overflow: hidden;clear: both">
    <p class="fw padding10 wz">常见问题</p>
    <?php 
if (empty($jutiques)) {
    ?>
        <p class="fw padding10 wz">抱歉,未能找到该问题。</p>
    <?php 
}
?>
    <ul class="question">
        <?php 
foreach ($jutiques as $k => $v) {
    $TypeID = CsHelpQuestion::model()->findByPk($v['ID']);
    $ID = CsHelpQuestionType::model()->findByPk($TypeID['TypeID']);
    ?>
            <li><a href="javascript:void(0)" onclick="look(<?php 
    echo $v['ID'] . ',' . $ID['ID'];
    ?>
)" ><?php 
    echo $v['Title'];
    ?>
</a></li>
        <?php 
}
?>
        <div class="clear"></div>
    </ul>
</div>
예제 #2
0
 public function actionaddQuestion2()
 {
     $this->pageTitle = Yii::app()->name . '-' . "选择具体问题";
     $OrganID = Yii::app()->user->getOrganID();
     $OrganPk = Organ::model()->findByPk($OrganID);
     $TypeID = Yii::app()->request->getParam('ID');
     $qestype = CsHelpQuestionType::model()->findByPk($TypeID);
     //问题类型
     if (!$qestype) {
         $this->redirect(array('addquestion'));
     }
     if (!empty($TypeID)) {
         $childId = Yii::app()->csdb->createCommand("select ID from cs_help_question_type where ParentID = " . $TypeID)->queryAll();
         $id = array();
         if (!empty($childId)) {
             foreach ($childId as $key => $val) {
                 $id[] = $val["ID"];
             }
             //                $id = "(" . rtrim($id, ",") . ")";
             //                $jutiques = CsHelpQuestion::model()->findAll('TypeID in ' . $id); //不区分
             if ($OrganPk['Identity'] == 3) {
                 $criteria = new CDbCriteria();
                 $criteria->select = "*";
                 $criteria->addInCondition('TypeID', $id);
                 $criteria->addInCondition('part', array(0, 3));
                 //修理厂
                 $jutiques = CsHelpQuestion::model()->findAll($criteria);
             } else {
                 if ($OrganPk['Identity'] == 2) {
                     $criteria = new CDbCriteria();
                     $criteria->select = "*";
                     $criteria->addInCondition('TypeID', $id);
                     $criteria->addInCondition('part', array(0, 2));
                     //修理厂
                     $jutiques = CsHelpQuestion::model()->findAll($criteria);
                 }
             }
         }
         $this->render('addquestion2', array('questype' => $qestype, 'jutiques' => $jutiques));
     } else {
         $this->redirect(array('addquestion'));
     }
 }