コード例 #1
0
 public function actionFindScan()
 {
     $appID = Yii::app()->getRequest()->getQuery('id');
     if (!empty($appID)) {
         $app = AppInfoList::model()->findByPk($appID);
         if ($app instanceof AppInfoList && $app->Status == 0) {
             $appSource = strtolower(Source::getSourceOS($app->SourceId));
             if (CommonFunc::isIOS() && $appSource != 'ios') {
                 throw new THttpException("对不起,您访问的链接不是IOS系统的App");
             } else {
                 if (CommonFunc::isAndroid() && $appSource != 'android') {
                     throw new THttpException("对不起,您访问的链接不是Android系统的App");
                 }
             }
             $url = $app->AppUrl;
             if (empty($url)) {
                 throw new THttpException("您访问的URL不存在");
             }
             if (CommonFunc::isWeiXin() && $appSource == 'android') {
                 echo '<div style="position:fixed;left:0;right:0;top:0;bottom:0;background-color:#000;opacity:0.85;"><img style="float:right:width:300px" src="/img/download_notice_android.png"/></div>';
                 Yii::app()->end();
             }
             $this->redirect($url);
         }
     }
 }