首页
直播
壁纸
友链
搜索
1
buildadmin百度编辑器放两个只能显示一个
4 阅读
2
MySQL如何解决深度分页问题?
4 阅读
3
太原刚罚了三家,全是这个原因!你的网站可能也在危险边缘
4 阅读
4
thinkphp6 消息队列think-queue
3 阅读
5
cURL error 60: SSL certificate problem: unable to get local issuer certificate
2 阅读
服务器运维
后端技术
前端技术
梯子
数据库
小程序
登录
搜索
标签搜索
fastadmin
服务器
codex
buildadmin
小程序
mysql
沿途的风景
累计撰写
18
篇文章
累计收到
0
条评论
首页
栏目
服务器运维
后端技术
前端技术
梯子
数据库
小程序
页面
直播
壁纸
友链
搜索到
7
篇与
» 后端技术
的结果
2026-07-05
buildadmin框架执行 npm build 命令失败了
执行 npm build 命令失败了,您可以尝试删除 根目录/web/node_modules 和包管理器对应的 锁文件,锁文件名通常是:pnpm-lock.yamlpackage-lock.jsonyarn.lock推荐使用 pnpm 或 yarn NPM包管理器,安装 pnpm 命令:npm install -g pnpm手动执行 pnpm install 和 pnpm build 命令,成功后,再打开安装页面右下角的终端,点击 重新发布 按钮若执行失败,请升级 NodeJs 和 NPM若还是执行失败,请根据报错信息排除错误后,再继续进行安装。
2026年07月05日
2 阅读
0 评论
1 点赞
2026-07-05
thinkphp6 消息队列think-queue
1.安装队列依赖composer require topthink/think-queue2.配置文件/config/queue.php<?php return [ 'default' => 'redis', 'connections' => [ 'sync' => [ 'type' => 'sync', ], 'database' => [ 'type' => 'database', 'queue' => 'default', 'table' => 'jobs', ], 'redis' => [ 'type' => 'redis', 'queue' => 'default', 'host' => '127.0.0.1', 'port' => 6379, 'password' => '', 'select' => 0, 'timeout' => 0, 'persistent' => false, ], ], 'failed' => [ 'type' => 'none', 'table' => 'failed_jobs', ], ];3.在项目下新建一个Job目录存放处理消息4.控制器编写逻辑代码 app/controller/index.phpuse think\facade\Queue; public function job(Request $request) { $params = $request->get(); $jobHandlerClassName = 'app\job\Task'; $jobQueueName = 'task'; $orderData = ['order_sn'=>$params['id']]; //Queue::later();//立即执行 $isPushed = Queue::later(10, $jobHandlerClassName, $orderData, $jobQueueName); //这儿的10是指10秒后执行队列任务 if($isPushed !== false){ echo '队列添加成功'; }else{ echo '插入失败了'; } }5.编写对应的消费者类 app\job\task.php<?php namespace app\job; use think\queue\Job; class Task { public function fire(Job $job, $data) { $rt = $this->doJob($data); if($rt){ $job->delete(); return true; } // 重试三次失败 todo... if($job->attempts() == 3){ $job->delete(); return false; } //执行失败10S后重试 $job->release(10); } public function doJob($data) { echo date('Y-m-d H:i:s')."\n"; return false; } }php think queue:listen–queue helloJobQueue \ //监听的队列的名称–delay 0 \ //如果本次任务执行抛出异常且任务未被删除时,设置其下次执行前延迟多少秒,默认为0–memory 128 \ //该进程允许使用的内存上限,以 M 为单位–sleep 3 \ //如果队列中无任务,则多长时间后重新检查–tries 0 \ //如果任务已经超过重发次数上限,则进入失败处理逻辑,默认为0–timeout 60 // work 进程允许执行的最长时间,以秒为单位6.安装守护进程(Supervisor)
2026年07月05日
3 阅读
0 评论
0 点赞
2026-07-05
setEagerlyType字段理解
官方文档介绍:V5.0.4+版本开始一对一关联预载入支持两种方式:JOIN方式(一次查询)和IN方式(两次查询),如果要使用IN方式关联预载入,在关联定义方法中添加。 这句话的意思是jion方式关联和用in方式关联两种方式,in方式关联可以理解为先查出id,在用查出来的id去in另外一个表,也就是做了两次查询。 以下例子:当设置setEagerlyType为1时,由于用的是in方式,所以用category.name是查不到关联数据的 //在goods模型中设置关联模型category public function category(){ return $this->belongsTo('Category', 'goods_category_id', 'id', [], 'LEFT')->setEagerlyType(0); //return $this->belongsTo('category','goods_category_id','id'); } //goods表关联分类表 $list = $this->model->with(['category'])->where($where)->order($sort, $order) ->paginate($limit);
2026年07月05日
0 阅读
0 评论
0 点赞
2026-07-05
fastadmin后台上传图片并压缩
fastadmin后台上传图片并没有进行压缩,而且并没有使用upload哪个公共接口,需要压缩就只能加入data-resize-width="750" data-resize-quality="0.8" <div class="form-group"> <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label> <div class="col-xs-12 col-sm-8"> <div class="input-group"> <input id="c-image" class="form-control" size="50" name="row[image]" type="text"> <div class="input-group-addon no-border no-padding"> <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-resize-width="750" data-resize-quality="0.8" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span> <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span> </div> <span class="msg-box n-right" for="c-image"></span> </div> <ul class="row list-inline faupload-preview" id="p-image"></ul> </div> </div>
2026年07月05日
0 阅读
0 评论
0 点赞
2026-07-04
fastadmin根据条件值判断是否显示按钮或显示哪个按钮
events: Table.api.events.operate, buttons: [ { name:'audit', text:'提交审核', title:'提交审核', icon: 'fa fa-share', classname: 'btn btn-xs btn-info btn-dialog btn-newSalesList', url: 'salesmanagement/customerlisttabs/newSalesList', hidden:function(row){ if(row.review_the_data != 'is_reviewing'){ return true; } } } ], formatter: Table.api.formatter.operate
2026年07月04日
1 阅读
0 评论
0 点赞
1
2
0:00