# wjls **Repository Path**: sharewodrow/wjls ## Basic Information - **Project Name**: wjls - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-15 - **Last Updated**: 2026-03-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 基于YII2重构的服务及应用 ## 准备工作 ```text git config --global credential.helper store && git config --global core.ignorecase false && git config --global core.autocrlf true ``` ## 迁移教程 1. `git clone https://gitee.com/workwodrow/lzdls.git` 2. `cd path/to/project` 3. `php composer.phar install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --no-suggest --optimize-autoloader -vvv` 4. `php init` 5. 设置数据库以及其他配置文件 6. 挂载文件 `sshfs -o allow_other,nonempty,IdentityFile=~/.ssh/id_rsa -p port username@host:/path/to/storage/ /@storage_root` 7. 生成 xunsearch ini 文件 `php yii job/generate-xunsearch-ini-files` 8. 设置http服务器并请求测试 ### nginx重写 ```allykeynamelanguage location / { try_files $uri $uri/ /index.php$is_args$args; } location /api { try_files $uri $uri/ /api/index.php$is_args$args; } location /adminApi { try_files $uri $uri/ /adminApi/index.php$is_args$args; } location /gylApi { try_files $uri $uri/ /gylApi/index.php$is_args$args; } location /h5Api { try_files $uri $uri/ /h5Api/index.php$is_args$args; } location /dlApi { try_files $uri $uri/ /dlApi/index.php$is_args$args; } location /xcxApi { try_files $uri $uri/ /xcxApi/index.php$is_args$args; } location /admin { try_files $uri $uri/ /admin/index.php$is_args$args; } location /home { try_files $uri $uri/ /home/index.php$is_args$args; } ``` ## 应用模块 ```text dir dir/modules dir/config dir/rewrites dir/behaviors web/dir web/static/dir common/config/bootstrap.php Yii::setAlias('@dir', YII_PROJECT_ROOT . '/dir'); common/config/bootstrap-local.php this_server_is_cros common/config/main.php @property \yii\web\UrlManager $urlManager?? && isApi @property \common\components\api_tool\???Api $???ApiTool 'urlManager??' => [ 'class' => 'yii\web\UrlManager', 'cache' => false, 'baseUrl' => THIS_SERVER_BASE_URI.'/??', 'hostInfo' => THIS_SERVER_BASE_URI, 'enablePrettyUrl' => true, 'enableStrictParsing' => true, 'showScriptName' => false, 'rules' => [ //基本路径 "GET,POST,PUT,DELETE /" => "/", //模块化的路径 "GET,POST,PUT,DELETE //" => "//", //带版本号 "GET,POST,PUT,DELETE //" => "//", "GET,POST,PUT,DELETE ///" => "///", ], ], '???ApiTool' => [ 'class' => 'common\components\api_tool\???Api', ], .gitignore /web/???/index.php /web/???/robots.txt environments/dev/dir environments/dev/web/dir environments/index.php setCookieValidationKey '???/config/main-local.php', setWritable 'web/???/assets', nginx rewrite ``` ## json单数组索引 ```text ALTER TABLE `tablename` ADD INDEX idx_categories ((CAST(category_ids AS UNSIGNED ARRAY))) ``` ### 多值索引用于精确匹配 ```text INDEX idx_tag_names ((CAST(tags AS CHAR(20) ARRAY))) SELECT * FROM articles WHERE '数据库' MEMBER OF(tags); ``` ### 全文索引用于文本搜索 ```text FULLTEXT INDEX ft_tag_names ((CAST(tags->'$[*]' AS CHAR(20) ARRAY)) SELECT * FROM articles WHERE MATCH(CAST(tags->'$[*]' AS CHAR(20) ARRAY)) AGAINST('数据*' IN BOOLEAN MODE); ``` ## xunsearch ```text wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2 tar -xjf xunsearch-full-latest.tar.bz2 cd xunsearch sh setup.sh cd $prefix ; bin/xs-ctl.sh -b inet restart ``` #### wscripts xunsearch.sh ```text #!/bin/bash cd /usr/local/xunsearch bin/xs-ctl.sh -b inet restart ``` ## others ### GitHub代理 ```text #只对github.com git config --global http.https://github.com.proxy socks5://127.0.0.1:10808 ``` ## TODO 评价 拼团 限购 热度 售后 二手编辑 聊天客服 首页推荐商品功能开发方案 语言切换 查重 爬虫p贴吧