摘要: 假设数组为array(‘1’,‘2’,‘3’,‘4’,‘5’,‘6’); 想把它分割成四个,那么结果为array( ‘0’ => [‘1’,‘2’], ‘1’ => [‘3’,‘4’], ‘2’ => [‘5’], ‘3’ => [‘6’],); /** * * 把数组按指定的个数分隔 * @par 阅读全文
posted @ 2024-01-18 10:32 你的男孩 阅读(27) 评论(0) 推荐(0) 编辑
摘要: return self::find() ->where(["is_del" => 0, "status" => 1]) ->andWhere('CONCAT(",", `user_category_id`, ",") REGEXP ",('. implode('|', $categoryIds) . 阅读全文
posted @ 2022-01-26 16:56 你的男孩 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 这个与YII没关系,是PDO的默认处理,解决方法只需在配置中的db配置中加上attributes的相关配置就行了,如下: 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=...', 'u 阅读全文
posted @ 2021-12-02 15:14 你的男孩 阅读(422) 评论(0) 推荐(0) 编辑
摘要: Win10 系统 Docker Desktop 是 Docker 在 Windows 10 和 macOS 操作系统上的官方安装方式,这个方法依然属于先在虚拟机中安装 Linux 然后再安装 Docker 的方法。 Docker Desktop 官方下载地址: https://hub.docker. 阅读全文
posted @ 2021-08-26 15:29 你的男孩 阅读(918) 评论(0) 推荐(0) 编辑
摘要: 首先获取用户IP地址: public function ipPrevent() { if (getenv('HTTP_CLIENT_IP')) { $ip = getenv('HTTP_CLIENT_IP'); } if (getenv('HTTP_X_REAL_IP')) { $ip = gete 阅读全文
posted @ 2021-06-16 09:50 你的男孩 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 最近看到在tb上竟然有人在售卖已经公开过得激活插件???还有那么多人买,我就????? 分享一下吧: 链接:https://pan.baidu.com/s/1iEBjKRKwp6NUwE9U-WGbnw 提取码:85q6 复制这段内容后打开百度网盘手机App,操作更方便哦 直接扔进工作区,然后出现下 阅读全文
posted @ 2021-05-10 10:25 你的男孩 阅读(437) 评论(0) 推荐(1) 编辑
摘要: public static function str_insert($str, $i, $substr) { for($j=0; $j<$i; $j++){ $startstr .= $str[$j]; } for ($j=$i; $j<strlen($str); $j++){ $laststr . 阅读全文
posted @ 2021-04-26 14:37 你的男孩 阅读(2293) 评论(0) 推荐(0) 编辑
摘要: public function actionChangePicsName() { $dir = "D:/beautifulserver/app/extends/头像"; $files1 = scandir($dir); unset($files1[0]); unset($files1[1]); $f 阅读全文
posted @ 2021-04-26 10:50 你的男孩 阅读(81) 评论(0) 推荐(0) 编辑
摘要: DynamicLabelModel::find() ->select(['id','label']) ->where("FIND_IN_SET(:id,scence_id)",['id'=>$params['scence_id']]) ->asArray() ->all(); 使用 FIND_IN_ 阅读全文
posted @ 2021-04-20 19:17 你的男孩 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 1、扩展安装 composer require lustre/php-dfa-sensitive 2、推荐的敏感词库 https://codeload.github.com/jkiss/sensitive-words/zip/refs/heads/master 3、使用: 把下载好的词库放到项目本地 阅读全文
posted @ 2021-04-14 19:16 你的男孩 阅读(886) 评论(0) 推荐(0) 编辑