摘要: 1.查询数据库是否开启慢查询记录 SHOW VARIABLES like 'slow_query_log' 2.开启慢查询记录 修改mysql配置文件 /etc/my.cnf #开启MySQL慢日志查询开关 slow_query_log = 1 #设置慢日志的时间为5秒,SQL语句执行时间超过2秒, 阅读全文
posted @ 2023-09-11 17:35 CanyingV 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 1.安装 composer require mews/captcha 2.获取验证码接口 $data = Captcha::create('default', true); return $this->success($data); 3.验证接口 //用户输入的验证码内容 $code = 'czuu 阅读全文
posted @ 2023-08-07 21:57 CanyingV 阅读(53) 评论(0) 推荐(0) 编辑
摘要: $list=Order::query() ->select('id','order_no') ->with([ 'orderLogs'=>function($query){ $query->select('id','order_id')->orderByDesc('id'); } ]) ->limi 阅读全文
posted @ 2023-03-11 16:49 CanyingV 阅读(55) 评论(0) 推荐(0) 编辑
摘要: $file = resource_path('test.jpg');$type = mime_content_type($file);return response()->file($file, ['Content-type' => $type]); //之前第二个参数不用加就可以,更新扩展包后,输 阅读全文
posted @ 2022-10-21 13:43 CanyingV 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 1.创建迁移文件 php artisan make:migration create_sys_admin_table 2.编写表结构 public function up() { Schema::create('sys_admin', function (Blueprint $table) { $t 阅读全文
posted @ 2022-06-23 15:40 CanyingV 阅读(68) 评论(0) 推荐(0) 编辑
摘要: use Illuminate\Support\Carbon; $period = Carbon::parse('2020-03-01')->daysUntil('2020-03-10'); $dateArr = []; foreach ($period as $date) { $dateArr[] 阅读全文
posted @ 2022-06-08 16:57 CanyingV 阅读(77) 评论(0) 推荐(0) 编辑
摘要: SELECT COLUMN_NAME, COLUMN_TYPE, COLUMN_DEFAULT, IS_NULLABLE, COLUMN_COMMENT FROM information_schema.COLUMNS WHERE table_schema = '数据库名' AND table_nam 阅读全文
posted @ 2022-06-07 13:39 CanyingV 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 1.php artisan make:command GatewayWorkerServer <?php namespace App\Console\Commands; use Illuminate\Console\Command; use GatewayWorker\BusinessWorker; 阅读全文
posted @ 2022-06-01 10:14 CanyingV 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 1.安装扩展包 composer require workerman/gateway-worker composer require workerman/gatewayclient 2.生成命令文件 php artisan make:command Workerman <?php namespace 阅读全文
posted @ 2022-06-01 10:09 CanyingV 阅读(51) 评论(0) 推荐(0) 编辑
摘要: <?php namespace App\Http\Middleware; use Closure; class AllowCrossRequest { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $req 阅读全文
posted @ 2022-05-30 16:33 CanyingV 阅读(105) 评论(0) 推荐(0) 编辑