public function actionGetStarted($id) { $curUser = Customer::model()->findByPk($id); if (empty($curUser->id)) { throw new CHttpException(403, 'Customer Does\'t exists'); } // saving current customer to session Yii::app()->session['last_created_user'] = $curUser->attributes; $getStarted = AppContent::model()->findAll(); $this->render('getStarted', array('getStarted' => $getStarted)); }
public function actionGetStarted($id) { unset(Yii::app()->session['menus']); $curUser = Customer::model()->findByPk($id); if (empty($curUser->id)) { throw new CHttpException(403, 'Customer Does\'t exists'); } // saving current customer to session Yii::app()->session['last_created_user'] = $curUser->attributes; $bannerImg = Banner::model()->findByAttributes(array('isactive' => 1, 'loc' => 2)); $getStarted = AppContent::model()->findAll(); $this->render('getStarted', array('getStarted' => $getStarted, 'customer' => $curUser, 'bannerImg' => $bannerImg)); }
static function parseTreeArray($root_id, $data) { self::$node_list = array(); self::$child_list = array(); foreach ($data as $add) { self::$node_list[$add['id']] = $add; } //去掉root节点 $result = self::$node_list[$root_id]; foreach (self::$node_list as $node) { if ($node['id'] == $root_id) { continue; } self::$child_list[$node['pid']][] = $node; } $result['child'] = self::getTreeChilds($root_id); return $result; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return AppContent the loaded model * @throws CHttpException */ public function loadModel($id) { $model = AppContent::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }