/**
  * Finds the MOfficeCampaignPicCategory model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return MOfficeCampaignPicCategory the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = MOfficeCampaignPicCategory::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 2
0
 public function actionCsmdzltj3()
 {
     //$this->layout = 'wap';
     $this->layout = false;
     $office_id = $_GET['office_id'];
     $model_office = MOffice::findOne(['office_id' => $office_id]);
     //$campaign_pic_categories = MOfficeCampaignPicCategory::find()->orderBy('sort_order')->all();
     $gh_id = U::getSessionParam('gh_id');
     $openid = U::getSessionParam('openid');
     //$model = MUser::findOne(['gh_id'=>$gh_id, 'openid'=>$openid]);
     Yii::$app->wx->setGhId($gh_id);
     $gh = Yii::$app->wx->getGh();
     $jssdk = new JSSDK($gh['appid'], $gh['appsecret']);
     $model_category_id = $_GET['model_category_id'];
     $model_ocpc = MOfficeCampaignPicCategory::findOne(['id' => $model_category_id]);
     return $this->render('csmdzltj3', ['gh_id' => $gh_id, 'openid' => $openid, 'model_office' => $model_office, 'model_ocpc' => $model_ocpc, 'jssdk' => $jssdk]);
 }