diff --git a/.github/workflows/Deploy CN.yml b/.github/workflows/Deploy CN.yml new file mode 100644 index 00000000..5fd67cfb --- /dev/null +++ b/.github/workflows/Deploy CN.yml @@ -0,0 +1,37 @@ +# . +name: 🚀 Deploy INFO-SYS +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] +jobs: + gh-win-cn-all-deploy: + name: 🎉 Deploy InfoSys to CN + runs-on: ubuntu-latest + steps: + - name: 🚚 Get latest code + uses: actions/checkout@v3 + + - name: 📂 Sync files + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: ${{ secrets.CN_FTP_SERVER }} + username: ${{ secrets.CN_FTP_USER }} + password: ${{ secrets.CN_FTP_PASSWORD }} + port: ${{ secrets.CN_FTP_PORT }} + local-dir: ./ + server-dir: /wwwroot/origin-cht.mycht.cn/ + # dry-run: true + # log-level: verbose + exclude: | + **/.git* + **/.git*/** + **/node_modules/** + document/** + download_statement/** + sample/** + **/logs/** + **/web.config + **/author/document/** + *.exe + *.docx diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml new file mode 100644 index 00000000..eec9b0a3 --- /dev/null +++ b/.github/workflows/Deploy.yml @@ -0,0 +1,94 @@ +name: 🚀 Deploy INFO-SYS + +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + +jobs: + gh-win-us-deploy: + name: 🎉 Deploy InfoSys to US + runs-on: ubuntu-latest + steps: + - name: 🚚 Get latest code + uses: actions/checkout@v3 + + - name: 📂 Sync files to CHT + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: ${{ secrets.US_FTP_SERVER }} + username: ${{ secrets.US_FTP_USER }} + password: ${{ secrets.US_FTP_PASSWORD }} + port: ${{ secrets.US_FTP_PORT }} + local-dir: ./ + server-dir: /information-system/ + # dry-run: true + exclude: | + **/.git* + **/.git*/** + **/node_modules/** + document/** + download_statement/** + sample/** + **/logs/** + **/web.config + **/author/document/** + *.exe + *.docx + .ftp-deploy-sync-state.json + - name: 📂 Sync files to CT + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: ${{ secrets.US_FTP_SERVER }} + username: ${{ secrets.US_FTP_USER }} + password: ${{ secrets.US_FTP_PASSWORD }} + port: ${{ secrets.US_FTP_PORT }} + local-dir: ./ + server-dir: /origin-ct.mycht.cn/ + # dry-run: true + exclude: | + **/.git* + **/.git*/** + **/node_modules/** + document/** + download_statement/** + sample/** + **/logs/** + **/web.config + **/author/document/** + *.exe + *.docx + .ftp-deploy-sync-state.json + + gh-win-cn-deploy: + needs: gh-win-us-deploy + name: 🎉 Deploy InfoSys to CN + runs-on: ubuntu-latest + steps: + - name: 🚚 Get latest code + uses: actions/checkout@v3 + + - name: 📂 Sync files to CHT + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: ${{ secrets.CN_FTP_SERVER }} + username: ${{ secrets.CN_FTP_USER }} + password: ${{ secrets.CN_FTP_PASSWORD }} + port: ${{ secrets.CN_FTP_PORT }} + local-dir: ./ + server-dir: /wwwroot/origin-cht.mycht.cn/ + # dry-run: true + # log-level: verbose + exclude: | + **/.git* + **/.git*/** + **/node_modules/** + document/** + download_statement/** + sample/** + **/logs/** + **/web.config + **/author/document/** + *.exe + *.docx + .ftp-deploy-sync-state.json diff --git a/.gitignore b/.gitignore index 87794a8c..a286a2b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .idea -.phpintel +.phpintel +.*.json.bak +.ftp-deploy-sync-state.json .svn/* */logs/log* /web.config @@ -14,3 +16,4 @@ /application/config/database.php + diff --git a/README.md b/README.md index 2176b435..d423b3cf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # information-system 网前订单数量查看 https://cht.mycht.cn/info.php/look_order/status -商务加传统订单超过500页面报错,可用于监控 \ No newline at end of file +商务加传统订单超过500页面报错,可用于监控 + +test diff --git a/application/cache/.htaccess b/application/cache/.htaccess deleted file mode 100644 index 3418e55a..00000000 --- a/application/cache/.htaccess +++ /dev/null @@ -1 +0,0 @@ -deny from all \ No newline at end of file diff --git a/application/cache/index.html b/application/cache/index.html deleted file mode 100644 index c942a79c..00000000 --- a/application/cache/index.html +++ /dev/null @@ -1,10 +0,0 @@ - -
-Directory access is forbidden.
- - - \ No newline at end of file diff --git a/application/controllers/information.php b/application/controllers/information.php index 84f6e170..85fc3446 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -311,6 +311,8 @@ class Information extends CI_Controller //获取移动优先的模板,如果有的话 //增加判断站点,每个站点需要读取的模板不一样。 20210311 zp + //取消预览,严重影响速度 2023-08-15 ycc + /* if (is_mobile_first()) { $mobile_first_template_path = 'mobile_first/' . $this->config->item('site_code'); if (is_file(APPPATH . 'views/' . $mobile_first_template_path . EXT)) { @@ -326,9 +328,10 @@ class Information extends CI_Controller $data['mobile_first_template'] = '没有找到移动模板'; } } + */ - //CT判断是否生成静态文件 - if ($this->config->item("site_code") == "chinatravel") { + //判断是否生成静态文件 + if (is_mobile_first()) { //查找是否有静态文件 if ($this->html_file_helper('find', $data['information']->ic_url)) { $data['has_html_file'] = true; @@ -547,7 +550,7 @@ class Information extends CI_Controller echo json_encode(array('name' => 'yes', 'data' => '更新成功!')); return true; } else { - echo json_encode(array('name' => 'no', 'data' => '没有发布静态页面')); + echo json_encode(array('name' => 'no', 'data' => '没有发布静态页面: ' . $information->ic_url)); return false; } } @@ -737,18 +740,18 @@ class Information extends CI_Controller //火车票搜索框添加 -- zp if ($information->is_parent_id == "278008234") { //本地测试的火车父类ID为:278035939 。网前为:278008234 - $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai - $data_TrainCity=array(); - $data_TrainCity["from"]=""; - $data_TrainCity["to"]=""; - if (!empty($meta_train_city)){ - if (strpos($meta_train_city,'|')!==false){ - $arrTrainCity = explode('|',$meta_train_city); - $data_TrainCity["from"] = $arrTrainCity[0]; - $data_TrainCity["to"] = $arrTrainCity[1]; + $meta_train_city = get_meta($information->ic_id, 'meta_train_city'); //默认的出发及目的地城市 , beijing|shanghai + $data_TrainCity = array(); + $data_TrainCity["from"] = ""; + $data_TrainCity["to"] = ""; + if (!empty($meta_train_city)) { + if (strpos($meta_train_city, '|') !== false) { + $arrTrainCity = explode('|', $meta_train_city); + $data_TrainCity["from"] = $arrTrainCity[0]; + $data_TrainCity["to"] = $arrTrainCity[1]; } } - + $template_TrainSearch = $this->load->view($template_path . '-train-detail', $data_TrainCity, true); $template = str_replace('', $template_TrainSearch, $template); } @@ -921,6 +924,46 @@ class Information extends CI_Controller if (!empty($template_recommand['Tips Right'])) { $template = str_replace('', "