Ejemplo n.º 1
0
 /**
  * 获取配置参数
  * @return null|static
  */
 public function getConfig()
 {
     $config = SinaConfig::findOne(['id' => '1']);
     return $config;
 }
Ejemplo n.º 2
0
 /**
  * Finds the SinaConfig model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return SinaConfig the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = SinaConfig::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 3
0
 /**
  * 获取商户2的配置参数
  * @return null|static
  */
 public static function getConfigtwo()
 {
     $config = SinaConfig::findOne(['id' => '2']);
     return $config;
 }